diff --git a/tests/visualization/test_datasets.py b/tests/visualization/test_datasets.py new file mode 100644 index 000000000..bb1a7e3cc --- /dev/null +++ b/tests/visualization/test_datasets.py @@ -0,0 +1,82 @@ +"""Tests for browser dataset-format detection.""" + +from pathlib import Path + +from visualization.datasets import detect_dataset_format + + +def _touch(root: Path, *relative_paths: str) -> None: + for relative in relative_paths: + path = root / relative + path.parent.mkdir(parents=True, exist_ok=True) + path.write_bytes(b"test") + + +def test_detects_mobilebrick_layout(tmp_path: Path) -> None: + _touch(tmp_path, "image/000.jpg", "intrinsic/000.txt", "pose/000.txt") + + detected = detect_dataset_format(tmp_path) + + assert detected["loader"] == "mobilebrick" + assert detected["images_dir"] == "image" + assert detected["loader_options"]["use_gt_intrinsics"] is True + + +def test_detects_colmap_text_layout(tmp_path: Path) -> None: + _touch(tmp_path, "cameras.txt", "images.txt", "points3D.txt", "images/one.jpg") + + detected = detect_dataset_format(tmp_path) + + assert detected["loader"] == "colmap" + assert detected["confidence"] > 0.9 + + +def test_olsson_signature_wins_over_nested_colmap_ground_truth(tmp_path: Path) -> None: + _touch( + tmp_path, + "data.mat", + "images/one.jpg", + "colmap_ground_truth/cameras.txt", + "colmap_ground_truth/images.txt", + "colmap_ground_truth/points3D.txt", + ) + + detected = detect_dataset_format(tmp_path) + + assert detected["loader"] == "olsson" + + +def test_detects_tanks_and_temples_with_portable_paths(tmp_path: Path) -> None: + _touch(tmp_path, "Barn_COLMAP_SfM.log", "Barn.json", "Barn_trans.txt", "Barn/000001.jpg") + + detected = detect_dataset_format(tmp_path) + + assert detected["loader"] == "tanks_and_temples" + assert detected["images_dir"] == "Barn" + assert detected["loader_options"]["poses_fpath"] == "Barn_COLMAP_SfM.log" + + +def test_generic_images_use_exif_optional_loader(tmp_path: Path) -> None: + _touch(tmp_path, "photos/one.jpg", "photos/two.png") + + detected = detect_dataset_format(tmp_path) + + assert detected["loader"] == "one_d_sfm" + assert detected["images_dir"] == "photos" + assert detected["confidence"] < 0.9 + + +def test_detects_argoverse_dataset_subdirectory(tmp_path: Path) -> None: + log_id = "273c1883-673a-36bf-b124-88311b1a80be" + _touch( + tmp_path, + f"train1/{log_id}/vehicle_calibration_info.json", + f"train1/{log_id}/poses/city_SE3_egovehicle_1.json", + f"train1/{log_id}/ring_front_center/ring_front_center_1.jpg", + ) + + detected = detect_dataset_format(tmp_path) + + assert detected["loader"] == "argoverse" + assert detected["dataset_subdir"] == "train1" + assert detected["loader_options"]["log_id"] == log_id diff --git a/tests/visualization/test_runtime.py b/tests/visualization/test_runtime.py index 4faaa9f23..96db16a64 100644 --- a/tests/visualization/test_runtime.py +++ b/tests/visualization/test_runtime.py @@ -165,6 +165,32 @@ def test_loader_specific_options_are_validated_and_forwarded(tmp_path: Path, mon assert "loader.stride=2" in args +def test_build_runner_args_auto_detects_dataset_loader(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None: + dataset = tmp_path / "dataset" + (dataset / "image").mkdir(parents=True) + (dataset / "intrinsic").mkdir() + (dataset / "pose").mkdir() + (dataset / "image" / "000.jpg").write_bytes(b"image") + (dataset / "intrinsic" / "000.txt").write_text("intrinsics", encoding="utf-8") + (dataset / "pose" / "000.txt").write_text("pose", encoding="utf-8") + monkeypatch.setattr(runtime, "detect_hardware", _cuda_hardware) + + args, _ = runtime.build_runner_args( + { + "config_name": "vggt", + "loader": "auto", + "dataset_dir": str(dataset), + "hardware": "cpu", + "splat_implementation": "none", + }, + tmp_path / "output", + ) + + assert args[args.index("--loader") + 1] == "mobilebrick" + assert args[args.index("--images_dir") + 1] == str((dataset / "image").resolve()) + assert "loader.use_gt_intrinsics=true" in args + + def test_workspace_api_and_scene_discovery(tmp_path: Path) -> None: scene = tmp_path / "example" / "ba_output" scene.mkdir(parents=True) @@ -208,7 +234,18 @@ def test_workspace_api_and_scene_discovery(tmp_path: Path) -> None: samples_response = client.get("/api/samples") assert samples_response.status_code == 200 samples = {item["id"]: item for item in samples_response.json()["items"]} - assert set(samples) == {"lund-door", "crane-mast", "mobilebrick"} + assert set(samples) == { + "one-d-sfm", + "argoverse", + "astrovision-vesta", + "lund-door", + "crane-mast", + "hilti-exp4", + "imb-reichstag", + "mobilebrick", + "tanks-temples-barn", + } + assert samples["crane-mast"]["image_count"] == 2 assert samples["crane-mast"]["recommendations"]["loader"] == "colmap" assert samples["lund-door"]["source_url"].startswith("https://github.com/borglab/gtsfm/") @@ -507,6 +544,7 @@ def test_workspace_imports_dropped_folder(tmp_path: Path) -> None: assert response.json()["analysis"]["image_count"] == 1 assert response.json()["analysis"]["total_megapixels"] == 0.96 assert response.json()["analysis"]["max_width"] == 1200 + assert response.json()["format_detection"]["loader"] == "one_d_sfm" assert imported.is_dir() assert (imported / "images" / "one.jpg").read_bytes() == image_buffer.getvalue() assert (imported / "cameras.txt").read_bytes() == b"camera" diff --git a/visualization/app.py b/visualization/app.py index 1fc23487d..7359cea91 100644 --- a/visualization/app.py +++ b/visualization/app.py @@ -28,6 +28,7 @@ from pydantic import BaseModel, ConfigDict from starlette.websockets import WebSocketDisconnect +from visualization.datasets import IMAGE_SUFFIXES, detect_dataset_format from visualization.modal_deployment import (ModalDeploymentManager, modal_workspace_api_key) from visualization.runtime import (JobManager, configuration_schema, @@ -40,7 +41,6 @@ STATIC_ROOT = PACKAGE_ROOT / "static" TEMPLATE_ROOT = PACKAGE_ROOT / "templates" SPLAT_EXPORT_FORMATS = {"ply"} -IMAGE_SUFFIXES = {".avif", ".bmp", ".heic", ".heif", ".jpeg", ".jpg", ".png", ".tif", ".tiff", ".webp"} _LOG_LEVEL_MESSAGE = re.compile(r"\b(?:DEBUG|INFO|WARNING|ERROR|CRITICAL):\s*(.+)$") _PIPELINE_STATUS_MARKERS = ( "gtsfm:", @@ -502,6 +502,7 @@ def upload_input_folder( "file_count": file_count, "bytes": total_bytes, "analysis": analyze_image_dataset(dataset_root), + "format_detection": detect_dataset_format(dataset_root), } @app.post("/api/uploads/archive", dependencies=[Depends(require_api_key)]) @@ -531,6 +532,7 @@ def upload_input_archive(archive: Annotated[UploadFile, File()]) -> dict[str, An "file_count": file_count, "bytes": total_bytes, "analysis": analyze_image_dataset(upload_root), + "format_detection": detect_dataset_format(upload_root), } @app.post("/api/remote/inspect") diff --git a/visualization/datasets.py b/visualization/datasets.py new file mode 100644 index 000000000..f8943d3e8 --- /dev/null +++ b/visualization/datasets.py @@ -0,0 +1,186 @@ +"""Dataset-layout detection for Studio uploads and curated examples.""" + +from __future__ import annotations + +from pathlib import Path +from typing import Any + + +IMAGE_SUFFIXES = {".avif", ".bmp", ".heic", ".heif", ".jpeg", ".jpg", ".png", ".tif", ".tiff", ".webp"} + + +def _relative_files(root: Path) -> list[Path]: + return [path.relative_to(root) for path in root.rglob("*") if path.is_file()] + + +def detect_dataset_format(root: Path) -> dict[str, Any]: + """Infer the most likely GTSFM loader from a dataset's directory structure. + + The detector deliberately uses structural signatures rather than directory + names. Its result is a recommendation; callers may still select a loader + manually. Relative path-valued loader options remain portable when a + dataset is copied to a remote workspace. + """ + + root = root.expanduser().resolve() + if not root.is_dir(): + raise ValueError(f"Dataset directory does not exist: {root}") + + files = _relative_files(root) + lowered = {path.as_posix().lower() for path in files} + top_dir_names = {path.parts[0] for path in files if len(path.parts) > 1} + top_dirs = {name.lower() for name in top_dir_names} + basenames = {path.name.lower() for path in files} + image_files = [path for path in files if path.suffix.lower() in IMAGE_SUFFIXES] + + def result( + loader: str, + confidence: float, + reason: str, + *, + dataset_subdir: str | None = None, + images_dir: str | None = None, + loader_options: dict[str, Any] | None = None, + alternatives: list[str] | None = None, + ) -> dict[str, Any]: + return { + "loader": loader, + "confidence": confidence, + "reason": reason, + "dataset_subdir": dataset_subdir, + "images_dir": images_dir, + "loader_options": loader_options or {}, + "alternatives": alternatives or [], + } + + # MobileBrick has the strongest and most distinctive three-directory signature. + if {"image", "intrinsic", "pose"}.issubset(top_dirs): + return result( + "mobilebrick", + 0.99, + "Found MobileBrick image, intrinsic, and pose directories.", + images_dir="image", + loader_options={"use_gt_intrinsics": True, "max_frame_lookahead": 5}, + ) + + # Tanks and Temples contains a Redwood pose log, bounding volume, alignment, and scene image directory. + pose_logs = sorted(path for path in files if path.name.endswith("_COLMAP_SfM.log")) + alignments = sorted(path for path in files if path.name.endswith("_trans.txt")) + scene_json = sorted(path for path in files if path.suffix.lower() == ".json") + if pose_logs and alignments and scene_json: + scene_name = pose_logs[0].name.removesuffix("_COLMAP_SfM.log") + image_dir = next( + (name for name in top_dir_names if name.lower() == scene_name.lower()), + next((path.parts[0] for path in image_files if len(path.parts) > 1), "images"), + ) + return result( + "tanks_and_temples", + 0.99, + "Found the Tanks and Temples pose log, bounding volume, and alignment transform.", + images_dir=str(image_dir), + loader_options={ + "poses_fpath": pose_logs[0].as_posix(), + "bounding_polyhedron_json_fpath": scene_json[0].as_posix(), + "ply_alignment_fpath": alignments[0].as_posix(), + }, + ) + + # Hilti calibration and LiDAR priors are unique even when the sample contains only a few rig timestamps. + if {"calibration", "images", "lidar"}.issubset(top_dirs) and "lidar/fastlio2.g2o" in lowered: + return result("hilti", 0.99, "Found Hilti calibration, synchronized images, and LiDAR priors.") + + # YFCC IMB datasets pair HDF5 calibrations with precomputed visibility-pair arrays. + if {"calibration", "images", "new-vis-pairs"}.issubset(top_dirs) and any( + path.startswith("new-vis-pairs/keys-th-") and path.endswith(".npy") for path in lowered + ): + return result("yfcc_imb", 0.99, "Found YFCC calibration files and IMB visibility-pair arrays.") + + # Argoverse logs are identified by a vehicle calibration file and timestamped camera/pose directories. + calibration_paths = sorted(path for path in files if path.name == "vehicle_calibration_info.json") + if calibration_paths: + calibration = calibration_paths[0] + log_dir = calibration.parent + dataset_prefix = log_dir.parent + # The loader expects dataset_dir to contain log_id directly. A non-empty + # prefix is surfaced so the caller can adjust the effective root. + return result( + "argoverse", + 0.99, + "Found an Argoverse log with vehicle calibration, poses, and ring-camera images.", + dataset_subdir=dataset_prefix.as_posix() if dataset_prefix.parts else None, + loader_options={"log_id": log_dir.name, "stride": 1, "max_num_imgs": len(image_files)}, + ) + + # Olsson datasets may also contain a nested COLMAP ground-truth export. + # Their top-level data.mat is the authoritative loader signature. + if "data.mat" in basenames and image_files: + return result("olsson", 0.98, "Found an Olsson data.mat reconstruction with source images.") + + # AstroVision is a COLMAP binary model with an accompanying target-body mesh. + colmap_binary = {"cameras.bin", "images.bin", "points3d.bin"}.issubset(basenames) + if colmap_binary and any( + path.name.lower().startswith("vesta_") and path.suffix.lower() == ".ply" for path in files + ): + mesh = next(path for path in files if path.name.lower().startswith("vesta_") and path.suffix.lower() == ".ply") + return result( + "astrovision", + 0.99, + "Found an AstroVision COLMAP binary model and target-body mesh.", + loader_options={"gt_scene_mesh_path": mesh.as_posix(), "use_gt_extrinsics": True}, + ) + + # Generic COLMAP text and binary models share the same three canonical files. + colmap_text = {"cameras.txt", "images.txt", "points3d.txt"}.issubset(basenames) + if colmap_text or colmap_binary: + return result( + "colmap", + 0.98, + f"Found a complete COLMAP {'text' if colmap_text else 'binary'} sparse model.", + loader_options={"use_gt_intrinsics": True, "use_gt_extrinsics": True}, + alternatives=["astrovision"] if colmap_binary else [], + ) + + # Plain image collections are valid but structurally ambiguous. OneDSFM is + # the safer automatic choice because it tolerates images without EXIF. + if image_files: + if "images" in top_dirs: + images_dir = None + elif len({path.parts[0] for path in image_files if len(path.parts) > 1}) == 1: + images_dir = next(path.parts[0] for path in image_files if len(path.parts) > 1) + else: + images_dir = "." + return result( + "one_d_sfm", + 0.65, + "Found a generic image collection; selected the EXIF-optional 1DSfM loader.", + images_dir=images_dir, + loader_options={"enable_no_exif": True, "default_focal_length_factor": 1.2}, + alternatives=["olsson"], + ) + + return result( + "olsson", + 0.0, + "No recognized image-dataset structure was found. Choose a format manually.", + alternatives=["colmap", "one_d_sfm", "mobilebrick"], + ) + + +def resolve_relative_loader_paths( + dataset_dir: Path, loader_options: dict[str, Any], images_dir: str | None +) -> tuple[dict[str, Any], str | None]: + """Resolve detector-produced relative paths against the active dataset root.""" + + resolved = dict(loader_options) + for name, value in list(resolved.items()): + if not isinstance(value, str) or not (name.endswith("_path") or name.endswith("_fpath")): + continue + path = Path(value).expanduser() + if not path.is_absolute(): + resolved[name] = str((dataset_dir / path).resolve()) + if images_dir: + image_path = Path(images_dir).expanduser() + images_dir = ( + str((dataset_dir / image_path).resolve()) if not image_path.is_absolute() else str(image_path.resolve()) + ) + return resolved, images_dir diff --git a/visualization/frontend/src/main.tsx b/visualization/frontend/src/main.tsx index 8b70ffb3e..91b36e5a9 100644 --- a/visualization/frontend/src/main.tsx +++ b/visualization/frontend/src/main.tsx @@ -344,6 +344,7 @@ interface UploadedFolder { file_count: number; bytes: number; analysis: DatasetAnalysis; + format_detection: DatasetFormatDetection; } interface DatasetAnalysis { @@ -355,6 +356,16 @@ interface DatasetAnalysis { max_height: number; } +interface DatasetFormatDetection { + loader: string; + confidence: number; + reason: string; + dataset_subdir?: string | null; + images_dir?: string | null; + loader_options: LoaderValues; + alternatives: string[]; +} + interface SampleDataset extends Choice { description: string; image_count: number; @@ -891,6 +902,8 @@ interface RunFormProps { function RunForm({ schema, hardware, samples, samplesLoading, onStarted, onTabChange, remotePromptKey, schemaLoading, schemaError, onRetrySchema }: RunFormProps) { const [form, setForm] = useState(EMPTY_FORM); const [inputMode, setInputMode] = useState<"upload" | "sample">("upload"); + const [formatAutomatic, setFormatAutomatic] = useState(true); + const [formatDetection, setFormatDetection] = useState(null); const [loaderOptions, setLoaderOptions] = useState({}); const [remote, setRemote] = useState(null); const [remoteMessage, setRemoteMessage] = useState(""); @@ -946,6 +959,7 @@ function RunForm({ schema, hardware, samples, samplesLoading, onStarted, onTabCh const selectedHardware = hardware?.devices.find((item) => item.id === form.hardware); const machineProfile = advancedMachineProfile(form, hardware, selectedHardware); const selectedSample = samples.find((item) => item.id === form.sample_id); + const formatOptions: Choice[] = [{ id: "auto", label: "Auto-detect · Recommended" }, ...schema.loaders.map((loader) => ({ id: loader, label: displayName(loader) }))]; const datasetAnalysis = inputMode === "sample" ? preparedSample?.analysis : imagesFolder?.analysis?.image_count ? imagesFolder.analysis : datasetFolder?.analysis; @@ -1221,10 +1235,19 @@ function RunForm({ schema, hardware, samples, samplesLoading, onStarted, onTabCh setPreparedSample(null); setSampleMessage(""); if (!sample) { + setFormatDetection(null); setForm((current) => ({ ...current, sample_id: "", dataset_dir: "" })); return; } const recommendations = sample.recommendations; + setFormatAutomatic(true); + setFormatDetection({ + loader: recommendations.loader, + confidence: 1, + reason: "Verified from the sample's upstream GitHub directory structure.", + loader_options: recommendations.loader_options ?? {}, + alternatives: [], + }); setLoaderOptions(recommendations.loader_options ?? {}); setForm((current) => ({ ...current, @@ -1253,7 +1276,8 @@ function RunForm({ schema, hardware, samples, samplesLoading, onStarted, onTabCh if (form.execution_target === "remote" && form.remote_provider === "modal" && !remote?.verified) { throw new Error("The Modal workspace must pass its health check before a reconstruction can start."); } - const payload = { ...form, api_key: form.execution_target === "remote" ? modalBearerToken(form) : "", loader_options: loaderOptions, + const payload = { ...form, + loader: formatAutomatic ? "auto" : form.loader, api_key: form.execution_target === "remote" ? modalBearerToken(form) : "", loader_options: loaderOptions, hardware: form.execution_target === "remote" ? form.remote_hardware : form.hardware, max_resolution: form.max_resolution ? Number(form.max_resolution) : null, num_workers: Number(form.num_workers), threads_per_worker: Number(form.threads_per_worker), @@ -1303,15 +1327,26 @@ function RunForm({ schema, hardware, samples, samplesLoading, onStarted, onTabCh set("name", value)} autoComplete="off" />
{inputMode === "upload" ? <> { setDatasetFolder(folder); set("dataset_dir", folder?.path ?? ""); + setFormatDetection(folder?.format_detection ?? null); + if (formatAutomatic && folder?.format_detection) { + set("loader", folder.format_detection.loader); + setLoaderOptions(folder.format_detection.loader_options ?? {}); + } if (folder && form.name === "my-scene") set("name", folder.name.replace(/[^A-Za-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "my-scene"); }} /> { @@ -1326,7 +1361,20 @@ function RunForm({ schema, hardware, samples, samplesLoading, onStarted, onTabCh }

Dataset format, VGGT model, resolution, and available loader settings are applied automatically.

} - { set("loader", value); setLoaderOptions({}); }} /> + { + if (value === "auto") { + setFormatAutomatic(true); + if (formatDetection) { + set("loader", formatDetection.loader); + setLoaderOptions(formatDetection.loader_options ?? {}); + } + return; + } + setFormatAutomatic(false); set("loader", value); setLoaderOptions({}); + }} /> + {formatAutomatic &&

+ {formatDetection ? <>{displayName(formatDetection.loader)} · {formatDetection.reason} : "Upload a dataset or choose a GitHub sample and the backend will inspect its directory structure."} +

}
diff --git a/visualization/frontend/src/styles.css b/visualization/frontend/src/styles.css index 1b47e28cb..d6916313a 100644 --- a/visualization/frontend/src/styles.css +++ b/visualization/frontend/src/styles.css @@ -1258,6 +1258,24 @@ input[type="checkbox"] { font-family: "SFMono-Regular", Consolas, monospace; } +.format-detection { + margin-top: -7px; + padding: 8px 9px; + border-left: 2px solid var(--success); + background: #eef4ef; + color: #526159; +} + +.format-detection strong { + color: #315843; +} + +.format-detection.warning { + border-left-color: #b78d38; + background: #f7f3e8; + color: #746748; +} + .mini-heading { margin: 1px 0 10px; color: var(--ink-soft); diff --git a/visualization/runtime.py b/visualization/runtime.py index b21c8965e..63bbeb6d1 100644 --- a/visualization/runtime.py +++ b/visualization/runtime.py @@ -31,6 +31,7 @@ import yaml import gtsfm +from visualization.datasets import detect_dataset_format, resolve_relative_loader_paths PACKAGE_ROOT = Path(gtsfm.__file__).resolve().parent CONFIG_ROOT = PACKAGE_ROOT / "configs" @@ -638,10 +639,21 @@ def build_runner_args(spec: Mapping[str, Any], output_root: Path) -> tuple[list[ capabilities = {item["id"]: item["capabilities"] for item in schema["models"]}.get(config_name, {}) if splat_implementation == "gsplat" and not capabilities.get("iterative_splat"): raise ValueError(f"The {config_name} model does not support iterative Gaussian splatting") - loader = _validate_choice(spec.get("loader"), schema["loaders"], "loader") dataset_dir = Path(str(spec.get("dataset_dir") or "")).expanduser().resolve() if not dataset_dir.is_dir(): raise ValueError(f"Dataset directory does not exist: {dataset_dir}") + requested_loader = str(spec.get("loader") or "auto") + format_detection = detect_dataset_format(dataset_dir) + automatic_loader = requested_loader == "auto" + if automatic_loader: + dataset_subdir = str(format_detection.get("dataset_subdir") or "").strip() + if dataset_subdir: + dataset_dir = (dataset_dir / dataset_subdir).resolve() + if not dataset_dir.is_dir(): + raise ValueError(f"Detected dataset subdirectory does not exist: {dataset_dir}") + loader = _validate_choice(format_detection["loader"], schema["loaders"], "detected loader") + else: + loader = _validate_choice(requested_loader, schema["loaders"], "loader") args = [ "--config_name", @@ -660,7 +672,12 @@ def build_runner_args(spec: Mapping[str, Any], output_root: Path) -> tuple[list[ str(spec.get("worker_memory_limit") or "32GB"), ] - images_dir = str(spec.get("images_dir") or "").strip() + detected_options = dict(format_detection.get("loader_options") or {}) if automatic_loader else {} + detected_images_dir = str(format_detection.get("images_dir") or "").strip() if automatic_loader else "" + detected_options, detected_images_dir = resolve_relative_loader_paths( + dataset_dir, detected_options, detected_images_dir or None + ) + images_dir = str(spec.get("images_dir") or detected_images_dir or "").strip() if images_dir: resolved_images = Path(images_dir).expanduser().resolve() if not resolved_images.is_dir(): @@ -684,6 +701,8 @@ def build_runner_args(spec: Mapping[str, Any], output_root: Path) -> tuple[list[ loader_option_values = spec.get("loader_options") or {} if not isinstance(loader_option_values, Mapping): raise ValueError("Loader options must be an object") + loader_option_values = {**detected_options, **loader_option_values} + loader_option_values, _ = resolve_relative_loader_paths(dataset_dir, loader_option_values, None) unknown_loader_options = set(loader_option_values) - set(loader_option_schema) if unknown_loader_options: raise ValueError(f"Unknown options for the {loader} loader: {', '.join(sorted(unknown_loader_options))}") diff --git a/visualization/samples.py b/visualization/samples.py index 419d923c8..436284106 100644 --- a/visualization/samples.py +++ b/visualization/samples.py @@ -25,6 +25,50 @@ _SSL_CONTEXT = ssl.create_default_context(cafile=certifi.where()) SAMPLE_DATASETS: tuple[dict[str, Any], ...] = ( + { + "id": "one-d-sfm", + "label": "1DSfM Images", + "description": "4-image internet-photo scene without reconstruction metadata.", + "image_count": 4, + "source_path": "tests/data/1dsfm", + "recommendations": { + "loader": "one_d_sfm", + "config_name": "vggt", + "max_resolution": 518, + "loader_options": {"enable_no_exif": True, "default_focal_length_factor": 1.2}, + }, + }, + { + "id": "argoverse", + "label": "Argoverse Tracking", + "description": "2-frame vehicle log with calibration, poses, and timestamped camera images.", + "image_count": 2, + "source_path": "tests/data/argoverse/train1", + "recommendations": { + "loader": "argoverse", + "config_name": "vggt", + "max_resolution": 518, + "loader_options": { + "log_id": "273c1883-673a-36bf-b124-88311b1a80be", + "stride": 1, + "max_num_imgs": 2, + "camera_name": "ring_front_center", + }, + }, + }, + { + "id": "astrovision-vesta", + "label": "AstroVision Vesta", + "description": "4-image grayscale scene with COLMAP binary geometry and a Vesta mesh.", + "image_count": 4, + "source_path": "tests/data/astrovision/test_2011212_opnav_022", + "recommendations": { + "loader": "astrovision", + "config_name": "vggt", + "max_resolution": 518, + "loader_options": {"gt_scene_mesh_path": "vesta_5002.ply", "use_gt_extrinsics": True}, + }, + }, { "id": "lund-door", "label": "Lund Door", @@ -41,8 +85,8 @@ { "id": "crane-mast", "label": "Crane Mast", - "description": "8-image scene with COLMAP cameras, poses, and sparse points.", - "image_count": 8, + "description": "2-image scene with COLMAP cameras, poses, and sparse points.", + "image_count": 2, "source_path": "tests/data/crane_mast_8imgs_colmap_output", "recommendations": { "loader": "colmap", @@ -51,6 +95,32 @@ "loader_options": {"use_gt_intrinsics": True, "use_gt_extrinsics": True}, }, }, + { + "id": "hilti-exp4", + "label": "Hilti Exp4", + "description": "16 synchronized multi-camera images with calibration and LiDAR priors.", + "image_count": 16, + "source_path": "tests/data/hilti_exp4_small", + "recommendations": { + "loader": "hilti", + "config_name": "vggt", + "max_resolution": 518, + "loader_options": {"max_length": 3}, + }, + }, + { + "id": "imb-reichstag", + "label": "IMB Reichstag", + "description": "10-image YFCC scene with HDF5 calibration and visibility-pair metadata.", + "image_count": 10, + "source_path": "tests/data/imb_reichstag", + "recommendations": { + "loader": "yfcc_imb", + "config_name": "vggt", + "max_resolution": 518, + "loader_options": {"co_visibility_threshold": 0.1}, + }, + }, { "id": "mobilebrick", "label": "MobileBrick", @@ -64,6 +134,24 @@ "loader_options": {"use_gt_intrinsics": True, "max_frame_lookahead": 5}, }, }, + { + "id": "tanks-temples-barn", + "label": "Tanks and Temples Barn", + "description": "3-image Barn scene with Redwood poses, bounds, and alignment metadata.", + "image_count": 3, + "source_path": "tests/data/tanks_and_temples_barn", + "recommendations": { + "loader": "tanks_and_temples", + "config_name": "vggt", + "max_resolution": 518, + "loader_options": { + "poses_fpath": "Barn_COLMAP_SfM.log", + "bounding_polyhedron_json_fpath": "Barn.json", + "ply_alignment_fpath": "Barn_trans.txt", + "max_num_images": 3, + }, + }, + }, ) diff --git a/visualization/static/studio.css b/visualization/static/studio.css index 5e122b870..bb6d92835 100644 --- a/visualization/static/studio.css +++ b/visualization/static/studio.css @@ -1 +1 @@ -:root{--ink: #20211f;--ink-soft: #666761;--ink-faint: #96978f;--paper: #f4f4f0;--paper-raised: #fafaf7;--line: #d8d8d1;--line-dark: #c7c7bf;--viewport: #0e1012;--viewport-line: #2a2e31;--accent: #e45d37;--accent-dark: #c94825;--success: #3a8060;--danger: #b94b40;--control-height: 40px}*{box-sizing:border-box}html,body{height:100%}body{margin:0;overflow:hidden;background:var(--viewport);color:var(--ink);font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:13px;line-height:1.45;-webkit-font-smoothing:antialiased}#root,.app-shell{width:100%;height:100%}.app-shell{display:flex}button,input,select,textarea{font:inherit}button{color:inherit}.hidden{display:none!important}#sidebar{position:relative;z-index:10;display:flex;flex:0 0 var(--sidebar-width, 420px);min-width:320px;flex-direction:column;overflow:hidden;background:var(--paper);border-right:1px solid #292b2d;transition:flex-basis .18s ease,min-width .18s ease}#sidebar.sidebar-resizing{transition:none}.sidebar-resize-handle{position:absolute;z-index:20;top:0;right:0;bottom:0;width:9px;touch-action:none;cursor:col-resize;outline:0}.sidebar-resize-handle:after{position:absolute;top:0;right:0;bottom:0;width:2px;background:var(--accent);content:"";opacity:0;transition:opacity .12s ease}.sidebar-resize-handle:hover:after,.sidebar-resize-handle:focus-visible:after,.sidebar-resizing .sidebar-resize-handle:after{opacity:1}.sidebar-collapsed .sidebar-resize-handle{display:none}body.sidebar-is-resizing,body.sidebar-is-resizing *{cursor:col-resize!important;-webkit-user-select:none!important;user-select:none!important}#sidebar.sidebar-collapsed{flex-basis:0;min-width:0;overflow:visible;border-right:0;background:transparent}.studio-header{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:79px;padding:12px 22px;border-bottom:1px solid var(--line)}.brand-logo{display:block;width:194px;max-width:100%;height:auto}.brand-primary{display:flex;min-width:0;align-items:center;gap:9px}.brand-mark{display:none;width:31px;height:31px;object-fit:contain}.sidebar-toggle{display:grid;width:31px;height:31px;flex:0 0 31px;place-items:center;border:1px solid var(--line-dark);border-radius:2px;padding:0;background:var(--paper-raised);color:var(--ink-soft);cursor:pointer}.sidebar-toggle:hover{border-color:var(--ink);color:var(--ink)}.sidebar-toggle:focus-visible{outline:1px solid var(--accent);outline-offset:2px}.sidebar-collapsed .studio-header{position:absolute;top:18px;left:18px;width:auto;min-height:0;gap:5px;justify-content:flex-start;padding:0;border:0;background:transparent}.sidebar-collapsed .brand-primary,.sidebar-collapsed .workspace-tabs{display:none}.sidebar-collapsed .brand-mark{display:block}.sidebar-collapsed .sidebar-toggle{border-color:#45494b;background:#131517e0;color:#d8d9d5;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.sidebar-collapsed+#main-content #sceneStats{left:103px}.studio-tabs{display:flex;min-height:43px;padding:0 22px;gap:24px;border-bottom:1px solid var(--line)}.studio-tab{position:relative;border:0;padding:0;background:transparent;color:var(--ink-soft);font-size:11px;font-weight:650;cursor:pointer}.studio-tab:after{position:absolute;right:0;bottom:-1px;left:0;height:2px;background:var(--ink);content:"";opacity:0}.studio-tab:hover,.studio-tab[data-state=active]{color:var(--ink)}.studio-tab:focus-visible,.target-choice:focus-visible,.primary-action:focus-visible,.secondary-action:focus-visible,.icon-button:focus-visible,.text-button:focus-visible,#hud button:focus-visible,.setup-panel button:focus-visible,.setup-reopen:focus-visible{outline:1px solid var(--accent);outline-offset:2px}.studio-tab[data-state=active]:after{opacity:1}#activeJobCount:not(:empty){display:inline-grid;min-width:17px;height:17px;margin-left:4px;place-items:center;border-radius:50%;background:var(--accent);color:#fff;font-size:9px}.studio-panel{display:none;min-height:0;flex:1;overflow-y:auto;padding:0 22px 30px;scrollbar-color:var(--line-dark) transparent;scrollbar-width:thin}.studio-panel[data-state=active]{display:block}.workspace-tabs{display:flex;min-height:0;flex:1;flex-direction:column}.studio-tab{display:flex;align-items:center;gap:5px}.panel-intro{position:relative;padding:22px 0 14px}.catalog-sync{position:absolute;top:21px;right:0;display:inline-flex;align-items:center;gap:5px;border:0;background:transparent;color:var(--ink-faint);font-family:SFMono-Regular,Consolas,monospace;font-size:8px;letter-spacing:.03em}.catalog-sync.failed{color:var(--danger);cursor:pointer}.panel-intro span,.mini-heading{color:var(--accent-dark);font-family:SFMono-Regular,Consolas,monospace;font-size:9px;font-weight:700;letter-spacing:.1em}.panel-intro p{margin:5px 0 0;color:var(--ink-soft);font-size:12px}.form-section{padding:20px 0 8px;border-top:1px solid var(--line)}.section-heading{display:grid;grid-template-columns:27px 1fr;align-items:start;margin-bottom:17px}.section-heading>div{display:flex;flex-direction:column}.section-heading strong{font-size:13px;font-weight:680}.section-heading small{margin-top:1px;color:var(--ink-faint);font-size:10px;font-weight:450}.step-number{padding-top:2px;color:var(--accent);font-family:SFMono-Regular,Consolas,monospace;font-size:9px;font-weight:700}#runForm label,.advanced-options label{display:block;margin:0 0 12px;color:#4f504c;font-size:10px;font-weight:680;letter-spacing:.01em}#runForm input:not([type=checkbox]),#runForm select,#runForm textarea,#filter{display:block;width:100%;min-height:var(--control-height);margin-top:5px;border:1px solid var(--line-dark);border-radius:2px;outline:none;background:var(--paper-raised);color:var(--ink);font-size:12px;font-weight:500;transition:border-color .12s ease,background .12s ease}#runForm input:not([type=checkbox]),#runForm select,#filter{padding:9px 10px}#runForm textarea{min-height:88px;padding:9px 10px;resize:vertical;font-family:SFMono-Regular,Consolas,monospace;font-size:10px}#runForm input:hover,#runForm select:hover,#runForm textarea:hover,#filter:hover{border-color:#a6a79f}#runForm input:focus,#runForm select:focus,#runForm textarea:focus,#filter:focus{border-color:var(--ink);background:#fff}#runForm input::placeholder,#runForm textarea::placeholder,#filter::placeholder{color:#aaa9a2}#runForm input:disabled,#runForm select:disabled,#filter:disabled{cursor:not-allowed;opacity:.55}select{appearance:none;padding-right:32px!important;background-image:linear-gradient(45deg,transparent 50%,#60615c 50%),linear-gradient(135deg,#60615c 50%,transparent 50%)!important;background-position:calc(100% - 14px) 17px,calc(100% - 10px) 17px!important;background-repeat:no-repeat!important;background-size:4px 4px,4px 4px!important;cursor:pointer}input[type=checkbox]{width:14px;height:14px;margin:0;accent-color:var(--accent)}.optional{float:right;color:var(--ink-faint);font-weight:450}.folder-field{position:relative;margin-bottom:13px}.folder-label{margin-bottom:5px;color:#4f504c;font-size:10px;font-weight:680;letter-spacing:.01em}.folder-drop{display:flex;width:100%;min-height:86px;align-items:center;gap:12px;padding:14px;border:1px dashed #b7b7ae;border-radius:3px;background:#f8f8f4;text-align:left;cursor:pointer;transition:border-color .12s ease,background .12s ease,box-shadow .12s ease}.folder-drop:hover,.folder-drop.dragging{border-color:var(--accent);background:#fff7f2;box-shadow:inset 3px 0 0 var(--accent)}.folder-drop.has-folder{border-style:solid;border-color:#b6c8bb;background:#f4f8f4}.folder-drop:disabled{cursor:wait;opacity:.7}.folder-icon{display:grid;width:34px;height:34px;flex:0 0 34px;place-items:center;border:1px solid var(--line-dark);border-radius:2px;background:var(--paper-raised);color:var(--accent)}.folder-drop.has-folder .folder-icon{border-color:#9eb6a5;color:var(--success)}.folder-copy{display:flex;min-width:0;flex-direction:column}.folder-copy strong{overflow:hidden;color:var(--ink);font-size:12px;font-weight:680;text-overflow:ellipsis;white-space:nowrap}.folder-copy small{margin-top:2px;color:var(--ink-faint);font-size:10px;font-weight:450}.folder-input{display:none!important}.folder-remove{display:block;margin:3px 0 0 auto;padding:1px 0;border:0;background:transparent;color:var(--ink-faint);font-size:9px;cursor:pointer}.folder-remove:hover{color:var(--danger)}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 10px}.nested-options{margin:3px 0 12px;padding:13px 13px 1px;background:#ecece7;border-left:2px solid var(--accent)}.remote-vm-options{padding-bottom:12px}.provider-panel{margin:2px 0 0;padding:12px;border:1px solid #d2d2cb;background:var(--paper-raised)}.provider-heading{display:grid;grid-template-columns:30px minmax(0,1fr) auto;align-items:center;gap:9px;margin-bottom:14px}.provider-heading strong,.provider-heading small{display:block}.provider-heading strong{color:var(--ink);font-size:11px}.provider-heading small{margin-top:2px;color:var(--ink-soft);font-size:9px}.provider-mark{display:grid;width:30px;height:30px;place-items:center;border-radius:4px;background:#111;color:#7cf7c5;font-size:14px;font-weight:800}.provider-mark.ssh{background:#e7e7e1;color:var(--ink)}.provider-status{color:#287a5b;font-family:SFMono-Regular,Consolas,monospace;font-size:8px;font-weight:700;letter-spacing:.08em}.provider-status.soon{color:var(--ink-faint)}.modal-gpu-recommendation{display:grid;gap:6px;margin:-3px 0 10px;padding:11px 12px;border:1px solid #a9c4b4;border-left:2px solid var(--success);background:#f2f7f3}.modal-gpu-recommendation>div{display:flex;align-items:baseline;justify-content:space-between;gap:10px}.modal-gpu-recommendation span{color:#47715d;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;font-weight:700;letter-spacing:.11em}.modal-gpu-recommendation strong{color:#254d3a;font-size:11px;white-space:nowrap}.modal-gpu-recommendation p{margin:0;color:#5f6862;font-size:9px;line-height:1.45}.modal-gpu-recommendation small{display:flex;align-items:center;gap:5px;color:var(--success);font-size:8px;font-weight:650}.modal-gpu-recommendation button{width:max-content;border:0;padding:0;background:transparent;color:var(--accent-dark);font-size:8px;font-weight:700;text-decoration:underline;text-underline-offset:3px;cursor:pointer}.modal-gpu-recommendation.overridden{border-color:#d5b59d;border-left-color:var(--accent);background:#faf4ef}.modal-gpu-recommendation.empty{border-color:var(--line);border-left-color:var(--line-dark);background:#f2f2ed}.modal-gpu-recommendation.empty strong{color:var(--ink);font-size:10px}.modal-estimate{display:grid;margin:2px 0 14px;padding:13px;gap:7px;border:1px solid #323633;background:#171918;color:#eceee9}.modal-estimate-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:12px}.modal-estimate-heading>div{display:grid;gap:3px}.modal-estimate-heading span{color:#6f7772;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;letter-spacing:.13em}.modal-estimate-heading strong{font-family:SFMono-Regular,Consolas,monospace;font-size:20px;font-weight:500;letter-spacing:-.04em}.modal-estimate-heading em{color:#9ea5a0;font-family:SFMono-Regular,Consolas,monospace;font-size:8px;font-style:normal;white-space:nowrap}.modal-estimate-bar{height:2px;overflow:hidden;background:#303431}.modal-estimate-bar span{display:block;height:100%;background:#68d8ab}.modal-estimate p,.modal-estimate small{margin:0}.modal-estimate p{color:#c2c6c2;font-size:9px}.modal-estimate small{color:#777e79;font-size:8px;line-height:1.45}.modal-estimate a{width:max-content;color:#8e9791;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;text-decoration:none}.modal-estimate a:hover{color:#68d8ab}.modal-estimate.empty{background:#f2f2ed;color:var(--ink);border-color:var(--line)}.modal-estimate.empty strong{font-size:10px}.modal-estimate.empty p{color:var(--ink-soft);line-height:1.45}.modal-command-help{margin-top:0}.credential-success{display:flex;align-items:center;gap:5px;margin:-4px 0 12px;color:#287a5b;font-size:9px;font-weight:650}.modal-deploy-action{display:inline-flex;min-height:36px;align-items:center;justify-content:center;gap:7px;margin-bottom:8px;border:1px solid #1f2924;background:#17241e;color:#dcebe3;font-size:9px;font-weight:650;cursor:pointer}.modal-deploy-action:hover:not(:disabled){border-color:#287a5b;background:#1b2c24}.modal-deploy-action:disabled{cursor:not-allowed;opacity:.45}.modal-deployment{display:grid;margin:0 0 8px;gap:7px;padding:9px;border:1px solid var(--line);background:#eeeee9}.modal-deployment>div,.modal-deployment>div>span{display:flex;align-items:center;gap:6px}.modal-deployment>div{justify-content:space-between}.modal-deployment-actions{flex:0 0 auto}.modal-deployment-actions button{display:grid;width:24px;height:24px;padding:0;place-items:center;border:0;background:transparent;color:var(--ink-soft);cursor:pointer}.modal-deployment-actions button:hover{background:#deded7;color:var(--ink)}.modal-deployment-actions .modal-stop-action{display:inline-flex;width:auto;padding:0 7px;align-items:center;gap:4px;color:var(--danger);font-size:7px;font-weight:700}.modal-deployment-steps{display:grid;margin:2px 0 1px;padding:0;gap:3px;list-style:none}.modal-deployment-steps li{display:grid;min-height:34px;padding:5px 7px;grid-template-columns:19px minmax(0,1fr);align-items:center;gap:7px;border:1px solid transparent;color:var(--ink-faint)}.modal-deployment-steps li>div{display:grid;gap:1px}.modal-deployment-steps li strong{color:inherit;font-size:8px;font-weight:680}.modal-deployment-steps li small{color:inherit;font-size:7px;line-height:1.35}.modal-step-mark{display:grid;width:18px;height:18px;place-items:center;border:1px solid var(--line-dark);border-radius:50%;font-family:SFMono-Regular,Consolas,monospace;font-size:7px}.modal-deployment-steps li[data-state=active]{border-color:#d8bd85;background:#f8f2e7;color:#725a28}.modal-deployment-steps li[data-state=active] .modal-step-mark{border-color:#b68b32;color:#8d681e}.modal-deployment-steps li[data-state=complete]{color:var(--success)}.modal-deployment-steps li[data-state=complete] .modal-step-mark{border-color:#8aaf98}.modal-deployment-steps li[data-state=failed]{border-color:#d4a3a3;background:#faf0ef;color:var(--danger)}.modal-deployment-steps li[data-state=failed] .modal-step-mark{border-color:var(--danger)}.modal-deployment-steps li[data-state=cancelled]{border-color:#b9b9b1;background:#e7e7e1;color:var(--ink-soft)}.modal-deployment strong,.modal-deployment small{font-size:8px}.modal-deployment.completed{border-color:#9ac5af}.modal-deployment.failed{border-color:#d4a3a3;color:var(--danger)}.modal-deployment.cancelling,.modal-deployment.cancelled{border-color:#b9b9b1;color:var(--ink-soft)}.modal-deployment pre{overflow:auto;max-height:74px;margin:0;padding:7px;background:#171918;color:#aeb5b0;font:7px/1.5 SFMono-Regular,Consolas,monospace;white-space:pre-wrap}.modal-deployment .modal-log-preview-heading{display:flex;margin-top:1px;padding:0 1px;align-items:center;justify-content:space-between}.modal-log-preview-heading>span{color:var(--ink-faint);font-family:SFMono-Regular,Consolas,monospace;font-size:6px;font-weight:700;letter-spacing:.11em}.modal-log-preview-heading button{display:inline-flex;min-height:22px;padding:0 5px;align-items:center;gap:4px;border:0;background:transparent;color:var(--ink-soft);font-size:7px;font-weight:650;cursor:pointer}.modal-log-preview-heading button:hover{background:#deded7;color:var(--ink)}.modal-log-backdrop{position:fixed;z-index:80;inset:0;display:grid;padding:32px;place-items:center;background:#090a0aad;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.modal-log-dialog{display:flex;width:min(820px,calc(100vw - 64px));height:min(590px,calc(100vh - 64px));flex-direction:column;overflow:hidden;border:1px solid #4b504d;border-radius:3px;background:#111311;box-shadow:0 28px 80px #00000080;color:#e6e9e5}.modal-log-dialog header{display:flex;min-height:54px;padding:0 12px 0 16px;align-items:center;gap:12px;border-bottom:1px solid #343835}.modal-log-dialog header>div{display:grid;flex:1;gap:2px}.modal-log-dialog header span,.modal-log-dialog header small{color:#7c847e;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;letter-spacing:.1em;text-transform:uppercase}.modal-log-dialog header strong{font-size:11px;font-weight:600}.modal-log-dialog header button{display:inline-flex;min-height:29px;padding:0 8px;align-items:center;justify-content:center;gap:5px;border:0;background:transparent;color:#9fa5a1;font-size:8px;cursor:pointer}.modal-log-dialog header button:hover{background:#262a27;color:#f0f2ef}.modal-log-dialog header .modal-dialog-stop{color:#e28378}.modal-log-dialog pre{flex:1;overflow:auto;margin:0;padding:18px;color:#bbc2bc;font:10px/1.65 SFMono-Regular,Consolas,monospace;-webkit-user-select:text;user-select:text;white-space:pre-wrap}@media(max-width:640px){.modal-log-backdrop{padding:12px}.modal-log-dialog{width:calc(100vw - 24px);height:calc(100vh - 24px)}.modal-log-dialog header small{display:none}}.remote-message:empty{display:none}.modal-workspace-status{display:grid;min-height:50px;margin:0 0 10px;padding:9px 10px;grid-template-columns:24px minmax(0,1fr);align-items:center;gap:8px;border:1px solid var(--line-dark);background:#eeeeea}.modal-workspace-status>span{display:grid;width:23px;height:23px;place-items:center;border:1px solid currentColor;border-radius:50%;color:var(--ink-soft)}.modal-workspace-status>div{display:grid;gap:2px}.modal-workspace-status strong{color:var(--ink);font-size:9px;font-weight:700}.modal-workspace-status small{color:var(--ink-soft);font-size:8px;line-height:1.45}.modal-workspace-status.working{border-color:#d8bd85;background:#f8f2e7}.modal-workspace-status.working>span{color:#8d681e}.modal-workspace-status.found{border-color:#aebbc2;background:#eef2f3}.modal-workspace-status.found>span{color:#536d79}.modal-workspace-status.ready{border-color:#9ac5af;background:#edf5f0}.modal-workspace-status.ready>span{color:var(--success)}.modal-workspace-status.attention{border-color:#d4a3a3;background:#faf0ef}.modal-workspace-status.attention>span,.modal-workspace-status.attention strong{color:var(--danger)}.field-help{margin:-5px 0 12px;color:var(--ink-soft);font-size:10px;line-height:1.5}.field-help code{font-family:SFMono-Regular,Consolas,monospace}.mini-heading{margin:1px 0 10px;color:var(--ink-soft)}.loader-options{margin:-3px 0 12px;padding:12px 12px 1px;background:#ecece7;border:1px solid var(--line)}.check-label{display:flex!important;align-items:center;gap:8px;min-height:26px;cursor:pointer}.segmented{display:grid;grid-template-columns:1fr 1fr;margin-bottom:13px;border:1px solid var(--line-dark);background:var(--paper-raised)}.input-source{margin-top:2px}.sample-picker{margin-bottom:13px}.sample-card{display:grid;grid-template-columns:32px minmax(0,1fr);gap:10px;margin:-4px 0 10px;padding:11px;border:1px solid var(--line);background:#ecece7}.sample-card.ready{border-color:#b6c8bb;background:#f4f8f4}.sample-state{display:grid;width:30px;height:30px;place-items:center;border:1px solid var(--line-dark);color:var(--accent)}.sample-card.ready .sample-state{border-color:#9eb6a5;color:var(--success)}.sample-card>div{display:flex;min-width:0;flex-direction:column}.sample-card strong{font-size:11px}.sample-card small{margin-top:1px;color:var(--ink-soft);font-size:9px;line-height:1.45}.sample-card div>span{margin-top:5px;color:var(--ink-faint);font-family:SFMono-Regular,Consolas,monospace;font-size:8px}.sample-card a{color:var(--ink-soft);text-underline-offset:2px}.sample-help{margin-top:0}.target-choice{display:flex;min-height:36px;align-items:center;justify-content:center;gap:6px;border:0;background:transparent;color:var(--ink-soft);font-size:10px;font-weight:680;cursor:pointer}.target-choice+.target-choice{border-left:1px solid var(--line-dark)}.target-choice.active{background:var(--ink);color:#fff}.hardware-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 10px;margin:-4px 0 11px;padding:10px;border:1px solid var(--line);background:#ecece7}.hardware-card strong{overflow:hidden;font-size:11px;text-overflow:ellipsis;white-space:nowrap}.hardware-card small{grid-row:2;overflow:hidden;color:var(--ink-soft);font-size:9px;text-overflow:ellipsis;white-space:nowrap}.capability{grid-column:2;grid-row:1 / span 2;align-self:center;padding:3px 6px;border:1px solid var(--line-dark);color:var(--ink-soft);font-family:SFMono-Regular,Consolas,monospace;font-size:8px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.capability.yes{border-color:#8aaf98;color:var(--success)}.advanced-options{margin:13px 0 16px;padding-top:14px;border-top:1px solid var(--line)}.advanced-trigger{display:flex;width:100%;align-items:center;justify-content:space-between;border:0;padding:0 0 13px;background:transparent;color:var(--ink-soft);font-size:10px;font-weight:680;cursor:pointer}.advanced-trigger>span,.secondary-action{display:flex;align-items:center;justify-content:center;gap:6px}.advanced-trigger-copy{display:grid;gap:1px;text-align:left}.advanced-trigger-copy small{color:var(--ink-faint);font-family:SFMono-Regular,Consolas,monospace;font-size:7px;font-weight:500}.advanced-trigger[data-state=open]>svg{transform:rotate(180deg)}.advanced-content{overflow:hidden}.machine-profile-summary{display:grid;gap:7px;margin:0 0 14px;padding:11px 12px;border:1px solid var(--line);border-left:2px solid var(--accent);background:#eeeeea}.machine-profile-summary>div:first-child{display:flex;align-items:baseline;justify-content:space-between;gap:10px}.machine-profile-summary>div:first-child span{color:var(--ink-faint);font-family:SFMono-Regular,Consolas,monospace;font-size:7px;letter-spacing:.1em}.machine-profile-summary strong{overflow:hidden;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.machine-profile-summary p,.advanced-machine-note{margin:0;color:var(--ink-soft);font-size:9px;line-height:1.45}.machine-profile-specs{display:flex;flex-wrap:wrap;gap:5px}.machine-profile-specs span{padding:3px 6px;border:1px solid var(--line-dark);background:var(--paper-raised);color:#555752;font-family:SFMono-Regular,Consolas,monospace;font-size:7px}.advanced-machine-note{margin:-5px 0 13px}.toggle-row{display:flex;min-height:31px;align-items:center;gap:9px;margin:0 0 10px}.toggle-row.disabled{opacity:.48}.toggle-row label{margin:0!important;cursor:pointer}.switch-root{position:relative;width:28px;height:16px;flex:0 0 28px;border:0;border-radius:999px;padding:0;background:#b9b9b2;cursor:pointer}.switch-root[data-state=checked]{background:var(--accent)}.switch-thumb{display:block;width:12px;height:12px;border-radius:50%;background:#fff;transform:translate(2px);transition:transform .12s ease}.switch-thumb[data-state=checked]{transform:translate(14px)}.primary-action{display:flex;width:100%;min-height:43px;align-items:center;justify-content:space-between;border:1px solid var(--ink);border-radius:0;padding:0 14px;background:var(--ink);color:#fff;font-size:11px;font-weight:680;cursor:pointer;transition:background .12s ease,border-color .12s ease}.primary-action:hover{border-color:var(--accent-dark);background:var(--accent-dark)}.spin{animation:spin .9s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.panel-loading{display:flex;align-items:center;gap:8px;padding:36px 0;color:var(--ink-soft);font-size:11px}.panel-loading.failed{align-items:flex-start;color:var(--danger)}.panel-loading.failed>div{display:grid;flex:1;gap:3px}.panel-loading.failed strong,.panel-loading.failed small{display:block}.panel-loading.failed small{color:var(--ink-soft);line-height:1.4}.hardware-card.detecting{display:flex;min-height:54px;align-items:center;gap:10px}.hardware-card.detecting>div{display:grid;gap:3px}.primary-action:disabled{cursor:wait;opacity:.55}.form-error{min-height:18px;margin:4px 0 8px;color:var(--danger);font-size:10px}.secondary-action,.icon-button{border:1px solid var(--line-dark);border-radius:2px;background:var(--paper-raised);color:var(--ink);font-size:10px;font-weight:650;cursor:pointer}.secondary-action{padding:7px 10px}.secondary-action:hover,.icon-button:hover{border-color:var(--ink)}.secondary-action.full-width{width:100%;margin:2px 0 10px}.panel-title{display:flex;align-items:center;justify-content:space-between;margin:22px 0 17px}.panel-title h3{margin:0;font-size:18px;font-weight:680;letter-spacing:-.035em}.panel-title p{margin:2px 0 0;color:var(--ink-soft);font-size:10px}.icon-button{width:31px;height:31px}.job-list{display:flex;flex-direction:column;gap:8px}.job-card{padding:12px;border:1px solid var(--line);background:var(--paper-raised)}.job-card.selected{border-left:2px solid var(--accent)}.job-card-top{display:flex;justify-content:space-between;gap:8px}.job-card strong{font-size:12px}.job-card>small{color:var(--ink-soft);font-size:9px}.job-status{color:var(--ink-soft);font-family:SFMono-Regular,Consolas,monospace;font-size:8px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.job-status.running,.job-status.queued{color:#a85523}.job-status.completed{color:var(--success)}.job-status.failed,.job-status.cancelled,.job-error{color:var(--danger)}.job-actions{display:flex;gap:12px;margin-top:9px}.job-card>.splat-download{margin-top:10px}.text-button{display:inline-flex;align-items:center;gap:4px;border:0;padding:0;background:none;color:var(--ink);font-size:9px;font-weight:700;text-decoration:underline;text-decoration-color:var(--line-dark);text-underline-offset:3px;cursor:pointer}.text-button.danger{color:var(--danger)}.job-error{margin:6px 0;font-size:9px}.empty-state{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:5px;padding:42px 16px;border:1px dashed var(--line-dark);color:var(--ink-faint);font-size:11px;text-align:center}.empty-state strong{color:var(--ink);font-size:11px}.empty-state span{font-size:10px}#resultsPanel #info{margin-bottom:12px}#resultsPanel #filter{margin:0 0 12px}#resultsPanel #sceneList{min-height:200px}#info{display:flex;align-items:center;gap:12px;padding:11px;border:1px solid var(--line);background:var(--paper-raised)}#info .info-pill{display:grid;width:39px;height:39px;flex:0 0 39px;place-items:center;background:var(--ink);color:#fff;font-family:SFMono-Regular,Consolas,monospace;font-size:12px;font-weight:700}#info .info-details{min-width:0}#info .info-title{font-size:11px;font-weight:680}#info .info-path{overflow:hidden;margin-top:2px;color:var(--ink-soft);font-family:SFMono-Regular,Consolas,monospace;font-size:8px;text-overflow:ellipsis;white-space:nowrap}#info.info-error{border-color:#d5a29d}#info.info-error .info-pill{background:var(--danger)}#sceneList{margin:0 -6px;overflow-y:auto}#sceneList.is-disabled{pointer-events:none;opacity:.45}#sceneList ul{margin:3px 0;padding-left:15px;list-style:none}.directory-node{display:flex;width:100%;min-height:30px;align-items:center;gap:7px;border:0;padding:6px;background:transparent;color:var(--ink);font-size:11px;font-weight:680;text-align:left;cursor:pointer}.directory-node:hover{background:#eeeee9}.directory-node:focus-visible{outline:1px solid var(--accent);outline-offset:-1px}.directory-chevron{width:6px;height:6px;flex:0 0 6px;border-right:1px solid var(--ink-faint);border-bottom:1px solid var(--ink-faint);transform:rotate(45deg) translate(-1px,-1px);transition:transform .12s ease}.directory-branch.is-collapsed>.directory-node .directory-chevron{transform:rotate(-45deg)}.directory-branch.is-collapsed>ul{display:none}.item{margin-bottom:1px;padding:7px 8px;border-left:2px solid transparent;cursor:pointer}.item:hover{background:#e9e9e4}.item.active{border-left-color:var(--accent);background:#e6e5df}.item div{overflow:hidden;color:var(--ink);font-size:11px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.item small{display:block;overflow:hidden;color:var(--ink-soft);font-size:9px;text-overflow:ellipsis;white-space:nowrap}.item .result-splat-download{display:flex;margin-top:7px}.result-splat-download .splat-format-label{display:grid;width:61px;min-height:27px;place-items:center;border:1px solid var(--line-dark);border-right:0;border-radius:2px 0 0 2px;padding:4px 7px;background-color:var(--paper-raised);color:var(--ink);font:8px SFMono-Regular,Consolas,monospace}.result-splat-download a{display:grid;min-width:65px;place-items:center;border:1px solid var(--line-dark);border-radius:0 2px 2px 0;padding:0 7px;color:var(--ink);font-size:8px;font-weight:650;text-decoration:none}.result-splat-download a:hover{border-color:var(--ink)}#main-content{position:relative;min-width:0;flex:1;overflow:hidden;background:var(--viewport)}#renderCanvas{display:block;width:100%;height:100%;outline:none}.setup-panel,.setup-reopen{position:absolute;z-index:9;top:18px;right:18px}.setup-panel.with-active-job,.setup-reopen.with-active-job{top:91px}.setup-panel{width:318px;overflow:hidden;border:1px solid #404346;border-radius:2px;background:#131517f5;box-shadow:0 12px 32px #0000003d;color:#e8e8e3;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}.setup-panel.collapsed{width:238px}.setup-panel-header{display:grid;min-height:52px;grid-template-columns:20px 1fr auto;align-items:center;gap:9px;padding:9px 8px 9px 12px}.setup-overall-icon{display:grid;width:20px;height:20px;place-items:center;color:#d69a52}.setup-overall-icon.ready{color:#6fa484}.setup-overall-icon.error{color:#d16b61}.setup-panel-copy{display:flex;min-width:0;flex-direction:column}.setup-panel-copy>span{color:#767b7d;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;font-weight:700;letter-spacing:.13em}.setup-panel-copy strong{overflow:hidden;margin-top:1px;font-size:11px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.setup-panel-actions{display:flex;align-items:center}.setup-panel-actions button,.setup-reopen{display:grid;width:27px;height:27px;place-items:center;border:0;padding:0;background:transparent;color:#8d9192;cursor:pointer}.setup-panel-actions button:hover,.setup-reopen:hover{background:#2b2e30;color:#f0f0eb}.setup-panel-actions button:disabled{cursor:wait;opacity:.5}.setup-panel-body{max-height:min(560px,calc(100vh - 92px));overflow-y:auto;border-top:1px solid #34373a;scrollbar-color:#44484a transparent;scrollbar-width:thin}.setup-summary-line{display:flex;justify-content:space-between;gap:10px;padding:8px 12px;border-bottom:1px solid #2f3234;color:#777c7d;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;letter-spacing:.04em;text-transform:uppercase}.setup-panel ul{margin:0;padding:4px 0;list-style:none}.setup-panel li{display:grid;grid-template-columns:18px 1fr;gap:7px;padding:7px 12px}.setup-check-content{min-width:0}.setup-check-mark{display:grid;width:16px;height:16px;margin-top:1px;place-items:center;border:1px solid #44484a;border-radius:50%;color:#6fa484}.setup-panel li[data-state=error] .setup-check-mark{border-color:#804f4a;color:#d16b61}.setup-panel li[data-state=optional] .setup-check-mark,.setup-panel li[data-state=warning] .setup-check-mark{border-color:#484c4e;color:transparent}.setup-panel li[data-state=optional] .setup-check-mark>span,.setup-panel li[data-state=warning] .setup-check-mark>span{width:4px;height:4px;border-radius:50%;background:#686d6f}.setup-check-title{display:flex;align-items:center;justify-content:space-between;gap:8px}.setup-check-tools{display:flex;flex:0 0 auto;align-items:center;gap:6px}.setup-check-title strong{color:#dadbd6;font-size:10px;font-weight:620}.setup-check-title em{color:#686d6f;font-family:SFMono-Regular,Consolas,monospace;font-size:6px;font-style:normal;letter-spacing:.08em;text-transform:uppercase}.setup-check-title .setup-install{display:flex;min-height:21px;align-items:center;justify-content:center;gap:4px;border:1px solid #505456;border-radius:2px;padding:2px 6px;background:#25282a;color:#d7d8d3;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;font-weight:650;cursor:pointer;white-space:nowrap}.setup-check-title .setup-install:hover:not(:disabled){border-color:#777b7d;background:#303335;color:#fff}.setup-check-title .setup-install:disabled{cursor:not-allowed;opacity:.45}.setup-panel li small{display:block;margin-top:1px;color:#777c7d;font-size:8px;line-height:1.35}.setup-panel li[data-state=error] small{color:#b87a74}.setup-panel li small.setup-action-error{color:#d9877f}.setup-loading{display:flex;align-items:center;gap:8px;padding:15px 12px;color:#8c9092;font-size:9px}.setup-reopen{width:34px;height:34px;border:1px solid #404346;border-radius:2px;background:#131517f0;box-shadow:0 8px 22px #0003}.run-status-bar{position:absolute;z-index:8;right:18px;bottom:68px;left:auto;width:min(720px,calc(100% - 36px));display:grid;min-height:61px;grid-template-columns:1.2fr 1fr auto;grid-template-rows:auto 2px;align-items:center;gap:8px 16px;padding:11px 12px 9px;border:1px solid #373a3c;background:#131517f0;color:#ecece7;cursor:grab}.status-copy{display:flex;align-items:center;gap:10px}.status-drag-handle{min-width:0;cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none}.status-metrics,.run-progress-track{touch-action:none;-webkit-user-select:none;user-select:none}.run-status-bar.is-dragging .status-drag-handle,.run-status-bar.is-dragging{cursor:grabbing}.status-copy>div{display:flex;flex-direction:column}.status-copy strong{font-size:11px}.status-copy small{color:#8c9092;font-size:9px}.status-dot{width:7px;height:7px;background:var(--accent);animation:statusPulse 1.5s ease-in-out infinite}.run-status-bar[data-status=completed] .status-dot{background:#6da17f;animation:none}.run-status-bar[data-status=failed] .status-dot,.run-status-bar[data-status=cancelled] .status-dot{background:#cb6258;animation:none}@keyframes statusPulse{50%{opacity:.35}}.status-metrics{display:flex;justify-content:flex-end;gap:13px;color:#a3a6a5;font-family:SFMono-Regular,Consolas,monospace;font-size:8px;font-variant-numeric:tabular-nums}.run-progress-track{grid-column:1 / 4;height:2px;overflow:hidden;background:#343739}.run-progress-fill{width:100%;height:100%;background:var(--accent);transition:transform .4s ease}.run-status-bar .secondary-action{border-color:#484c4e;background:transparent;color:#d1d2cd}.run-status-bar .secondary-action.stop-process{border-color:#744843;color:#e79289}.run-status-bar .secondary-action.stop-process:hover{border-color:#a95a52;background:#b94b4021;color:#ffb0a8}.status-actions{display:flex;align-items:center;gap:4px}.splat-download{display:flex;align-items:stretch;min-height:31px}.splat-download .splat-format-label{display:grid;width:62px;min-height:31px;place-items:center;border:1px solid #484c4e;border-right:0;border-radius:2px 0 0 2px;padding:5px 7px;background-color:transparent;color:#d1d2cd;font-family:SFMono-Regular,Consolas,monospace;font-size:8px}.splat-download a{display:flex;min-width:76px;align-items:center;justify-content:center;gap:5px;border:1px solid #484c4e;border-radius:0 2px 2px 0;padding:0 8px;color:#d1d2cd;font-size:9px;font-weight:650;text-decoration:none}.splat-download a:hover{border-color:#707476;color:#fff}.splat-download.compact{width:fit-content;min-height:27px}.splat-download.compact .splat-format-label{min-height:27px;border-color:var(--line-dark);background-color:var(--paper-raised);color:var(--ink)}.splat-download.compact a{min-width:31px;border-color:var(--line-dark);color:var(--ink)}.status-close{display:grid;width:31px;height:31px;place-items:center;border:1px solid #484c4e;border-radius:2px;padding:0;background:transparent;color:#8e9293;cursor:pointer}.status-close:hover{border-color:#707476;color:#f0f0eb}.status-close:focus-visible{outline:1px solid var(--accent);outline-offset:2px}#hud{position:absolute;z-index:5;right:58px;bottom:18px;display:flex;align-items:center;gap:1px;padding:4px;border:1px solid #383b3e;background:#131517eb;color:#b9bcba;font-size:9px}.viewport-github{position:absolute;z-index:6;right:18px;bottom:18px;display:grid;width:31px;height:31px;place-items:center;border:1px solid #414547;border-radius:2px;background:#131517eb;color:#d3d4d0;text-decoration:none;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.viewport-github:hover{border-color:#767a7c;color:#fff}.viewport-github:focus-visible{outline:1px solid var(--accent);outline-offset:2px}#hud button{display:flex;height:30px;align-items:center;justify-content:center;gap:5px;min-width:0;border:0;padding:0 10px;background:transparent;color:#d3d4d0;font-size:9px;font-weight:620;cursor:pointer;white-space:nowrap}#hud button:hover,#hud button.is-active{background:#303335;color:#fff}#hud label{display:flex;align-items:center;gap:6px;min-height:30px;padding:0 8px;border-left:1px solid #343739;white-space:nowrap}#hud .background-control{gap:7px;border-left:0}#hud .background-control select{width:82px;min-height:24px;border:1px solid #3f4345;border-radius:1px;padding:3px 22px 3px 7px!important;outline:none;background-color:#232628;background-position:calc(100% - 11px) 10px,calc(100% - 7px) 10px!important;color:#e2e3de;font-size:9px}#hud .background-control select:hover,#hud .background-control select:focus{border-color:#676b6d}#hud input[type=range]{width:90px;accent-color:var(--accent)}#hud .plane-height-control{min-width:190px}#hud .plane-height-control input[type=range]{width:112px}#groundYValue{min-width:25px;color:#e4e5df;font-family:SFMono-Regular,Consolas,monospace;font-size:8px;text-align:right}#hud input[type=checkbox]{accent-color:var(--accent)}#hud.hud-splat-mode .hud-scene-only,.hud-hidden{display:none!important}#sceneStats{position:absolute;z-index:6;top:18px;left:18px;display:grid;min-width:178px;gap:8px;padding:12px;border:1px solid #383b3e;background:#131517eb;color:#e5e5df}#sceneStats .stat-group[data-mode=scene]{display:grid;grid-template-columns:1fr 1fr;gap:9px 15px}#sceneStats .stat-group[data-mode=splat]{display:none}#sceneStats .stat-wide{grid-column:1 / 3}#sceneStats .stat-pair,#sceneStats .stat-wide{display:flex;flex-direction:column}#sceneStats .label{color:#747879;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;letter-spacing:.12em;text-transform:uppercase}#sceneStats .value{overflow:hidden;color:#e6e6e1;font-family:SFMono-Regular,Consolas,monospace;font-size:12px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}#sceneStats .stat-wide .value{max-width:240px}#sceneStats.dask-active{width:226px}.dask-stats{display:grid;padding-top:11px;gap:11px;border-top:1px solid #34383a;animation:dask-stats-expand .18s ease-out;transform-origin:top}@keyframes dask-stats-expand{0%{opacity:0;transform:scaleY(.75) translateY(-5px)}to{opacity:1;transform:scaleY(1) translateY(0)}}.dask-stats-heading,.dask-memory>div:first-child{display:flex;align-items:flex-end;justify-content:space-between;gap:10px}.dask-stats-heading>div{display:grid;gap:3px}.dask-stats-heading span,.dask-memory span,.dask-stat-grid span{color:#747879;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;letter-spacing:.12em;text-transform:uppercase}.dask-stats-heading strong{font-size:11px;font-weight:600}.dask-stats-heading a{color:#9ba09f;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;text-decoration:none}.dask-stats-heading a:hover{color:var(--accent)}.dask-stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px 14px}.dask-stat-grid>div{display:grid;gap:1px}.dask-stat-grid strong{color:#eeeee9;font-family:SFMono-Regular,Consolas,monospace;font-size:15px;font-weight:500}.dask-stat-grid small{color:#656a6b;font-family:SFMono-Regular,Consolas,monospace;font-size:7px}.dask-memory{display:grid;gap:5px}.dask-memory strong{color:#9da2a1;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;font-weight:500}.dask-memory-track{height:2px;overflow:hidden;background:#2e3234}.dask-memory-track span{display:block;height:100%;background:var(--accent);transition:width .3s ease}.dask-stats-waiting{display:flex;align-items:center;gap:7px;color:#858a89;font-family:SFMono-Regular,Consolas,monospace;font-size:8px}.dask-pulse{width:5px;height:5px;border-radius:50%;background:var(--accent);animation:dask-pulse 1.2s ease-in-out infinite}@keyframes dask-pulse{50%{opacity:.25}}.pipeline-wait-overlay{position:absolute;z-index:4;inset:0;display:flex;align-items:center;justify-content:center;padding:96px 28px 76px;background:#0506076b;color:#ecece7;pointer-events:none;animation:pipeline-viewport-dim 2.6s ease-in-out infinite}.pipeline-wait-content{display:grid;width:min(560px,calc(100% - 48px));justify-items:center;gap:11px;text-align:center}.pipeline-wait-content>span{color:#858a89;font:650 8px/1.2 SFMono-Regular,Consolas,monospace;letter-spacing:.14em}.pipeline-wait-content strong{max-width:100%;color:#f0f0eb;font-size:clamp(15px,2vw,22px);font-weight:500;line-height:1.35;text-wrap:balance}.pipeline-wait-content small{color:#858a89;font-size:10px}.pipeline-wait-dots{display:flex;height:6px;align-items:center;gap:5px}.pipeline-wait-dots i{display:block;width:3px;height:3px;border-radius:50%;background:var(--accent);animation:pipeline-dot 1.35s ease-in-out infinite}.pipeline-wait-dots i:nth-child(2){animation-delay:.16s}.pipeline-wait-dots i:nth-child(3){animation-delay:.32s}@keyframes pipeline-viewport-dim{50%{background-color:#05060791}}@keyframes pipeline-dot{0%,70%,to{opacity:.22;transform:translateY(0)}35%{opacity:1;transform:translateY(-2px)}}.hardware-warning{position:fixed;z-index:30;top:50%;left:50%;display:grid;width:min(430px,calc(100vw - 48px));padding:16px 42px 16px 16px;grid-template-columns:24px 1fr;gap:11px;border:1px solid #665936;border-radius:3px;background:#181712f7;color:#ece9de;box-shadow:0 16px 42px #00000061;transform:translate(-50%,-50%);animation:hardware-warning-in .18s ease-out}@keyframes hardware-warning-in{0%{opacity:0;transform:translate(-50%,calc(-50% - 8px))}to{opacity:1;transform:translate(-50%,-50%)}}.hardware-warning-icon{display:grid;width:24px;height:24px;place-items:center;border:1px solid #6e6038;border-radius:50%;color:#e0b74c}.hardware-warning-copy{display:grid;gap:5px}.hardware-warning-copy>span{color:#a89052;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;letter-spacing:.14em}.hardware-warning-copy>strong{font-size:13px;font-weight:600}.hardware-warning-copy p{margin:1px 0 7px;color:#a7a69f;font-size:10px;line-height:1.5}.hardware-warning-actions{display:flex;flex-wrap:wrap;gap:7px}.hardware-warning-actions button{display:inline-flex;min-height:29px;padding:0 10px;align-items:center;justify-content:center;gap:6px;border:1px solid #4a4a44;background:transparent;color:#b7b7b0;font-family:SFMono-Regular,Consolas,monospace;font-size:8px;cursor:pointer}.hardware-warning-actions .warning-primary{border-color:#d1aa40;background:#d1aa40;color:#15140f;font-weight:700}.hardware-warning-actions button:hover{border-color:#e2bd55;color:#f2f0e8}.hardware-warning-actions .warning-primary:hover{background:#e2bd55;color:#15140f}.hardware-warning-close{position:absolute;top:9px;right:9px;display:grid;width:25px;height:25px;padding:0;place-items:center;border:0;background:transparent;color:#7d7d76;cursor:pointer}.hardware-warning-close:hover{color:#ece9de}@media(max-width:840px){.hardware-warning{width:calc(100vw - 24px)}}.log-drawer{position:absolute;z-index:12;right:18px;bottom:58px;display:flex;width:min(420px,calc(100% - 36px));height:min(240px,32%);flex-direction:column;overflow:hidden;border:1px solid #44484a;border-radius:2px;background:#0e1012fa;box-shadow:0 12px 34px #0000004d}.log-resize-handle{position:absolute;z-index:4;width:18px;height:18px;border:0;padding:0;background:transparent;touch-action:none}.log-resize-handle:before{position:absolute;width:8px;height:8px;border-color:#737879;border-style:solid;border-width:0;content:""}.log-resize-handle.nw{top:-1px;left:-1px;cursor:nwse-resize}.log-resize-handle.nw:before{top:4px;left:4px;border-top-width:1px;border-left-width:1px}.log-resize-handle.ne{top:-1px;right:-1px;cursor:nesw-resize}.log-resize-handle.ne:before{top:4px;right:4px;border-top-width:1px;border-right-width:1px}.log-resize-handle.sw{bottom:-1px;left:-1px;cursor:nesw-resize}.log-resize-handle.sw:before{bottom:4px;left:4px;border-bottom-width:1px;border-left-width:1px}.log-resize-handle.se{right:-1px;bottom:-1px;cursor:nwse-resize}.log-resize-handle.se:before{right:4px;bottom:4px;border-right-width:1px;border-bottom-width:1px}.log-resize-handle:hover:before{border-color:var(--accent)}.log-header{display:flex;align-items:center;justify-content:space-between;padding:8px 11px;border-bottom:1px solid #333739;color:#d7d8d3;font-size:9px;cursor:move;touch-action:none;-webkit-user-select:none;user-select:none}.log-header strong{display:flex;align-items:center;gap:6px}.log-header-actions{display:flex;align-items:center;gap:1px}.log-header button{display:grid;width:27px;height:25px;place-items:center;border:0;padding:0;background:none;color:#8b8f90;cursor:pointer}.log-header button.log-copy{width:auto;min-width:54px;grid-auto-flow:column;gap:5px;padding:0 7px;font-size:8px}.log-header button:hover{background:#292c2e;color:#f0f0eb}.log-header button:focus-visible{outline:1px solid var(--accent);outline-offset:-2px}#runLogs{flex:1;overflow:auto;margin:0;padding:11px;color:#adb1af;font-family:SFMono-Regular,Consolas,monospace;font-size:var(--log-font-size, 9px);line-height:1.6;cursor:text;-webkit-user-select:text;user-select:text;white-space:pre-wrap}.loading-overlay{position:absolute;z-index:20;inset:0;display:flex;align-items:center;justify-content:center;background:#060708b8;opacity:0;pointer-events:none;transition:opacity .18s ease}.loading-overlay.active{opacity:1;pointer-events:auto}.loading-box{display:grid;min-width:270px;gap:13px;padding:16px;border:1px solid #3b3f41;background:#151719;color:#dddeda}#loadingMessage{font-size:10px;font-weight:650}.loading-progress-track{width:100%;height:2px;overflow:hidden;background:#363a3c}.loading-progress-fill{width:0;height:100%;background:var(--accent);transition:width .12s ease}@media(max-width:900px){#sidebar{flex-basis:var(--sidebar-width, 380px)}.status-metrics{display:none}}@media(max-width:720px){body{display:block;overflow:auto;background:var(--paper)}.app-shell{display:block;height:auto}#sidebar{width:100%;min-width:0;height:auto;min-height:100vh;border-right:0}#sidebar.sidebar-collapsed{width:0;min-width:0;min-height:0;height:0;overflow:visible;background:transparent}.sidebar-resize-handle{display:none}.sidebar-collapsed .studio-header{top:10px;left:10px;min-height:0;justify-content:flex-start;padding:0}#main-content{height:72vh;min-height:520px}.run-status-bar{grid-template-columns:1fr auto}.run-progress-track{grid-column:1 / 3}.setup-panel,.setup-reopen{top:10px;right:10px}.setup-panel.with-active-job,.setup-reopen.with-active-job{top:90px}.setup-panel{width:min(318px,calc(100vw - 20px))}.setup-panel-body{max-height:390px}.log-drawer{right:10px;bottom:56px;width:min(420px,calc(100% - 20px));height:min(220px,34%)}#hud{right:50px;bottom:10px;left:10px;overflow-x:auto}.viewport-github{right:10px;bottom:10px}}@media(max-width:430px){.form-grid{grid-template-columns:1fr}.studio-header,.studio-tabs,.studio-panel{padding-right:17px;padding-left:17px}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}} +:root{--ink: #20211f;--ink-soft: #666761;--ink-faint: #96978f;--paper: #f4f4f0;--paper-raised: #fafaf7;--line: #d8d8d1;--line-dark: #c7c7bf;--viewport: #0e1012;--viewport-line: #2a2e31;--accent: #e45d37;--accent-dark: #c94825;--success: #3a8060;--danger: #b94b40;--control-height: 40px}*{box-sizing:border-box}html,body{height:100%}body{margin:0;overflow:hidden;background:var(--viewport);color:var(--ink);font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:13px;line-height:1.45;-webkit-font-smoothing:antialiased}#root,.app-shell{width:100%;height:100%}.app-shell{display:flex}button,input,select,textarea{font:inherit}button{color:inherit}.hidden{display:none!important}#sidebar{position:relative;z-index:10;display:flex;flex:0 0 var(--sidebar-width, 420px);min-width:320px;flex-direction:column;overflow:hidden;background:var(--paper);border-right:1px solid #292b2d;transition:flex-basis .18s ease,min-width .18s ease}#sidebar.sidebar-resizing{transition:none}.sidebar-resize-handle{position:absolute;z-index:20;top:0;right:0;bottom:0;width:9px;touch-action:none;cursor:col-resize;outline:0}.sidebar-resize-handle:after{position:absolute;top:0;right:0;bottom:0;width:2px;background:var(--accent);content:"";opacity:0;transition:opacity .12s ease}.sidebar-resize-handle:hover:after,.sidebar-resize-handle:focus-visible:after,.sidebar-resizing .sidebar-resize-handle:after{opacity:1}.sidebar-collapsed .sidebar-resize-handle{display:none}body.sidebar-is-resizing,body.sidebar-is-resizing *{cursor:col-resize!important;-webkit-user-select:none!important;user-select:none!important}#sidebar.sidebar-collapsed{flex-basis:0;min-width:0;overflow:visible;border-right:0;background:transparent}.studio-header{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:79px;padding:12px 22px;border-bottom:1px solid var(--line)}.brand-logo{display:block;width:194px;max-width:100%;height:auto}.brand-primary{display:flex;min-width:0;align-items:center;gap:9px}.brand-mark{display:none;width:31px;height:31px;object-fit:contain}.sidebar-toggle{display:grid;width:31px;height:31px;flex:0 0 31px;place-items:center;border:1px solid var(--line-dark);border-radius:2px;padding:0;background:var(--paper-raised);color:var(--ink-soft);cursor:pointer}.sidebar-toggle:hover{border-color:var(--ink);color:var(--ink)}.sidebar-toggle:focus-visible{outline:1px solid var(--accent);outline-offset:2px}.sidebar-collapsed .studio-header{position:absolute;top:18px;left:18px;width:auto;min-height:0;gap:5px;justify-content:flex-start;padding:0;border:0;background:transparent}.sidebar-collapsed .brand-primary,.sidebar-collapsed .workspace-tabs{display:none}.sidebar-collapsed .brand-mark{display:block}.sidebar-collapsed .sidebar-toggle{border-color:#45494b;background:#131517e0;color:#d8d9d5;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.sidebar-collapsed+#main-content #sceneStats{left:103px}.studio-tabs{display:flex;min-height:43px;padding:0 22px;gap:24px;border-bottom:1px solid var(--line)}.studio-tab{position:relative;border:0;padding:0;background:transparent;color:var(--ink-soft);font-size:11px;font-weight:650;cursor:pointer}.studio-tab:after{position:absolute;right:0;bottom:-1px;left:0;height:2px;background:var(--ink);content:"";opacity:0}.studio-tab:hover,.studio-tab[data-state=active]{color:var(--ink)}.studio-tab:focus-visible,.target-choice:focus-visible,.primary-action:focus-visible,.secondary-action:focus-visible,.icon-button:focus-visible,.text-button:focus-visible,#hud button:focus-visible,.setup-panel button:focus-visible,.setup-reopen:focus-visible{outline:1px solid var(--accent);outline-offset:2px}.studio-tab[data-state=active]:after{opacity:1}#activeJobCount:not(:empty){display:inline-grid;min-width:17px;height:17px;margin-left:4px;place-items:center;border-radius:50%;background:var(--accent);color:#fff;font-size:9px}.studio-panel{display:none;min-height:0;flex:1;overflow-y:auto;padding:0 22px 30px;scrollbar-color:var(--line-dark) transparent;scrollbar-width:thin}.studio-panel[data-state=active]{display:block}.workspace-tabs{display:flex;min-height:0;flex:1;flex-direction:column}.studio-tab{display:flex;align-items:center;gap:5px}.panel-intro{position:relative;padding:22px 0 14px}.catalog-sync{position:absolute;top:21px;right:0;display:inline-flex;align-items:center;gap:5px;border:0;background:transparent;color:var(--ink-faint);font-family:SFMono-Regular,Consolas,monospace;font-size:8px;letter-spacing:.03em}.catalog-sync.failed{color:var(--danger);cursor:pointer}.panel-intro span,.mini-heading{color:var(--accent-dark);font-family:SFMono-Regular,Consolas,monospace;font-size:9px;font-weight:700;letter-spacing:.1em}.panel-intro p{margin:5px 0 0;color:var(--ink-soft);font-size:12px}.form-section{padding:20px 0 8px;border-top:1px solid var(--line)}.section-heading{display:grid;grid-template-columns:27px 1fr;align-items:start;margin-bottom:17px}.section-heading>div{display:flex;flex-direction:column}.section-heading strong{font-size:13px;font-weight:680}.section-heading small{margin-top:1px;color:var(--ink-faint);font-size:10px;font-weight:450}.step-number{padding-top:2px;color:var(--accent);font-family:SFMono-Regular,Consolas,monospace;font-size:9px;font-weight:700}#runForm label,.advanced-options label{display:block;margin:0 0 12px;color:#4f504c;font-size:10px;font-weight:680;letter-spacing:.01em}#runForm input:not([type=checkbox]),#runForm select,#runForm textarea,#filter{display:block;width:100%;min-height:var(--control-height);margin-top:5px;border:1px solid var(--line-dark);border-radius:2px;outline:none;background:var(--paper-raised);color:var(--ink);font-size:12px;font-weight:500;transition:border-color .12s ease,background .12s ease}#runForm input:not([type=checkbox]),#runForm select,#filter{padding:9px 10px}#runForm textarea{min-height:88px;padding:9px 10px;resize:vertical;font-family:SFMono-Regular,Consolas,monospace;font-size:10px}#runForm input:hover,#runForm select:hover,#runForm textarea:hover,#filter:hover{border-color:#a6a79f}#runForm input:focus,#runForm select:focus,#runForm textarea:focus,#filter:focus{border-color:var(--ink);background:#fff}#runForm input::placeholder,#runForm textarea::placeholder,#filter::placeholder{color:#aaa9a2}#runForm input:disabled,#runForm select:disabled,#filter:disabled{cursor:not-allowed;opacity:.55}select{appearance:none;padding-right:32px!important;background-image:linear-gradient(45deg,transparent 50%,#60615c 50%),linear-gradient(135deg,#60615c 50%,transparent 50%)!important;background-position:calc(100% - 14px) 17px,calc(100% - 10px) 17px!important;background-repeat:no-repeat!important;background-size:4px 4px,4px 4px!important;cursor:pointer}input[type=checkbox]{width:14px;height:14px;margin:0;accent-color:var(--accent)}.optional{float:right;color:var(--ink-faint);font-weight:450}.folder-field{position:relative;margin-bottom:13px}.folder-label{margin-bottom:5px;color:#4f504c;font-size:10px;font-weight:680;letter-spacing:.01em}.folder-drop{display:flex;width:100%;min-height:86px;align-items:center;gap:12px;padding:14px;border:1px dashed #b7b7ae;border-radius:3px;background:#f8f8f4;text-align:left;cursor:pointer;transition:border-color .12s ease,background .12s ease,box-shadow .12s ease}.folder-drop:hover,.folder-drop.dragging{border-color:var(--accent);background:#fff7f2;box-shadow:inset 3px 0 0 var(--accent)}.folder-drop.has-folder{border-style:solid;border-color:#b6c8bb;background:#f4f8f4}.folder-drop:disabled{cursor:wait;opacity:.7}.folder-icon{display:grid;width:34px;height:34px;flex:0 0 34px;place-items:center;border:1px solid var(--line-dark);border-radius:2px;background:var(--paper-raised);color:var(--accent)}.folder-drop.has-folder .folder-icon{border-color:#9eb6a5;color:var(--success)}.folder-copy{display:flex;min-width:0;flex-direction:column}.folder-copy strong{overflow:hidden;color:var(--ink);font-size:12px;font-weight:680;text-overflow:ellipsis;white-space:nowrap}.folder-copy small{margin-top:2px;color:var(--ink-faint);font-size:10px;font-weight:450}.folder-input{display:none!important}.folder-remove{display:block;margin:3px 0 0 auto;padding:1px 0;border:0;background:transparent;color:var(--ink-faint);font-size:9px;cursor:pointer}.folder-remove:hover{color:var(--danger)}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 10px}.nested-options{margin:3px 0 12px;padding:13px 13px 1px;background:#ecece7;border-left:2px solid var(--accent)}.remote-vm-options{padding-bottom:12px}.provider-panel{margin:2px 0 0;padding:12px;border:1px solid #d2d2cb;background:var(--paper-raised)}.provider-heading{display:grid;grid-template-columns:30px minmax(0,1fr) auto;align-items:center;gap:9px;margin-bottom:14px}.provider-heading strong,.provider-heading small{display:block}.provider-heading strong{color:var(--ink);font-size:11px}.provider-heading small{margin-top:2px;color:var(--ink-soft);font-size:9px}.provider-mark{display:grid;width:30px;height:30px;place-items:center;border-radius:4px;background:#111;color:#7cf7c5;font-size:14px;font-weight:800}.provider-mark.ssh{background:#e7e7e1;color:var(--ink)}.provider-status{color:#287a5b;font-family:SFMono-Regular,Consolas,monospace;font-size:8px;font-weight:700;letter-spacing:.08em}.provider-status.soon{color:var(--ink-faint)}.modal-gpu-recommendation{display:grid;gap:6px;margin:-3px 0 10px;padding:11px 12px;border:1px solid #a9c4b4;border-left:2px solid var(--success);background:#f2f7f3}.modal-gpu-recommendation>div{display:flex;align-items:baseline;justify-content:space-between;gap:10px}.modal-gpu-recommendation span{color:#47715d;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;font-weight:700;letter-spacing:.11em}.modal-gpu-recommendation strong{color:#254d3a;font-size:11px;white-space:nowrap}.modal-gpu-recommendation p{margin:0;color:#5f6862;font-size:9px;line-height:1.45}.modal-gpu-recommendation small{display:flex;align-items:center;gap:5px;color:var(--success);font-size:8px;font-weight:650}.modal-gpu-recommendation button{width:max-content;border:0;padding:0;background:transparent;color:var(--accent-dark);font-size:8px;font-weight:700;text-decoration:underline;text-underline-offset:3px;cursor:pointer}.modal-gpu-recommendation.overridden{border-color:#d5b59d;border-left-color:var(--accent);background:#faf4ef}.modal-gpu-recommendation.empty{border-color:var(--line);border-left-color:var(--line-dark);background:#f2f2ed}.modal-gpu-recommendation.empty strong{color:var(--ink);font-size:10px}.modal-estimate{display:grid;margin:2px 0 14px;padding:13px;gap:7px;border:1px solid #323633;background:#171918;color:#eceee9}.modal-estimate-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:12px}.modal-estimate-heading>div{display:grid;gap:3px}.modal-estimate-heading span{color:#6f7772;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;letter-spacing:.13em}.modal-estimate-heading strong{font-family:SFMono-Regular,Consolas,monospace;font-size:20px;font-weight:500;letter-spacing:-.04em}.modal-estimate-heading em{color:#9ea5a0;font-family:SFMono-Regular,Consolas,monospace;font-size:8px;font-style:normal;white-space:nowrap}.modal-estimate-bar{height:2px;overflow:hidden;background:#303431}.modal-estimate-bar span{display:block;height:100%;background:#68d8ab}.modal-estimate p,.modal-estimate small{margin:0}.modal-estimate p{color:#c2c6c2;font-size:9px}.modal-estimate small{color:#777e79;font-size:8px;line-height:1.45}.modal-estimate a{width:max-content;color:#8e9791;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;text-decoration:none}.modal-estimate a:hover{color:#68d8ab}.modal-estimate.empty{background:#f2f2ed;color:var(--ink);border-color:var(--line)}.modal-estimate.empty strong{font-size:10px}.modal-estimate.empty p{color:var(--ink-soft);line-height:1.45}.modal-command-help{margin-top:0}.credential-success{display:flex;align-items:center;gap:5px;margin:-4px 0 12px;color:#287a5b;font-size:9px;font-weight:650}.modal-deploy-action{display:inline-flex;min-height:36px;align-items:center;justify-content:center;gap:7px;margin-bottom:8px;border:1px solid #1f2924;background:#17241e;color:#dcebe3;font-size:9px;font-weight:650;cursor:pointer}.modal-deploy-action:hover:not(:disabled){border-color:#287a5b;background:#1b2c24}.modal-deploy-action:disabled{cursor:not-allowed;opacity:.45}.modal-deployment{display:grid;margin:0 0 8px;gap:7px;padding:9px;border:1px solid var(--line);background:#eeeee9}.modal-deployment>div,.modal-deployment>div>span{display:flex;align-items:center;gap:6px}.modal-deployment>div{justify-content:space-between}.modal-deployment-actions{flex:0 0 auto}.modal-deployment-actions button{display:grid;width:24px;height:24px;padding:0;place-items:center;border:0;background:transparent;color:var(--ink-soft);cursor:pointer}.modal-deployment-actions button:hover{background:#deded7;color:var(--ink)}.modal-deployment-actions .modal-stop-action{display:inline-flex;width:auto;padding:0 7px;align-items:center;gap:4px;color:var(--danger);font-size:7px;font-weight:700}.modal-deployment-steps{display:grid;margin:2px 0 1px;padding:0;gap:3px;list-style:none}.modal-deployment-steps li{display:grid;min-height:34px;padding:5px 7px;grid-template-columns:19px minmax(0,1fr);align-items:center;gap:7px;border:1px solid transparent;color:var(--ink-faint)}.modal-deployment-steps li>div{display:grid;gap:1px}.modal-deployment-steps li strong{color:inherit;font-size:8px;font-weight:680}.modal-deployment-steps li small{color:inherit;font-size:7px;line-height:1.35}.modal-step-mark{display:grid;width:18px;height:18px;place-items:center;border:1px solid var(--line-dark);border-radius:50%;font-family:SFMono-Regular,Consolas,monospace;font-size:7px}.modal-deployment-steps li[data-state=active]{border-color:#d8bd85;background:#f8f2e7;color:#725a28}.modal-deployment-steps li[data-state=active] .modal-step-mark{border-color:#b68b32;color:#8d681e}.modal-deployment-steps li[data-state=complete]{color:var(--success)}.modal-deployment-steps li[data-state=complete] .modal-step-mark{border-color:#8aaf98}.modal-deployment-steps li[data-state=failed]{border-color:#d4a3a3;background:#faf0ef;color:var(--danger)}.modal-deployment-steps li[data-state=failed] .modal-step-mark{border-color:var(--danger)}.modal-deployment-steps li[data-state=cancelled]{border-color:#b9b9b1;background:#e7e7e1;color:var(--ink-soft)}.modal-deployment strong,.modal-deployment small{font-size:8px}.modal-deployment.completed{border-color:#9ac5af}.modal-deployment.failed{border-color:#d4a3a3;color:var(--danger)}.modal-deployment.cancelling,.modal-deployment.cancelled{border-color:#b9b9b1;color:var(--ink-soft)}.modal-deployment pre{overflow:auto;max-height:74px;margin:0;padding:7px;background:#171918;color:#aeb5b0;font:7px/1.5 SFMono-Regular,Consolas,monospace;white-space:pre-wrap}.modal-deployment .modal-log-preview-heading{display:flex;margin-top:1px;padding:0 1px;align-items:center;justify-content:space-between}.modal-log-preview-heading>span{color:var(--ink-faint);font-family:SFMono-Regular,Consolas,monospace;font-size:6px;font-weight:700;letter-spacing:.11em}.modal-log-preview-heading button{display:inline-flex;min-height:22px;padding:0 5px;align-items:center;gap:4px;border:0;background:transparent;color:var(--ink-soft);font-size:7px;font-weight:650;cursor:pointer}.modal-log-preview-heading button:hover{background:#deded7;color:var(--ink)}.modal-log-backdrop{position:fixed;z-index:80;inset:0;display:grid;padding:32px;place-items:center;background:#090a0aad;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.modal-log-dialog{display:flex;width:min(820px,calc(100vw - 64px));height:min(590px,calc(100vh - 64px));flex-direction:column;overflow:hidden;border:1px solid #4b504d;border-radius:3px;background:#111311;box-shadow:0 28px 80px #00000080;color:#e6e9e5}.modal-log-dialog header{display:flex;min-height:54px;padding:0 12px 0 16px;align-items:center;gap:12px;border-bottom:1px solid #343835}.modal-log-dialog header>div{display:grid;flex:1;gap:2px}.modal-log-dialog header span,.modal-log-dialog header small{color:#7c847e;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;letter-spacing:.1em;text-transform:uppercase}.modal-log-dialog header strong{font-size:11px;font-weight:600}.modal-log-dialog header button{display:inline-flex;min-height:29px;padding:0 8px;align-items:center;justify-content:center;gap:5px;border:0;background:transparent;color:#9fa5a1;font-size:8px;cursor:pointer}.modal-log-dialog header button:hover{background:#262a27;color:#f0f2ef}.modal-log-dialog header .modal-dialog-stop{color:#e28378}.modal-log-dialog pre{flex:1;overflow:auto;margin:0;padding:18px;color:#bbc2bc;font:10px/1.65 SFMono-Regular,Consolas,monospace;-webkit-user-select:text;user-select:text;white-space:pre-wrap}@media(max-width:640px){.modal-log-backdrop{padding:12px}.modal-log-dialog{width:calc(100vw - 24px);height:calc(100vh - 24px)}.modal-log-dialog header small{display:none}}.remote-message:empty{display:none}.modal-workspace-status{display:grid;min-height:50px;margin:0 0 10px;padding:9px 10px;grid-template-columns:24px minmax(0,1fr);align-items:center;gap:8px;border:1px solid var(--line-dark);background:#eeeeea}.modal-workspace-status>span{display:grid;width:23px;height:23px;place-items:center;border:1px solid currentColor;border-radius:50%;color:var(--ink-soft)}.modal-workspace-status>div{display:grid;gap:2px}.modal-workspace-status strong{color:var(--ink);font-size:9px;font-weight:700}.modal-workspace-status small{color:var(--ink-soft);font-size:8px;line-height:1.45}.modal-workspace-status.working{border-color:#d8bd85;background:#f8f2e7}.modal-workspace-status.working>span{color:#8d681e}.modal-workspace-status.found{border-color:#aebbc2;background:#eef2f3}.modal-workspace-status.found>span{color:#536d79}.modal-workspace-status.ready{border-color:#9ac5af;background:#edf5f0}.modal-workspace-status.ready>span{color:var(--success)}.modal-workspace-status.attention{border-color:#d4a3a3;background:#faf0ef}.modal-workspace-status.attention>span,.modal-workspace-status.attention strong{color:var(--danger)}.field-help{margin:-5px 0 12px;color:var(--ink-soft);font-size:10px;line-height:1.5}.field-help code{font-family:SFMono-Regular,Consolas,monospace}.format-detection{margin-top:-7px;padding:8px 9px;border-left:2px solid var(--success);background:#eef4ef;color:#526159}.format-detection strong{color:#315843}.format-detection.warning{border-left-color:#b78d38;background:#f7f3e8;color:#746748}.mini-heading{margin:1px 0 10px;color:var(--ink-soft)}.loader-options{margin:-3px 0 12px;padding:12px 12px 1px;background:#ecece7;border:1px solid var(--line)}.check-label{display:flex!important;align-items:center;gap:8px;min-height:26px;cursor:pointer}.segmented{display:grid;grid-template-columns:1fr 1fr;margin-bottom:13px;border:1px solid var(--line-dark);background:var(--paper-raised)}.input-source{margin-top:2px}.sample-picker{margin-bottom:13px}.sample-card{display:grid;grid-template-columns:32px minmax(0,1fr);gap:10px;margin:-4px 0 10px;padding:11px;border:1px solid var(--line);background:#ecece7}.sample-card.ready{border-color:#b6c8bb;background:#f4f8f4}.sample-state{display:grid;width:30px;height:30px;place-items:center;border:1px solid var(--line-dark);color:var(--accent)}.sample-card.ready .sample-state{border-color:#9eb6a5;color:var(--success)}.sample-card>div{display:flex;min-width:0;flex-direction:column}.sample-card strong{font-size:11px}.sample-card small{margin-top:1px;color:var(--ink-soft);font-size:9px;line-height:1.45}.sample-card div>span{margin-top:5px;color:var(--ink-faint);font-family:SFMono-Regular,Consolas,monospace;font-size:8px}.sample-card a{color:var(--ink-soft);text-underline-offset:2px}.sample-help{margin-top:0}.target-choice{display:flex;min-height:36px;align-items:center;justify-content:center;gap:6px;border:0;background:transparent;color:var(--ink-soft);font-size:10px;font-weight:680;cursor:pointer}.target-choice+.target-choice{border-left:1px solid var(--line-dark)}.target-choice.active{background:var(--ink);color:#fff}.hardware-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 10px;margin:-4px 0 11px;padding:10px;border:1px solid var(--line);background:#ecece7}.hardware-card strong{overflow:hidden;font-size:11px;text-overflow:ellipsis;white-space:nowrap}.hardware-card small{grid-row:2;overflow:hidden;color:var(--ink-soft);font-size:9px;text-overflow:ellipsis;white-space:nowrap}.capability{grid-column:2;grid-row:1 / span 2;align-self:center;padding:3px 6px;border:1px solid var(--line-dark);color:var(--ink-soft);font-family:SFMono-Regular,Consolas,monospace;font-size:8px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.capability.yes{border-color:#8aaf98;color:var(--success)}.advanced-options{margin:13px 0 16px;padding-top:14px;border-top:1px solid var(--line)}.advanced-trigger{display:flex;width:100%;align-items:center;justify-content:space-between;border:0;padding:0 0 13px;background:transparent;color:var(--ink-soft);font-size:10px;font-weight:680;cursor:pointer}.advanced-trigger>span,.secondary-action{display:flex;align-items:center;justify-content:center;gap:6px}.advanced-trigger-copy{display:grid;gap:1px;text-align:left}.advanced-trigger-copy small{color:var(--ink-faint);font-family:SFMono-Regular,Consolas,monospace;font-size:7px;font-weight:500}.advanced-trigger[data-state=open]>svg{transform:rotate(180deg)}.advanced-content{overflow:hidden}.machine-profile-summary{display:grid;gap:7px;margin:0 0 14px;padding:11px 12px;border:1px solid var(--line);border-left:2px solid var(--accent);background:#eeeeea}.machine-profile-summary>div:first-child{display:flex;align-items:baseline;justify-content:space-between;gap:10px}.machine-profile-summary>div:first-child span{color:var(--ink-faint);font-family:SFMono-Regular,Consolas,monospace;font-size:7px;letter-spacing:.1em}.machine-profile-summary strong{overflow:hidden;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.machine-profile-summary p,.advanced-machine-note{margin:0;color:var(--ink-soft);font-size:9px;line-height:1.45}.machine-profile-specs{display:flex;flex-wrap:wrap;gap:5px}.machine-profile-specs span{padding:3px 6px;border:1px solid var(--line-dark);background:var(--paper-raised);color:#555752;font-family:SFMono-Regular,Consolas,monospace;font-size:7px}.advanced-machine-note{margin:-5px 0 13px}.toggle-row{display:flex;min-height:31px;align-items:center;gap:9px;margin:0 0 10px}.toggle-row.disabled{opacity:.48}.toggle-row label{margin:0!important;cursor:pointer}.switch-root{position:relative;width:28px;height:16px;flex:0 0 28px;border:0;border-radius:999px;padding:0;background:#b9b9b2;cursor:pointer}.switch-root[data-state=checked]{background:var(--accent)}.switch-thumb{display:block;width:12px;height:12px;border-radius:50%;background:#fff;transform:translate(2px);transition:transform .12s ease}.switch-thumb[data-state=checked]{transform:translate(14px)}.primary-action{display:flex;width:100%;min-height:43px;align-items:center;justify-content:space-between;border:1px solid var(--ink);border-radius:0;padding:0 14px;background:var(--ink);color:#fff;font-size:11px;font-weight:680;cursor:pointer;transition:background .12s ease,border-color .12s ease}.primary-action:hover{border-color:var(--accent-dark);background:var(--accent-dark)}.spin{animation:spin .9s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.panel-loading{display:flex;align-items:center;gap:8px;padding:36px 0;color:var(--ink-soft);font-size:11px}.panel-loading.failed{align-items:flex-start;color:var(--danger)}.panel-loading.failed>div{display:grid;flex:1;gap:3px}.panel-loading.failed strong,.panel-loading.failed small{display:block}.panel-loading.failed small{color:var(--ink-soft);line-height:1.4}.hardware-card.detecting{display:flex;min-height:54px;align-items:center;gap:10px}.hardware-card.detecting>div{display:grid;gap:3px}.primary-action:disabled{cursor:wait;opacity:.55}.form-error{min-height:18px;margin:4px 0 8px;color:var(--danger);font-size:10px}.secondary-action,.icon-button{border:1px solid var(--line-dark);border-radius:2px;background:var(--paper-raised);color:var(--ink);font-size:10px;font-weight:650;cursor:pointer}.secondary-action{padding:7px 10px}.secondary-action:hover,.icon-button:hover{border-color:var(--ink)}.secondary-action.full-width{width:100%;margin:2px 0 10px}.panel-title{display:flex;align-items:center;justify-content:space-between;margin:22px 0 17px}.panel-title h3{margin:0;font-size:18px;font-weight:680;letter-spacing:-.035em}.panel-title p{margin:2px 0 0;color:var(--ink-soft);font-size:10px}.icon-button{width:31px;height:31px}.job-list{display:flex;flex-direction:column;gap:8px}.job-card{padding:12px;border:1px solid var(--line);background:var(--paper-raised)}.job-card.selected{border-left:2px solid var(--accent)}.job-card-top{display:flex;justify-content:space-between;gap:8px}.job-card strong{font-size:12px}.job-card>small{color:var(--ink-soft);font-size:9px}.job-status{color:var(--ink-soft);font-family:SFMono-Regular,Consolas,monospace;font-size:8px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.job-status.running,.job-status.queued{color:#a85523}.job-status.completed{color:var(--success)}.job-status.failed,.job-status.cancelled,.job-error{color:var(--danger)}.job-actions{display:flex;gap:12px;margin-top:9px}.job-card>.splat-download{margin-top:10px}.text-button{display:inline-flex;align-items:center;gap:4px;border:0;padding:0;background:none;color:var(--ink);font-size:9px;font-weight:700;text-decoration:underline;text-decoration-color:var(--line-dark);text-underline-offset:3px;cursor:pointer}.text-button.danger{color:var(--danger)}.job-error{margin:6px 0;font-size:9px}.empty-state{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:5px;padding:42px 16px;border:1px dashed var(--line-dark);color:var(--ink-faint);font-size:11px;text-align:center}.empty-state strong{color:var(--ink);font-size:11px}.empty-state span{font-size:10px}#resultsPanel #info{margin-bottom:12px}#resultsPanel #filter{margin:0 0 12px}#resultsPanel #sceneList{min-height:200px}#info{display:flex;align-items:center;gap:12px;padding:11px;border:1px solid var(--line);background:var(--paper-raised)}#info .info-pill{display:grid;width:39px;height:39px;flex:0 0 39px;place-items:center;background:var(--ink);color:#fff;font-family:SFMono-Regular,Consolas,monospace;font-size:12px;font-weight:700}#info .info-details{min-width:0}#info .info-title{font-size:11px;font-weight:680}#info .info-path{overflow:hidden;margin-top:2px;color:var(--ink-soft);font-family:SFMono-Regular,Consolas,monospace;font-size:8px;text-overflow:ellipsis;white-space:nowrap}#info.info-error{border-color:#d5a29d}#info.info-error .info-pill{background:var(--danger)}#sceneList{margin:0 -6px;overflow-y:auto}#sceneList.is-disabled{pointer-events:none;opacity:.45}#sceneList ul{margin:3px 0;padding-left:15px;list-style:none}.directory-node{display:flex;width:100%;min-height:30px;align-items:center;gap:7px;border:0;padding:6px;background:transparent;color:var(--ink);font-size:11px;font-weight:680;text-align:left;cursor:pointer}.directory-node:hover{background:#eeeee9}.directory-node:focus-visible{outline:1px solid var(--accent);outline-offset:-1px}.directory-chevron{width:6px;height:6px;flex:0 0 6px;border-right:1px solid var(--ink-faint);border-bottom:1px solid var(--ink-faint);transform:rotate(45deg) translate(-1px,-1px);transition:transform .12s ease}.directory-branch.is-collapsed>.directory-node .directory-chevron{transform:rotate(-45deg)}.directory-branch.is-collapsed>ul{display:none}.item{margin-bottom:1px;padding:7px 8px;border-left:2px solid transparent;cursor:pointer}.item:hover{background:#e9e9e4}.item.active{border-left-color:var(--accent);background:#e6e5df}.item div{overflow:hidden;color:var(--ink);font-size:11px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.item small{display:block;overflow:hidden;color:var(--ink-soft);font-size:9px;text-overflow:ellipsis;white-space:nowrap}.item .result-splat-download{display:flex;margin-top:7px}.result-splat-download .splat-format-label{display:grid;width:61px;min-height:27px;place-items:center;border:1px solid var(--line-dark);border-right:0;border-radius:2px 0 0 2px;padding:4px 7px;background-color:var(--paper-raised);color:var(--ink);font:8px SFMono-Regular,Consolas,monospace}.result-splat-download a{display:grid;min-width:65px;place-items:center;border:1px solid var(--line-dark);border-radius:0 2px 2px 0;padding:0 7px;color:var(--ink);font-size:8px;font-weight:650;text-decoration:none}.result-splat-download a:hover{border-color:var(--ink)}#main-content{position:relative;min-width:0;flex:1;overflow:hidden;background:var(--viewport)}#renderCanvas{display:block;width:100%;height:100%;outline:none}.setup-panel,.setup-reopen{position:absolute;z-index:9;top:18px;right:18px}.setup-panel.with-active-job,.setup-reopen.with-active-job{top:91px}.setup-panel{width:318px;overflow:hidden;border:1px solid #404346;border-radius:2px;background:#131517f5;box-shadow:0 12px 32px #0000003d;color:#e8e8e3;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}.setup-panel.collapsed{width:238px}.setup-panel-header{display:grid;min-height:52px;grid-template-columns:20px 1fr auto;align-items:center;gap:9px;padding:9px 8px 9px 12px}.setup-overall-icon{display:grid;width:20px;height:20px;place-items:center;color:#d69a52}.setup-overall-icon.ready{color:#6fa484}.setup-overall-icon.error{color:#d16b61}.setup-panel-copy{display:flex;min-width:0;flex-direction:column}.setup-panel-copy>span{color:#767b7d;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;font-weight:700;letter-spacing:.13em}.setup-panel-copy strong{overflow:hidden;margin-top:1px;font-size:11px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.setup-panel-actions{display:flex;align-items:center}.setup-panel-actions button,.setup-reopen{display:grid;width:27px;height:27px;place-items:center;border:0;padding:0;background:transparent;color:#8d9192;cursor:pointer}.setup-panel-actions button:hover,.setup-reopen:hover{background:#2b2e30;color:#f0f0eb}.setup-panel-actions button:disabled{cursor:wait;opacity:.5}.setup-panel-body{max-height:min(560px,calc(100vh - 92px));overflow-y:auto;border-top:1px solid #34373a;scrollbar-color:#44484a transparent;scrollbar-width:thin}.setup-summary-line{display:flex;justify-content:space-between;gap:10px;padding:8px 12px;border-bottom:1px solid #2f3234;color:#777c7d;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;letter-spacing:.04em;text-transform:uppercase}.setup-panel ul{margin:0;padding:4px 0;list-style:none}.setup-panel li{display:grid;grid-template-columns:18px 1fr;gap:7px;padding:7px 12px}.setup-check-content{min-width:0}.setup-check-mark{display:grid;width:16px;height:16px;margin-top:1px;place-items:center;border:1px solid #44484a;border-radius:50%;color:#6fa484}.setup-panel li[data-state=error] .setup-check-mark{border-color:#804f4a;color:#d16b61}.setup-panel li[data-state=optional] .setup-check-mark,.setup-panel li[data-state=warning] .setup-check-mark{border-color:#484c4e;color:transparent}.setup-panel li[data-state=optional] .setup-check-mark>span,.setup-panel li[data-state=warning] .setup-check-mark>span{width:4px;height:4px;border-radius:50%;background:#686d6f}.setup-check-title{display:flex;align-items:center;justify-content:space-between;gap:8px}.setup-check-tools{display:flex;flex:0 0 auto;align-items:center;gap:6px}.setup-check-title strong{color:#dadbd6;font-size:10px;font-weight:620}.setup-check-title em{color:#686d6f;font-family:SFMono-Regular,Consolas,monospace;font-size:6px;font-style:normal;letter-spacing:.08em;text-transform:uppercase}.setup-check-title .setup-install{display:flex;min-height:21px;align-items:center;justify-content:center;gap:4px;border:1px solid #505456;border-radius:2px;padding:2px 6px;background:#25282a;color:#d7d8d3;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;font-weight:650;cursor:pointer;white-space:nowrap}.setup-check-title .setup-install:hover:not(:disabled){border-color:#777b7d;background:#303335;color:#fff}.setup-check-title .setup-install:disabled{cursor:not-allowed;opacity:.45}.setup-panel li small{display:block;margin-top:1px;color:#777c7d;font-size:8px;line-height:1.35}.setup-panel li[data-state=error] small{color:#b87a74}.setup-panel li small.setup-action-error{color:#d9877f}.setup-loading{display:flex;align-items:center;gap:8px;padding:15px 12px;color:#8c9092;font-size:9px}.setup-reopen{width:34px;height:34px;border:1px solid #404346;border-radius:2px;background:#131517f0;box-shadow:0 8px 22px #0003}.run-status-bar{position:absolute;z-index:8;right:18px;bottom:68px;left:auto;width:min(720px,calc(100% - 36px));display:grid;min-height:61px;grid-template-columns:1.2fr 1fr auto;grid-template-rows:auto 2px;align-items:center;gap:8px 16px;padding:11px 12px 9px;border:1px solid #373a3c;background:#131517f0;color:#ecece7;cursor:grab}.status-copy{display:flex;align-items:center;gap:10px}.status-drag-handle{min-width:0;cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none}.status-metrics,.run-progress-track{touch-action:none;-webkit-user-select:none;user-select:none}.run-status-bar.is-dragging .status-drag-handle,.run-status-bar.is-dragging{cursor:grabbing}.status-copy>div{display:flex;flex-direction:column}.status-copy strong{font-size:11px}.status-copy small{color:#8c9092;font-size:9px}.status-dot{width:7px;height:7px;background:var(--accent);animation:statusPulse 1.5s ease-in-out infinite}.run-status-bar[data-status=completed] .status-dot{background:#6da17f;animation:none}.run-status-bar[data-status=failed] .status-dot,.run-status-bar[data-status=cancelled] .status-dot{background:#cb6258;animation:none}@keyframes statusPulse{50%{opacity:.35}}.status-metrics{display:flex;justify-content:flex-end;gap:13px;color:#a3a6a5;font-family:SFMono-Regular,Consolas,monospace;font-size:8px;font-variant-numeric:tabular-nums}.run-progress-track{grid-column:1 / 4;height:2px;overflow:hidden;background:#343739}.run-progress-fill{width:100%;height:100%;background:var(--accent);transition:transform .4s ease}.run-status-bar .secondary-action{border-color:#484c4e;background:transparent;color:#d1d2cd}.run-status-bar .secondary-action.stop-process{border-color:#744843;color:#e79289}.run-status-bar .secondary-action.stop-process:hover{border-color:#a95a52;background:#b94b4021;color:#ffb0a8}.status-actions{display:flex;align-items:center;gap:4px}.splat-download{display:flex;align-items:stretch;min-height:31px}.splat-download .splat-format-label{display:grid;width:62px;min-height:31px;place-items:center;border:1px solid #484c4e;border-right:0;border-radius:2px 0 0 2px;padding:5px 7px;background-color:transparent;color:#d1d2cd;font-family:SFMono-Regular,Consolas,monospace;font-size:8px}.splat-download a{display:flex;min-width:76px;align-items:center;justify-content:center;gap:5px;border:1px solid #484c4e;border-radius:0 2px 2px 0;padding:0 8px;color:#d1d2cd;font-size:9px;font-weight:650;text-decoration:none}.splat-download a:hover{border-color:#707476;color:#fff}.splat-download.compact{width:fit-content;min-height:27px}.splat-download.compact .splat-format-label{min-height:27px;border-color:var(--line-dark);background-color:var(--paper-raised);color:var(--ink)}.splat-download.compact a{min-width:31px;border-color:var(--line-dark);color:var(--ink)}.status-close{display:grid;width:31px;height:31px;place-items:center;border:1px solid #484c4e;border-radius:2px;padding:0;background:transparent;color:#8e9293;cursor:pointer}.status-close:hover{border-color:#707476;color:#f0f0eb}.status-close:focus-visible{outline:1px solid var(--accent);outline-offset:2px}#hud{position:absolute;z-index:5;right:58px;bottom:18px;display:flex;align-items:center;gap:1px;padding:4px;border:1px solid #383b3e;background:#131517eb;color:#b9bcba;font-size:9px}.viewport-github{position:absolute;z-index:6;right:18px;bottom:18px;display:grid;width:31px;height:31px;place-items:center;border:1px solid #414547;border-radius:2px;background:#131517eb;color:#d3d4d0;text-decoration:none;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.viewport-github:hover{border-color:#767a7c;color:#fff}.viewport-github:focus-visible{outline:1px solid var(--accent);outline-offset:2px}#hud button{display:flex;height:30px;align-items:center;justify-content:center;gap:5px;min-width:0;border:0;padding:0 10px;background:transparent;color:#d3d4d0;font-size:9px;font-weight:620;cursor:pointer;white-space:nowrap}#hud button:hover,#hud button.is-active{background:#303335;color:#fff}#hud label{display:flex;align-items:center;gap:6px;min-height:30px;padding:0 8px;border-left:1px solid #343739;white-space:nowrap}#hud .background-control{gap:7px;border-left:0}#hud .background-control select{width:82px;min-height:24px;border:1px solid #3f4345;border-radius:1px;padding:3px 22px 3px 7px!important;outline:none;background-color:#232628;background-position:calc(100% - 11px) 10px,calc(100% - 7px) 10px!important;color:#e2e3de;font-size:9px}#hud .background-control select:hover,#hud .background-control select:focus{border-color:#676b6d}#hud input[type=range]{width:90px;accent-color:var(--accent)}#hud .plane-height-control{min-width:190px}#hud .plane-height-control input[type=range]{width:112px}#groundYValue{min-width:25px;color:#e4e5df;font-family:SFMono-Regular,Consolas,monospace;font-size:8px;text-align:right}#hud input[type=checkbox]{accent-color:var(--accent)}#hud.hud-splat-mode .hud-scene-only,.hud-hidden{display:none!important}#sceneStats{position:absolute;z-index:6;top:18px;left:18px;display:grid;min-width:178px;gap:8px;padding:12px;border:1px solid #383b3e;background:#131517eb;color:#e5e5df}#sceneStats .stat-group[data-mode=scene]{display:grid;grid-template-columns:1fr 1fr;gap:9px 15px}#sceneStats .stat-group[data-mode=splat]{display:none}#sceneStats .stat-wide{grid-column:1 / 3}#sceneStats .stat-pair,#sceneStats .stat-wide{display:flex;flex-direction:column}#sceneStats .label{color:#747879;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;letter-spacing:.12em;text-transform:uppercase}#sceneStats .value{overflow:hidden;color:#e6e6e1;font-family:SFMono-Regular,Consolas,monospace;font-size:12px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}#sceneStats .stat-wide .value{max-width:240px}#sceneStats.dask-active{width:226px}.dask-stats{display:grid;padding-top:11px;gap:11px;border-top:1px solid #34383a;animation:dask-stats-expand .18s ease-out;transform-origin:top}@keyframes dask-stats-expand{0%{opacity:0;transform:scaleY(.75) translateY(-5px)}to{opacity:1;transform:scaleY(1) translateY(0)}}.dask-stats-heading,.dask-memory>div:first-child{display:flex;align-items:flex-end;justify-content:space-between;gap:10px}.dask-stats-heading>div{display:grid;gap:3px}.dask-stats-heading span,.dask-memory span,.dask-stat-grid span{color:#747879;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;letter-spacing:.12em;text-transform:uppercase}.dask-stats-heading strong{font-size:11px;font-weight:600}.dask-stats-heading a{color:#9ba09f;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;text-decoration:none}.dask-stats-heading a:hover{color:var(--accent)}.dask-stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px 14px}.dask-stat-grid>div{display:grid;gap:1px}.dask-stat-grid strong{color:#eeeee9;font-family:SFMono-Regular,Consolas,monospace;font-size:15px;font-weight:500}.dask-stat-grid small{color:#656a6b;font-family:SFMono-Regular,Consolas,monospace;font-size:7px}.dask-memory{display:grid;gap:5px}.dask-memory strong{color:#9da2a1;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;font-weight:500}.dask-memory-track{height:2px;overflow:hidden;background:#2e3234}.dask-memory-track span{display:block;height:100%;background:var(--accent);transition:width .3s ease}.dask-stats-waiting{display:flex;align-items:center;gap:7px;color:#858a89;font-family:SFMono-Regular,Consolas,monospace;font-size:8px}.dask-pulse{width:5px;height:5px;border-radius:50%;background:var(--accent);animation:dask-pulse 1.2s ease-in-out infinite}@keyframes dask-pulse{50%{opacity:.25}}.pipeline-wait-overlay{position:absolute;z-index:4;inset:0;display:flex;align-items:center;justify-content:center;padding:96px 28px 76px;background:#0506076b;color:#ecece7;pointer-events:none;animation:pipeline-viewport-dim 2.6s ease-in-out infinite}.pipeline-wait-content{display:grid;width:min(560px,calc(100% - 48px));justify-items:center;gap:11px;text-align:center}.pipeline-wait-content>span{color:#858a89;font:650 8px/1.2 SFMono-Regular,Consolas,monospace;letter-spacing:.14em}.pipeline-wait-content strong{max-width:100%;color:#f0f0eb;font-size:clamp(15px,2vw,22px);font-weight:500;line-height:1.35;text-wrap:balance}.pipeline-wait-content small{color:#858a89;font-size:10px}.pipeline-wait-dots{display:flex;height:6px;align-items:center;gap:5px}.pipeline-wait-dots i{display:block;width:3px;height:3px;border-radius:50%;background:var(--accent);animation:pipeline-dot 1.35s ease-in-out infinite}.pipeline-wait-dots i:nth-child(2){animation-delay:.16s}.pipeline-wait-dots i:nth-child(3){animation-delay:.32s}@keyframes pipeline-viewport-dim{50%{background-color:#05060791}}@keyframes pipeline-dot{0%,70%,to{opacity:.22;transform:translateY(0)}35%{opacity:1;transform:translateY(-2px)}}.hardware-warning{position:fixed;z-index:30;top:50%;left:50%;display:grid;width:min(430px,calc(100vw - 48px));padding:16px 42px 16px 16px;grid-template-columns:24px 1fr;gap:11px;border:1px solid #665936;border-radius:3px;background:#181712f7;color:#ece9de;box-shadow:0 16px 42px #00000061;transform:translate(-50%,-50%);animation:hardware-warning-in .18s ease-out}@keyframes hardware-warning-in{0%{opacity:0;transform:translate(-50%,calc(-50% - 8px))}to{opacity:1;transform:translate(-50%,-50%)}}.hardware-warning-icon{display:grid;width:24px;height:24px;place-items:center;border:1px solid #6e6038;border-radius:50%;color:#e0b74c}.hardware-warning-copy{display:grid;gap:5px}.hardware-warning-copy>span{color:#a89052;font-family:SFMono-Regular,Consolas,monospace;font-size:7px;letter-spacing:.14em}.hardware-warning-copy>strong{font-size:13px;font-weight:600}.hardware-warning-copy p{margin:1px 0 7px;color:#a7a69f;font-size:10px;line-height:1.5}.hardware-warning-actions{display:flex;flex-wrap:wrap;gap:7px}.hardware-warning-actions button{display:inline-flex;min-height:29px;padding:0 10px;align-items:center;justify-content:center;gap:6px;border:1px solid #4a4a44;background:transparent;color:#b7b7b0;font-family:SFMono-Regular,Consolas,monospace;font-size:8px;cursor:pointer}.hardware-warning-actions .warning-primary{border-color:#d1aa40;background:#d1aa40;color:#15140f;font-weight:700}.hardware-warning-actions button:hover{border-color:#e2bd55;color:#f2f0e8}.hardware-warning-actions .warning-primary:hover{background:#e2bd55;color:#15140f}.hardware-warning-close{position:absolute;top:9px;right:9px;display:grid;width:25px;height:25px;padding:0;place-items:center;border:0;background:transparent;color:#7d7d76;cursor:pointer}.hardware-warning-close:hover{color:#ece9de}@media(max-width:840px){.hardware-warning{width:calc(100vw - 24px)}}.log-drawer{position:absolute;z-index:12;right:18px;bottom:58px;display:flex;width:min(420px,calc(100% - 36px));height:min(240px,32%);flex-direction:column;overflow:hidden;border:1px solid #44484a;border-radius:2px;background:#0e1012fa;box-shadow:0 12px 34px #0000004d}.log-resize-handle{position:absolute;z-index:4;width:18px;height:18px;border:0;padding:0;background:transparent;touch-action:none}.log-resize-handle:before{position:absolute;width:8px;height:8px;border-color:#737879;border-style:solid;border-width:0;content:""}.log-resize-handle.nw{top:-1px;left:-1px;cursor:nwse-resize}.log-resize-handle.nw:before{top:4px;left:4px;border-top-width:1px;border-left-width:1px}.log-resize-handle.ne{top:-1px;right:-1px;cursor:nesw-resize}.log-resize-handle.ne:before{top:4px;right:4px;border-top-width:1px;border-right-width:1px}.log-resize-handle.sw{bottom:-1px;left:-1px;cursor:nesw-resize}.log-resize-handle.sw:before{bottom:4px;left:4px;border-bottom-width:1px;border-left-width:1px}.log-resize-handle.se{right:-1px;bottom:-1px;cursor:nwse-resize}.log-resize-handle.se:before{right:4px;bottom:4px;border-right-width:1px;border-bottom-width:1px}.log-resize-handle:hover:before{border-color:var(--accent)}.log-header{display:flex;align-items:center;justify-content:space-between;padding:8px 11px;border-bottom:1px solid #333739;color:#d7d8d3;font-size:9px;cursor:move;touch-action:none;-webkit-user-select:none;user-select:none}.log-header strong{display:flex;align-items:center;gap:6px}.log-header-actions{display:flex;align-items:center;gap:1px}.log-header button{display:grid;width:27px;height:25px;place-items:center;border:0;padding:0;background:none;color:#8b8f90;cursor:pointer}.log-header button.log-copy{width:auto;min-width:54px;grid-auto-flow:column;gap:5px;padding:0 7px;font-size:8px}.log-header button:hover{background:#292c2e;color:#f0f0eb}.log-header button:focus-visible{outline:1px solid var(--accent);outline-offset:-2px}#runLogs{flex:1;overflow:auto;margin:0;padding:11px;color:#adb1af;font-family:SFMono-Regular,Consolas,monospace;font-size:var(--log-font-size, 9px);line-height:1.6;cursor:text;-webkit-user-select:text;user-select:text;white-space:pre-wrap}.loading-overlay{position:absolute;z-index:20;inset:0;display:flex;align-items:center;justify-content:center;background:#060708b8;opacity:0;pointer-events:none;transition:opacity .18s ease}.loading-overlay.active{opacity:1;pointer-events:auto}.loading-box{display:grid;min-width:270px;gap:13px;padding:16px;border:1px solid #3b3f41;background:#151719;color:#dddeda}#loadingMessage{font-size:10px;font-weight:650}.loading-progress-track{width:100%;height:2px;overflow:hidden;background:#363a3c}.loading-progress-fill{width:0;height:100%;background:var(--accent);transition:width .12s ease}@media(max-width:900px){#sidebar{flex-basis:var(--sidebar-width, 380px)}.status-metrics{display:none}}@media(max-width:720px){body{display:block;overflow:auto;background:var(--paper)}.app-shell{display:block;height:auto}#sidebar{width:100%;min-width:0;height:auto;min-height:100vh;border-right:0}#sidebar.sidebar-collapsed{width:0;min-width:0;min-height:0;height:0;overflow:visible;background:transparent}.sidebar-resize-handle{display:none}.sidebar-collapsed .studio-header{top:10px;left:10px;min-height:0;justify-content:flex-start;padding:0}#main-content{height:72vh;min-height:520px}.run-status-bar{grid-template-columns:1fr auto}.run-progress-track{grid-column:1 / 3}.setup-panel,.setup-reopen{top:10px;right:10px}.setup-panel.with-active-job,.setup-reopen.with-active-job{top:90px}.setup-panel{width:min(318px,calc(100vw - 20px))}.setup-panel-body{max-height:390px}.log-drawer{right:10px;bottom:56px;width:min(420px,calc(100% - 20px));height:min(220px,34%)}#hud{right:50px;bottom:10px;left:10px;overflow-x:auto}.viewport-github{right:10px;bottom:10px}}@media(max-width:430px){.form-grid{grid-template-columns:1fr}.studio-header,.studio-tabs,.studio-panel{padding-right:17px;padding-left:17px}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}} diff --git a/visualization/static/studio.js b/visualization/static/studio.js index dd2f7dc8f..a9aa2f467 100644 --- a/visualization/static/studio.js +++ b/visualization/static/studio.js @@ -1,18 +1,18 @@ -var Pm=u=>{throw TypeError(u)};var eh=(u,r,f)=>r.has(u)||Pm("Cannot "+f);var pt=(u,r,f)=>(eh(u,r,"read from private field"),f?f.call(u):r.get(u)),th=(u,r,f)=>r.has(u)?Pm("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(u):r.set(u,f),fo=(u,r,f,o)=>(eh(u,r,"write to private field"),o?o.call(u,f):r.set(u,f),f);function Yg(u,r){for(var f=0;fo[m]})}}}return Object.freeze(Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}))}function Vg(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var mo={exports:{}},bi={};var lh;function Xg(){if(lh)return bi;lh=1;var u=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function f(o,m,h){var S=null;if(h!==void 0&&(S=""+h),m.key!==void 0&&(S=""+m.key),"key"in m){h={};for(var E in m)E!=="key"&&(h[E]=m[E])}else h=m;return m=h.ref,{$$typeof:u,type:o,key:S,ref:m!==void 0?m:null,props:h}}return bi.Fragment=r,bi.jsx=f,bi.jsxs=f,bi}var ah;function Qg(){return ah||(ah=1,mo.exports=Xg()),mo.exports}var c=Qg(),ho={exports:{}},re={};var nh;function Zg(){if(nh)return re;nh=1;var u=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),S=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),O=Symbol.iterator;function Y(_){return _===null||typeof _!="object"?null:(_=O&&_[O]||_["@@iterator"],typeof _=="function"?_:null)}var H={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},V=Object.assign,X={};function k(_,G,Q){this.props=_,this.context=G,this.refs=X,this.updater=Q||H}k.prototype.isReactComponent={},k.prototype.setState=function(_,G){if(typeof _!="object"&&typeof _!="function"&&_!=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,_,G,"setState")},k.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function Z(){}Z.prototype=k.prototype;function w(_,G,Q){this.props=_,this.context=G,this.refs=X,this.updater=Q||H}var q=w.prototype=new Z;q.constructor=w,V(q,k.prototype),q.isPureReactComponent=!0;var $=Array.isArray;function W(){}var K={H:null,A:null,T:null,S:null},ne=Object.prototype.hasOwnProperty;function ee(_,G,Q){var J=Q.ref;return{$$typeof:u,type:_,key:G,ref:J!==void 0?J:null,props:Q}}function Me(_,G){return ee(_.type,G,_.props)}function Ce(_){return typeof _=="object"&&_!==null&&_.$$typeof===u}function xe(_){var G={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(Q){return G[Q]})}var ce=/\/+/g;function Ne(_,G){return typeof _=="object"&&_!==null&&_.key!=null?xe(""+_.key):G.toString(36)}function Ye(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(W,W):(_.status="pending",_.then(function(G){_.status==="pending"&&(_.status="fulfilled",_.value=G)},function(G){_.status==="pending"&&(_.status="rejected",_.reason=G)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function R(_,G,Q,J,ue){var se=typeof _;(se==="undefined"||se==="boolean")&&(_=null);var Se=!1;if(_===null)Se=!0;else switch(se){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(_.$$typeof){case u:case r:Se=!0;break;case p:return Se=_._init,R(Se(_._payload),G,Q,J,ue)}}if(Se)return ue=ue(_),Se=J===""?"."+Ne(_,0):J,$(ue)?(Q="",Se!=null&&(Q=Se.replace(ce,"$&/")+"/"),R(ue,G,Q,"",function(Tt){return Tt})):ue!=null&&(Ce(ue)&&(ue=Me(ue,Q+(ue.key==null||_&&_.key===ue.key?"":(""+ue.key).replace(ce,"$&/")+"/")+Se)),G.push(ue)),1;Se=0;var Be=J===""?".":J+":";if($(_))for(var He=0;He<_.length;He++)J=_[He],se=Be+Ne(J,He),Se+=R(J,G,Q,se,ue);else if(He=Y(_),typeof He=="function")for(_=He.call(_),He=0;!(J=_.next()).done;)J=J.value,se=Be+Ne(J,He++),Se+=R(J,G,Q,se,ue);else if(se==="object"){if(typeof _.then=="function")return R(Ye(_),G,Q,J,ue);throw G=String(_),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return Se}function L(_,G,Q){if(_==null)return _;var J=[],ue=0;return R(_,J,"","",function(se){return G.call(Q,se,ue++)}),J}function le(_){if(_._status===-1){var G=_._result;G=G(),G.then(function(Q){(_._status===0||_._status===-1)&&(_._status=1,_._result=Q)},function(Q){(_._status===0||_._status===-1)&&(_._status=2,_._result=Q)}),_._status===-1&&(_._status=0,_._result=G)}if(_._status===1)return _._result.default;throw _._result}var Ee=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},je={map:L,forEach:function(_,G,Q){L(_,function(){G.apply(this,arguments)},Q)},count:function(_){var G=0;return L(_,function(){G++}),G},toArray:function(_){return L(_,function(G){return G})||[]},only:function(_){if(!Ce(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return re.Activity=M,re.Children=je,re.Component=k,re.Fragment=f,re.Profiler=m,re.PureComponent=w,re.StrictMode=o,re.Suspense=j,re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=K,re.__COMPILER_RUNTIME={__proto__:null,c:function(_){return K.H.useMemoCache(_)}},re.cache=function(_){return function(){return _.apply(null,arguments)}},re.cacheSignal=function(){return null},re.cloneElement=function(_,G,Q){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var J=V({},_.props),ue=_.key;if(G!=null)for(se in G.key!==void 0&&(ue=""+G.key),G)!ne.call(G,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&G.ref===void 0||(J[se]=G[se]);var se=arguments.length-2;if(se===1)J.children=Q;else if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(r){console.error(r)}}return u(),po.exports=Jg(),po.exports}var Bo=Ch(),vo={exports:{}},Si={},go={exports:{}},yo={};var sh;function $g(){return sh||(sh=1,(function(u){function r(R,L){var le=R.length;R.push(L);e:for(;0>>1,je=R[Ee];if(0>>1;Ee<_;){var G=2*(Ee+1)-1,Q=R[G],J=G+1,ue=R[J];if(0>m(Q,le))Jm(ue,Q)?(R[Ee]=ue,R[J]=le,Ee=J):(R[Ee]=Q,R[G]=le,Ee=G);else if(Jm(ue,le))R[Ee]=ue,R[J]=le,Ee=J;else break e}}return L}function m(R,L){var le=R.sortIndex-L.sortIndex;return le!==0?le:R.id-L.id}if(u.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;u.unstable_now=function(){return h.now()}}else{var S=Date,E=S.now();u.unstable_now=function(){return S.now()-E}}var j=[],y=[],p=1,M=null,O=3,Y=!1,H=!1,V=!1,X=!1,k=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function q(R){for(var L=f(y);L!==null;){if(L.callback===null)o(y);else if(L.startTime<=R)o(y),L.sortIndex=L.expirationTime,r(j,L);else break;L=f(y)}}function $(R){if(V=!1,q(R),!H)if(f(j)!==null)H=!0,W||(W=!0,xe());else{var L=f(y);L!==null&&Ye($,L.startTime-R)}}var W=!1,K=-1,ne=5,ee=-1;function Me(){return X?!0:!(u.unstable_now()-eeR&&Me());){var Ee=M.callback;if(typeof Ee=="function"){M.callback=null,O=M.priorityLevel;var je=Ee(M.expirationTime<=R);if(R=u.unstable_now(),typeof je=="function"){M.callback=je,q(R),L=!0;break t}M===f(j)&&o(j),q(R)}else o(j);M=f(j)}if(M!==null)L=!0;else{var _=f(y);_!==null&&Ye($,_.startTime-R),L=!1}}break e}finally{M=null,O=le,Y=!1}L=void 0}}finally{L?xe():W=!1}}}var xe;if(typeof w=="function")xe=function(){w(Ce)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,Ne=ce.port2;ce.port1.onmessage=Ce,xe=function(){Ne.postMessage(null)}}else xe=function(){k(Ce,0)};function Ye(R,L){K=k(function(){R(u.unstable_now())},L)}u.unstable_IdlePriority=5,u.unstable_ImmediatePriority=1,u.unstable_LowPriority=4,u.unstable_NormalPriority=3,u.unstable_Profiling=null,u.unstable_UserBlockingPriority=2,u.unstable_cancelCallback=function(R){R.callback=null},u.unstable_forceFrameRate=function(R){0>R||125Ee?(R.sortIndex=le,r(y,R),f(j)===null&&R===f(y)&&(V?(Z(K),K=-1):V=!0,Ye($,le-Ee))):(R.sortIndex=je,r(j,R),H||Y||(H=!0,W||(W=!0,xe()))),R},u.unstable_shouldYield=Me,u.unstable_wrapCallback=function(R){var L=O;return function(){var le=O;O=L;try{return R.apply(this,arguments)}finally{O=le}}}})(yo)),yo}var oh;function Fg(){return oh||(oh=1,go.exports=$g()),go.exports}var rh;function Wg(){if(rh)return Si;rh=1;var u=Fg(),r=Go(),f=Ch();function o(e){var t="https://react.dev/errors/"+e;if(1je||(e.current=Ee[je],Ee[je]=null,je--)}function Q(e,t){je++,Ee[je]=e.current,e.current=t}var J=_(null),ue=_(null),se=_(null),Se=_(null);function Be(e,t){switch(Q(se,t),Q(ue,e),Q(J,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?xm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=xm(t),e=jm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}G(J),Q(J,e)}function He(){G(J),G(ue),G(se)}function Tt(e){e.memoizedState!==null&&Q(Se,e);var t=J.current,l=jm(t,e.type);t!==l&&(Q(ue,e),Q(J,l))}function Wt(e){ue.current===e&&(G(J),G(ue)),Se.current===e&&(G(Se),pi._currentValue=le)}var ml,il;function ct(e){if(ml===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);ml=t&&t[1]||"",il=-1{throw TypeError(u)};var th=(u,r,f)=>r.has(u)||eh("Cannot "+f);var gt=(u,r,f)=>(th(u,r,"read from private field"),f?f.call(u):r.get(u)),lh=(u,r,f)=>r.has(u)?eh("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(u):r.set(u,f),po=(u,r,f,o)=>(th(u,r,"write to private field"),o?o.call(u,f):r.set(u,f),f);function Yg(u,r){for(var f=0;fo[m]})}}}return Object.freeze(Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}))}function Vg(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var vo={exports:{}},xi={};var ah;function Xg(){if(ah)return xi;ah=1;var u=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function f(o,m,h){var _=null;if(h!==void 0&&(_=""+h),m.key!==void 0&&(_=""+m.key),"key"in m){h={};for(var E in m)E!=="key"&&(h[E]=m[E])}else h=m;return m=h.ref,{$$typeof:u,type:o,key:_,ref:m!==void 0?m:null,props:h}}return xi.Fragment=r,xi.jsx=f,xi.jsxs=f,xi}var nh;function Qg(){return nh||(nh=1,vo.exports=Xg()),vo.exports}var c=Qg(),go={exports:{}},se={};var ih;function Zg(){if(ih)return se;ih=1;var u=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),_=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),O=Symbol.iterator;function Y(x){return x===null||typeof x!="object"?null:(x=O&&x[O]||x["@@iterator"],typeof x=="function"?x:null)}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},X=Object.assign,Z={};function L(x,U,K){this.props=x,this.context=U,this.refs=Z,this.updater=K||B}L.prototype.isReactComponent={},L.prototype.setState=function(x,U){if(typeof x!="object"&&typeof x!="function"&&x!=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,x,U,"setState")},L.prototype.forceUpdate=function(x){this.updater.enqueueForceUpdate(this,x,"forceUpdate")};function Q(){}Q.prototype=L.prototype;function k(x,U,K){this.props=x,this.context=U,this.refs=Z,this.updater=K||B}var H=k.prototype=new Q;H.constructor=k,X(H,L.prototype),H.isPureReactComponent=!0;var J=Array.isArray;function ee(){}var V={H:null,A:null,T:null,S:null},ue=Object.prototype.hasOwnProperty;function te(x,U,K){var $=K.ref;return{$$typeof:u,type:x,key:U,ref:$!==void 0?$:null,props:K}}function je(x,U){return te(x.type,U,x.props)}function Me(x){return typeof x=="object"&&x!==null&&x.$$typeof===u}function de(x){var U={"=":"=0",":":"=2"};return"$"+x.replace(/[=:]/g,function(K){return U[K]})}var me=/\/+/g;function Ne(x,U){return typeof x=="object"&&x!==null&&x.key!=null?de(""+x.key):U.toString(36)}function Fe(x){switch(x.status){case"fulfilled":return x.value;case"rejected":throw x.reason;default:switch(typeof x.status=="string"?x.then(ee,ee):(x.status="pending",x.then(function(U){x.status==="pending"&&(x.status="fulfilled",x.value=U)},function(U){x.status==="pending"&&(x.status="rejected",x.reason=U)})),x.status){case"fulfilled":return x.value;case"rejected":throw x.reason}}throw x}function R(x,U,K,$,ie){var oe=typeof x;(oe==="undefined"||oe==="boolean")&&(x=null);var he=!1;if(x===null)he=!0;else switch(oe){case"bigint":case"string":case"number":he=!0;break;case"object":switch(x.$$typeof){case u:case r:he=!0;break;case p:return he=x._init,R(he(x._payload),U,K,$,ie)}}if(he)return ie=ie(x),he=$===""?"."+Ne(x,0):$,J(ie)?(K="",he!=null&&(K=he.replace(me,"$&/")+"/"),R(ie,U,K,"",function(qt){return qt})):ie!=null&&(Me(ie)&&(ie=je(ie,K+(ie.key==null||x&&x.key===ie.key?"":(""+ie.key).replace(me,"$&/")+"/")+he)),U.push(ie)),1;he=0;var Ve=$===""?".":$+":";if(J(x))for(var ke=0;ke"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(r){console.error(r)}}return u(),yo.exports=Jg(),yo.exports}var qo=Eh(),bo={exports:{}},ji={},So={exports:{}},_o={};var oh;function $g(){return oh||(oh=1,(function(u){function r(R,q){var I=R.length;R.push(q);e:for(;0>>1,Ce=R[pe];if(0>>1;pem(K,I))$m(ie,K)?(R[pe]=ie,R[$]=I,pe=$):(R[pe]=K,R[U]=I,pe=U);else if($m(ie,I))R[pe]=ie,R[$]=I,pe=$;else break e}}return q}function m(R,q){var I=R.sortIndex-q.sortIndex;return I!==0?I:R.id-q.id}if(u.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;u.unstable_now=function(){return h.now()}}else{var _=Date,E=_.now();u.unstable_now=function(){return _.now()-E}}var j=[],y=[],p=1,M=null,O=3,Y=!1,B=!1,X=!1,Z=!1,L=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function H(R){for(var q=f(y);q!==null;){if(q.callback===null)o(y);else if(q.startTime<=R)o(y),q.sortIndex=q.expirationTime,r(j,q);else break;q=f(y)}}function J(R){if(X=!1,H(R),!B)if(f(j)!==null)B=!0,ee||(ee=!0,de());else{var q=f(y);q!==null&&Fe(J,q.startTime-R)}}var ee=!1,V=-1,ue=5,te=-1;function je(){return Z?!0:!(u.unstable_now()-teR&&je());){var pe=M.callback;if(typeof pe=="function"){M.callback=null,O=M.priorityLevel;var Ce=pe(M.expirationTime<=R);if(R=u.unstable_now(),typeof Ce=="function"){M.callback=Ce,H(R),q=!0;break t}M===f(j)&&o(j),H(R)}else o(j);M=f(j)}if(M!==null)q=!0;else{var x=f(y);x!==null&&Fe(J,x.startTime-R),q=!1}}break e}finally{M=null,O=I,Y=!1}q=void 0}}finally{q?de():ee=!1}}}var de;if(typeof k=="function")de=function(){k(Me)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,Ne=me.port2;me.port1.onmessage=Me,de=function(){Ne.postMessage(null)}}else de=function(){L(Me,0)};function Fe(R,q){V=L(function(){R(u.unstable_now())},q)}u.unstable_IdlePriority=5,u.unstable_ImmediatePriority=1,u.unstable_LowPriority=4,u.unstable_NormalPriority=3,u.unstable_Profiling=null,u.unstable_UserBlockingPriority=2,u.unstable_cancelCallback=function(R){R.callback=null},u.unstable_forceFrameRate=function(R){0>R||125pe?(R.sortIndex=I,r(y,R),f(j)===null&&R===f(y)&&(X?(Q(V),V=-1):X=!0,Fe(J,I-pe))):(R.sortIndex=Ce,r(j,R),B||Y||(B=!0,ee||(ee=!0,de()))),R},u.unstable_shouldYield=je,u.unstable_wrapCallback=function(R){var q=O;return function(){var I=O;O=q;try{return R.apply(this,arguments)}finally{O=I}}}})(_o)),_o}var rh;function Fg(){return rh||(rh=1,So.exports=$g()),So.exports}var fh;function Wg(){if(fh)return ji;fh=1;var u=Fg(),r=ko(),f=Eh();function o(e){var t="https://react.dev/errors/"+e;if(1Ce||(e.current=pe[Ce],pe[Ce]=null,Ce--)}function K(e,t){Ce++,pe[Ce]=e.current,e.current=t}var $=x(null),ie=x(null),oe=x(null),he=x(null);function Ve(e,t){switch(K(oe,t),K(ie,e),K($,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?jm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=jm(t),e=Mm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U($),K($,e)}function ke(){U($),U(ie),U(oe)}function qt(e){e.memoizedState!==null&&K(he,e);var t=$.current,l=Mm(t,e.type);t!==l&&(K(ie,e),K($,l))}function Lt(e){ie.current===e&&(U($),U(ie)),he.current===e&&(U(he),yi._currentValue=I)}var st,pl;function ht(e){if(st===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);st=t&&t[1]||"",pl=-1)":-1n||v[a]!==A[n]){var D=` -`+v[a].replace(" at new "," at ");return e.displayName&&D.includes("")&&(D=D.replace("",e.displayName)),D}while(1<=a&&0<=n);break}}}finally{ul=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?ct(l):""}function fa(e,t){switch(e.tag){case 26:case 27:case 5:return ct(e.type);case 16:return ct("Lazy");case 13:return e.child!==t&&t!==null?ct("Suspense Fallback"):ct("Suspense");case 19:return ct("SuspenseList");case 0:case 15:return P(e.type,!1);case 11:return P(e.type.render,!1);case 1:return P(e.type,!0);case 31:return ct("Activity");default:return""}}function hl(e){try{var t="",l=null;do t+=fa(e,l),l=e,e=e.return;while(e);return t}catch(a){return` +`+v[a].replace(" at new "," at ");return e.displayName&&D.includes("")&&(D=D.replace("",e.displayName)),D}while(1<=a&&0<=n);break}}}finally{ga=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?ht(l):""}function ql(e,t){switch(e.tag){case 26:case 27:case 5:return ht(e.type);case 16:return ht("Lazy");case 13:return e.child!==t&&t!==null?ht("Suspense Fallback"):ht("Suspense");case 19:return ht("SuspenseList");case 0:case 15:return at(e.type,!1);case 11:return at(e.type.render,!1);case 1:return at(e.type,!0);case 31:return ht("Activity");default:return""}}function Yt(e){try{var t="",l=null;do t+=ql(e,l),l=e,e=e.return;while(e);return t}catch(a){return` Error generating stack: `+a.message+` -`+a.stack}}var Ht=Object.prototype.hasOwnProperty,da=u.unstable_scheduleCallback,ma=u.unstable_cancelCallback,F=u.unstable_shouldYield,oe=u.unstable_requestPaint,me=u.unstable_now,mt=u.unstable_getCurrentPriorityLevel,Je=u.unstable_ImmediatePriority,cl=u.unstable_UserBlockingPriority,kt=u.unstable_NormalPriority,pl=u.unstable_LowPriority,ha=u.unstable_IdlePriority,Ai=u.log,zi=u.unstable_setDisableYieldValue,Bl=null,gt=null;function sl(e){if(typeof Ai=="function"&&zi(e),gt&&typeof gt.setStrictMode=="function")try{gt.setStrictMode(Bl,e)}catch{}}var ht=Math.clz32?Math.clz32:Iu,Fu=Math.log,Wu=Math.LN2;function Iu(e){return e>>>=0,e===0?32:31-(Fu(e)/Wu|0)|0}var pa=256,Ga=262144,Ba=4194304;function x(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function fe(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var n=0,i=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var d=a&134217727;return d!==0?(a=d&~i,a!==0?n=x(a):(s&=d,s!==0?n=x(s):l||(l=d&~e,l!==0&&(n=x(l))))):(d=a&~i,d!==0?n=x(d):s!==0?n=x(s):l||(l=a&~e,l!==0&&(n=x(l)))),n===0?0:t!==0&&t!==n&&(t&i)===0&&(i=n&-n,l=t&-t,i>=l||i===32&&(l&4194048)!==0)?t:n}function pe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ve(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Ni(){var e=Ba;return Ba<<=1,(Ba&62914560)===0&&(Ba=4194304),e}function Pu(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function zn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Np(e,t,l,a,n,i){var s=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var d=e.entanglements,v=e.expirationTimes,A=e.hiddenUpdates;for(l=s&~l;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Gp=/[\n"\\]/g;function Lt(e){return e.replace(Gp,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ic(e,t,l,a,n,i,s,d){e.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.type=s:e.removeAttribute("type"),t!=null?s==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+qt(t)):e.value!==""+qt(t)&&(e.value=""+qt(t)):s!=="submit"&&s!=="reset"||e.removeAttribute("value"),t!=null?uc(e,s,qt(t)):l!=null?uc(e,s,qt(l)):a!=null&&e.removeAttribute("value"),n==null&&i!=null&&(e.defaultChecked=!!i),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.name=""+qt(d):e.removeAttribute("name")}function pr(e,t,l,a,n,i,s,d){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||l!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){nc(e);return}l=l!=null?""+qt(l):"",t=t!=null?""+qt(t):l,d||t===e.value||(e.value=t),e.defaultValue=t}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=d?e.checked:!!a,e.defaultChecked=!!a,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.name=s),nc(e)}function uc(e,t,l){t==="number"&&Di(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Va(e,t,l,a){if(e=e.options,t){t={};for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fc=!1;if(yl)try{var Dn={};Object.defineProperty(Dn,"passive",{get:function(){fc=!0}}),window.addEventListener("test",Dn,Dn),window.removeEventListener("test",Dn,Dn)}catch{fc=!1}var kl=null,dc=null,Ui=null;function xr(){if(Ui)return Ui;var e,t=dc,l=t.length,a,n="value"in kl?kl.value:kl.textContent,i=n.length;for(e=0;e=Gn),Ar=" ",zr=!1;function Nr(e,t){switch(e){case"keyup":return rv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rr(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ka=!1;function dv(e,t){switch(e){case"compositionend":return Rr(t);case"keypress":return t.which!==32?null:(zr=!0,Ar);case"textInput":return e=t.data,e===Ar&&zr?null:e;default:return null}}function mv(e,t){if(Ka)return e==="compositionend"||!gc&&Nr(e,t)?(e=xr(),Ui=dc=kl=null,Ka=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=kr(l)}}function Lr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Lr(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Yr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Di(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=Di(e.document)}return t}function Sc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var _v=yl&&"documentMode"in document&&11>=document.documentMode,Ja=null,_c=null,qn=null,xc=!1;function Vr(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;xc||Ja==null||Ja!==Di(a)||(a=Ja,"selectionStart"in a&&Sc(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),qn&&kn(qn,a)||(qn=a,a=Au(_c,"onSelect"),0>=s,n-=s,ol=1<<32-ht(t)+n|l<he?(be=te,te=null):be=te.sibling;var Ae=z(C,te,T[he],U);if(Ae===null){te===null&&(te=be);break}e&&te&&Ae.alternate===null&&t(C,te),b=i(Ae,b,he),Te===null?ae=Ae:Te.sibling=Ae,Te=Ae,te=be}if(he===T.length)return l(C,te),_e&&Sl(C,he),ae;if(te===null){for(;hehe?(be=te,te=null):be=te.sibling;var ca=z(C,te,Ae.value,U);if(ca===null){te===null&&(te=be);break}e&&te&&ca.alternate===null&&t(C,te),b=i(ca,b,he),Te===null?ae=ca:Te.sibling=ca,Te=ca,te=be}if(Ae.done)return l(C,te),_e&&Sl(C,he),ae;if(te===null){for(;!Ae.done;he++,Ae=T.next())Ae=B(C,Ae.value,U),Ae!==null&&(b=i(Ae,b,he),Te===null?ae=Ae:Te.sibling=Ae,Te=Ae);return _e&&Sl(C,he),ae}for(te=a(te);!Ae.done;he++,Ae=T.next())Ae=N(te,C,he,Ae.value,U),Ae!==null&&(e&&Ae.alternate!==null&&te.delete(Ae.key===null?he:Ae.key),b=i(Ae,b,he),Te===null?ae=Ae:Te.sibling=Ae,Te=Ae);return e&&te.forEach(function(Lg){return t(C,Lg)}),_e&&Sl(C,he),ae}function Ue(C,b,T,U){if(typeof T=="object"&&T!==null&&T.type===V&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case Y:e:{for(var ae=T.key;b!==null;){if(b.key===ae){if(ae=T.type,ae===V){if(b.tag===7){l(C,b.sibling),U=n(b,T.props.children),U.return=C,C=U;break e}}else if(b.elementType===ae||typeof ae=="object"&&ae!==null&&ae.$$typeof===ne&&Ea(ae)===b.type){l(C,b.sibling),U=n(b,T.props),Zn(U,T),U.return=C,C=U;break e}l(C,b);break}else t(C,b);b=b.sibling}T.type===V?(U=_a(T.props.children,C.mode,U,T.key),U.return=C,C=U):(U=Qi(T.type,T.key,T.props,null,C.mode,U),Zn(U,T),U.return=C,C=U)}return s(C);case H:e:{for(ae=T.key;b!==null;){if(b.key===ae)if(b.tag===4&&b.stateNode.containerInfo===T.containerInfo&&b.stateNode.implementation===T.implementation){l(C,b.sibling),U=n(b,T.children||[]),U.return=C,C=U;break e}else{l(C,b);break}else t(C,b);b=b.sibling}U=zc(T,C.mode,U),U.return=C,C=U}return s(C);case ne:return T=Ea(T),Ue(C,b,T,U)}if(Ye(T))return I(C,b,T,U);if(xe(T)){if(ae=xe(T),typeof ae!="function")throw Error(o(150));return T=ae.call(T),ie(C,b,T,U)}if(typeof T.then=="function")return Ue(C,b,Ii(T),U);if(T.$$typeof===w)return Ue(C,b,Ji(C,T),U);Pi(C,T)}return typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint"?(T=""+T,b!==null&&b.tag===6?(l(C,b.sibling),U=n(b,T),U.return=C,C=U):(l(C,b),U=Ac(T,C.mode,U),U.return=C,C=U),s(C)):l(C,b)}return function(C,b,T,U){try{Qn=0;var ae=Ue(C,b,T,U);return un=null,ae}catch(te){if(te===nn||te===Fi)throw te;var Te=zt(29,te,null,C.mode);return Te.lanes=U,Te.return=C,Te}}}var Aa=mf(!0),hf=mf(!1),Xl=!1;function Lc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Yc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ql(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Zl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ze&2)!==0){var n=a.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),a.pending=t,t=Xi(e),Fr(e,null,l),t}return Vi(e,a,t,l),Xi(e)}function Kn(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,nr(e,l)}}function Vc(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var n=null,i=null;if(l=l.firstBaseUpdate,l!==null){do{var s={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};i===null?n=i=s:i=i.next=s,l=l.next}while(l!==null);i===null?n=i=t:i=i.next=t}else n=i=t;l={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:i,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Xc=!1;function Jn(){if(Xc){var e=an;if(e!==null)throw e}}function $n(e,t,l,a){Xc=!1;var n=e.updateQueue;Xl=!1;var i=n.firstBaseUpdate,s=n.lastBaseUpdate,d=n.shared.pending;if(d!==null){n.shared.pending=null;var v=d,A=v.next;v.next=null,s===null?i=A:s.next=A,s=v;var D=e.alternate;D!==null&&(D=D.updateQueue,d=D.lastBaseUpdate,d!==s&&(d===null?D.firstBaseUpdate=A:d.next=A,D.lastBaseUpdate=v))}if(i!==null){var B=n.baseState;s=0,D=A=v=null,d=i;do{var z=d.lane&-536870913,N=z!==d.lane;if(N?(ye&z)===z:(a&z)===z){z!==0&&z===ln&&(Xc=!0),D!==null&&(D=D.next={lane:0,tag:d.tag,payload:d.payload,callback:null,next:null});e:{var I=e,ie=d;z=t;var Ue=l;switch(ie.tag){case 1:if(I=ie.payload,typeof I=="function"){B=I.call(Ue,B,z);break e}B=I;break e;case 3:I.flags=I.flags&-65537|128;case 0:if(I=ie.payload,z=typeof I=="function"?I.call(Ue,B,z):I,z==null)break e;B=M({},B,z);break e;case 2:Xl=!0}}z=d.callback,z!==null&&(e.flags|=64,N&&(e.flags|=8192),N=n.callbacks,N===null?n.callbacks=[z]:N.push(z))}else N={lane:z,tag:d.tag,payload:d.payload,callback:d.callback,next:null},D===null?(A=D=N,v=B):D=D.next=N,s|=z;if(d=d.next,d===null){if(d=n.shared.pending,d===null)break;N=d,d=N.next,N.next=null,n.lastBaseUpdate=N,n.shared.pending=null}}while(!0);D===null&&(v=B),n.baseState=v,n.firstBaseUpdate=A,n.lastBaseUpdate=D,i===null&&(n.shared.lanes=0),Wl|=s,e.lanes=s,e.memoizedState=B}}function pf(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function vf(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;ei?i:8;var s=R.T,d={};R.T=d,os(e,!1,t,l);try{var v=n(),A=R.S;if(A!==null&&A(d,v),v!==null&&typeof v=="object"&&typeof v.then=="function"){var D=Nv(v,a);In(e,t,D,wt(e))}else In(e,t,a,wt(e))}catch(B){In(e,t,{then:function(){},status:"rejected",reason:B},wt())}finally{L.p=i,s!==null&&d.types!==null&&(s.types=d.types),R.T=s}}function Gv(){}function cs(e,t,l,a){if(e.tag!==5)throw Error(o(476));var n=Jf(e).queue;Kf(e,n,t,le,l===null?Gv:function(){return $f(e),l(a)})}function Jf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ml,lastRenderedState:le},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ml,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function $f(e){var t=Jf(e);t.next===null&&(t=e.alternate.memoizedState),In(e,t.next.queue,{},wt())}function ss(){return rt(pi)}function Ff(){return Fe().memoizedState}function Wf(){return Fe().memoizedState}function Bv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=wt();e=Ql(l);var a=Zl(t,e,l);a!==null&&(Ct(a,t,l),Kn(a,t,l)),t={cache:Bc()},e.payload=t;return}t=t.return}}function Hv(e,t,l){var a=wt();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ou(e)?Pf(t,l):(l=Ec(e,t,l,a),l!==null&&(Ct(l,e,a),ed(l,t,a)))}function If(e,t,l){var a=wt();In(e,t,l,a)}function In(e,t,l,a){var n={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ou(e))Pf(t,n);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,d=i(s,l);if(n.hasEagerState=!0,n.eagerState=d,At(d,s))return Vi(e,t,n,0),Ge===null&&Yi(),!1}catch{}if(l=Ec(e,t,n,a),l!==null)return Ct(l,e,a),ed(l,t,a),!0}return!1}function os(e,t,l,a){if(a={lane:2,revertLane:Ls(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ou(e)){if(t)throw Error(o(479))}else t=Ec(e,l,a,2),t!==null&&Ct(t,e,2)}function ou(e){var t=e.alternate;return e===de||t!==null&&t===de}function Pf(e,t){sn=lu=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function ed(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,nr(e,l)}}var Pn={readContext:rt,use:iu,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useLayoutEffect:Ze,useInsertionEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useSyncExternalStore:Ze,useId:Ze,useHostTransitionStatus:Ze,useFormState:Ze,useActionState:Ze,useOptimistic:Ze,useMemoCache:Ze,useCacheRefresh:Ze};Pn.useEffectEvent=Ze;var td={readContext:rt,use:iu,useCallback:function(e,t){return yt().memoizedState=[e,t===void 0?null:t],e},useContext:rt,useEffect:Hf,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,cu(4194308,4,Yf.bind(null,t,e),l)},useLayoutEffect:function(e,t){return cu(4194308,4,e,t)},useInsertionEffect:function(e,t){cu(4,2,e,t)},useMemo:function(e,t){var l=yt();t=t===void 0?null:t;var a=e();if(za){sl(!0);try{e()}finally{sl(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=yt();if(l!==void 0){var n=l(t);if(za){sl(!0);try{l(t)}finally{sl(!1)}}}else n=t;return a.memoizedState=a.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},a.queue=e,e=e.dispatch=Hv.bind(null,de,e),[a.memoizedState,e]},useRef:function(e){var t=yt();return e={current:e},t.memoizedState=e},useState:function(e){e=ls(e);var t=e.queue,l=If.bind(null,de,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:is,useDeferredValue:function(e,t){var l=yt();return us(l,e,t)},useTransition:function(){var e=ls(!1);return e=Kf.bind(null,de,e.queue,!0,!1),yt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=de,n=yt();if(_e){if(l===void 0)throw Error(o(407));l=l()}else{if(l=t(),Ge===null)throw Error(o(349));(ye&127)!==0||xf(a,t,l)}n.memoizedState=l;var i={value:l,getSnapshot:t};return n.queue=i,Hf(Mf.bind(null,a,i,e),[e]),a.flags|=2048,rn(9,{destroy:void 0},jf.bind(null,a,i,l,t),null),l},useId:function(){var e=yt(),t=Ge.identifierPrefix;if(_e){var l=rl,a=ol;l=(a&~(1<<32-ht(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=au++,0<\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof a.is=="string"?s.createElement("select",{is:a.is}):s.createElement("select"),a.multiple?i.multiple=!0:a.size&&(i.size=a.size);break;default:i=typeof a.is=="string"?s.createElement(n,{is:a.is}):s.createElement(n)}}i[st]=t,i[bt]=a;e:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)i.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=i;e:switch(dt(i,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&El(t)}}return Le(t),js(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&El(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(o(166));if(e=se.current,en(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,n=ot,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}e[st]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||Sm(e.nodeValue,l)),e||Yl(t,!0)}else e=zu(e).createTextNode(a),e[st]=t,t.stateNode=e}return Le(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=en(t),l!==null){if(e===null){if(!a)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[st]=t}else xa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Le(t),e=!1}else l=Dc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Rt(t),t):(Rt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Le(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=en(t),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(o(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(o(317));n[st]=t}else xa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Le(t),n=!1}else n=Dc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(Rt(t),t):(Rt(t),null)}return Rt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),i=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(i=a.memoizedState.cachePool.pool),i!==n&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),hu(t,t.updateQueue),Le(t),null);case 4:return He(),e===null&&Qs(t.stateNode.containerInfo),Le(t),null;case 10:return xl(t.type),Le(t),null;case 19:if(G($e),a=t.memoizedState,a===null)return Le(t),null;if(n=(t.flags&128)!==0,i=a.rendering,i===null)if(n)ti(a,!1);else{if(Ke!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=tu(e),i!==null){for(t.flags|=128,ti(a,!1),e=i.updateQueue,t.updateQueue=e,hu(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Wr(l,e),l=l.sibling;return Q($e,$e.current&1|2),_e&&Sl(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&me()>bu&&(t.flags|=128,n=!0,ti(a,!1),t.lanes=4194304)}else{if(!n)if(e=tu(i),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,hu(t,e),ti(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!_e)return Le(t),null}else 2*me()-a.renderingStartTime>bu&&l!==536870912&&(t.flags|=128,n=!0,ti(a,!1),t.lanes=4194304);a.isBackwards?(i.sibling=t.child,t.child=i):(e=a.last,e!==null?e.sibling=i:t.child=i,a.last=i)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=me(),e.sibling=null,l=$e.current,Q($e,n?l&1|2:l&1),_e&&Sl(t,a.treeForkCount),e):(Le(t),null);case 22:case 23:return Rt(t),Zc(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(Le(t),t.subtreeFlags&6&&(t.flags|=8192)):Le(t),l=t.updateQueue,l!==null&&hu(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&G(Ca),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),xl(We),Le(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Vv(e,t){switch(Rc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xl(We),He(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Wt(t),null;case 31:if(t.memoizedState!==null){if(Rt(t),t.alternate===null)throw Error(o(340));xa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Rt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));xa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return G($e),null;case 4:return He(),null;case 10:return xl(t.type),null;case 22:case 23:return Rt(t),Zc(),e!==null&&G(Ca),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return xl(We),null;case 25:return null;default:return null}}function Cd(e,t){switch(Rc(t),t.tag){case 3:xl(We),He();break;case 26:case 27:case 5:Wt(t);break;case 4:He();break;case 31:t.memoizedState!==null&&Rt(t);break;case 13:Rt(t);break;case 19:G($e);break;case 10:xl(t.type);break;case 22:case 23:Rt(t),Zc(),e!==null&&G(Ca);break;case 24:xl(We)}}function li(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var n=a.next;l=n;do{if((l.tag&e)===e){a=void 0;var i=l.create,s=l.inst;a=i(),s.destroy=a}l=l.next}while(l!==n)}}catch(d){Oe(t,t.return,d)}}function $l(e,t,l){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var i=n.next;a=i;do{if((a.tag&e)===e){var s=a.inst,d=s.destroy;if(d!==void 0){s.destroy=void 0,n=t;var v=l,A=d;try{A()}catch(D){Oe(n,v,D)}}}a=a.next}while(a!==i)}}catch(D){Oe(t,t.return,D)}}function Ed(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{vf(t,l)}catch(a){Oe(e,e.return,a)}}}function Td(e,t,l){l.props=Na(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){Oe(e,t,a)}}function ai(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(n){Oe(e,t,n)}}function fl(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(n){Oe(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(n){Oe(e,t,n)}else l.current=null}function Ad(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(n){Oe(e,e.return,n)}}function Ms(e,t,l){try{var a=e.stateNode;fg(a,e.type,l,t),a[bt]=t}catch(n){Oe(e,e.return,n)}}function zd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&la(e.type)||e.tag===4}function Cs(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||zd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&la(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Es(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=gl));else if(a!==4&&(a===27&&la(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Es(e,t,l),e=e.sibling;e!==null;)Es(e,t,l),e=e.sibling}function pu(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&la(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(pu(e,t,l),e=e.sibling;e!==null;)pu(e,t,l),e=e.sibling}function Nd(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);dt(t,a,l),t[st]=e,t[bt]=l}catch(i){Oe(e,e.return,i)}}var Tl=!1,et=!1,Ts=!1,Rd=typeof WeakSet=="function"?WeakSet:Set,nt=null;function Xv(e,t){if(e=e.containerInfo,Js=Gu,e=Yr(e),Sc(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var n=a.anchorOffset,i=a.focusNode;a=a.focusOffset;try{l.nodeType,i.nodeType}catch{l=null;break e}var s=0,d=-1,v=-1,A=0,D=0,B=e,z=null;t:for(;;){for(var N;B!==l||n!==0&&B.nodeType!==3||(d=s+n),B!==i||a!==0&&B.nodeType!==3||(v=s+a),B.nodeType===3&&(s+=B.nodeValue.length),(N=B.firstChild)!==null;)z=B,B=N;for(;;){if(B===e)break t;if(z===l&&++A===n&&(d=s),z===i&&++D===a&&(v=s),(N=B.nextSibling)!==null)break;B=z,z=B.parentNode}B=N}l=d===-1||v===-1?null:{start:d,end:v}}else l=null}l=l||{start:0,end:0}}else l=null;for($s={focusedElem:e,selectionRange:l},Gu=!1,nt=t;nt!==null;)if(t=nt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,nt=e;else for(;nt!==null;){switch(t=nt,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l title"))),dt(i,a,l),i[st]=e,at(i),a=i;break e;case"link":var s=Bm("link","href",n).get(a+(l.href||""));if(s){for(var d=0;dUe&&(s=Ue,Ue=ie,ie=s);var C=qr(d,ie),b=qr(d,Ue);if(C&&b&&(N.rangeCount!==1||N.anchorNode!==C.node||N.anchorOffset!==C.offset||N.focusNode!==b.node||N.focusOffset!==b.offset)){var T=B.createRange();T.setStart(C.node,C.offset),N.removeAllRanges(),ie>Ue?(N.addRange(T),N.extend(b.node,b.offset)):(T.setEnd(b.node,b.offset),N.addRange(T))}}}}for(B=[],N=d;N=N.parentNode;)N.nodeType===1&&B.push({element:N,left:N.scrollLeft,top:N.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;dl?32:l,R.T=null,l=ws,ws=null;var i=Pl,s=Ol;if(lt=0,pn=Pl=null,Ol=0,(ze&6)!==0)throw Error(o(331));var d=ze;if(ze|=4,Yd(i.current),kd(i,i.current,s,l),ze=d,oi(0,!1),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(Bl,i)}catch{}return!0}finally{L.p=n,R.T=a,um(e,t)}}function sm(e,t,l){t=Vt(l,t),t=ms(e.stateNode,t,2),e=Zl(e,t,2),e!==null&&(zn(e,2),dl(e))}function Oe(e,t,l){if(e.tag===3)sm(e,e,l);else for(;t!==null;){if(t.tag===3){sm(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Il===null||!Il.has(a))){e=Vt(l,e),l=od(2),a=Zl(t,l,2),a!==null&&(rd(l,a,t,e),zn(a,2),dl(a));break}}t=t.return}}function Hs(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new Kv;var n=new Set;a.set(t,n)}else n=a.get(t),n===void 0&&(n=new Set,a.set(t,n));n.has(l)||(Ns=!0,n.add(l),e=Iv.bind(null,e,t,l),t.then(e,e))}function Iv(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Ge===e&&(ye&l)===l&&(Ke===4||Ke===3&&(ye&62914560)===ye&&300>me()-yu?(ze&2)===0&&vn(e,0):Rs|=l,hn===ye&&(hn=0)),dl(e)}function om(e,t){t===0&&(t=Ni()),e=Sa(e,t),e!==null&&(zn(e,t),dl(e))}function Pv(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),om(e,l)}function eg(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,n=e.memoizedState;n!==null&&(l=n.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(o(314))}a!==null&&a.delete(t),om(e,l)}function tg(e,t){return da(e,t)}var Cu=null,yn=null,ks=!1,Eu=!1,qs=!1,ta=0;function dl(e){e!==yn&&e.next===null&&(yn===null?Cu=yn=e:yn=yn.next=e),Eu=!0,ks||(ks=!0,ag())}function oi(e,t){if(!qs&&Eu){qs=!0;do for(var l=!1,a=Cu;a!==null;){if(e!==0){var n=a.pendingLanes;if(n===0)var i=0;else{var s=a.suspendedLanes,d=a.pingedLanes;i=(1<<31-ht(42|e)+1)-1,i&=n&~(s&~d),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(l=!0,mm(a,i))}else i=ye,i=fe(a,a===Ge?i:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(i&3)===0||pe(a,i)||(l=!0,mm(a,i));a=a.next}while(l);qs=!1}}function lg(){rm()}function rm(){Eu=ks=!1;var e=0;ta!==0&&mg()&&(e=ta);for(var t=me(),l=null,a=Cu;a!==null;){var n=a.next,i=fm(a,t);i===0?(a.next=null,l===null?Cu=n:l.next=n,n===null&&(yn=l)):(l=a,(e!==0||(i&3)!==0)&&(Eu=!0)),a=n}lt!==0&<!==5||oi(e),ta!==0&&(ta=0)}function fm(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,n=e.expirationTimes,i=e.pendingLanes&-62914561;0d)break;var D=v.transferSize,B=v.initiatorType;D&&_m(B)&&(v=v.responseEnd,s+=D*(v"u"?null:document;function Dm(e,t,l){var a=bn;if(a&&typeof t=="string"&&t){var n=Lt(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof l=="string"&&(n+='[crossorigin="'+l+'"]'),Om.has(n)||(Om.add(n),e={rel:e,crossOrigin:l,href:t},a.querySelector(n)===null&&(t=a.createElement("link"),dt(t,"link",e),at(t),a.head.appendChild(t)))}}function xg(e){Dl.D(e),Dm("dns-prefetch",e,null)}function jg(e,t){Dl.C(e,t),Dm("preconnect",e,t)}function Mg(e,t,l){Dl.L(e,t,l);var a=bn;if(a&&e&&t){var n='link[rel="preload"][as="'+Lt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(n+='[imagesrcset="'+Lt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(n+='[imagesizes="'+Lt(l.imageSizes)+'"]')):n+='[href="'+Lt(e)+'"]';var i=n;switch(t){case"style":i=Sn(e);break;case"script":i=_n(e)}$t.has(i)||(e=M({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),$t.set(i,e),a.querySelector(n)!==null||t==="style"&&a.querySelector(mi(i))||t==="script"&&a.querySelector(hi(i))||(t=a.createElement("link"),dt(t,"link",e),at(t),a.head.appendChild(t)))}}function Cg(e,t){Dl.m(e,t);var l=bn;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+Lt(a)+'"][href="'+Lt(e)+'"]',i=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=_n(e)}if(!$t.has(i)&&(e=M({rel:"modulepreload",href:e},t),$t.set(i,e),l.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(hi(i)))return}a=l.createElement("link"),dt(a,"link",e),at(a),l.head.appendChild(a)}}}function Eg(e,t,l){Dl.S(e,t,l);var a=bn;if(a&&e){var n=La(a).hoistableStyles,i=Sn(e);t=t||"default";var s=n.get(i);if(!s){var d={loading:0,preload:null};if(s=a.querySelector(mi(i)))d.loading=5;else{e=M({rel:"stylesheet",href:e,"data-precedence":t},l),(l=$t.get(i))&&lo(e,l);var v=s=a.createElement("link");at(v),dt(v,"link",e),v._p=new Promise(function(A,D){v.onload=A,v.onerror=D}),v.addEventListener("load",function(){d.loading|=1}),v.addEventListener("error",function(){d.loading|=2}),d.loading|=4,Ru(s,t,a)}s={type:"stylesheet",instance:s,count:1,state:d},n.set(i,s)}}}function Tg(e,t){Dl.X(e,t);var l=bn;if(l&&e){var a=La(l).hoistableScripts,n=_n(e),i=a.get(n);i||(i=l.querySelector(hi(n)),i||(e=M({src:e,async:!0},t),(t=$t.get(n))&&ao(e,t),i=l.createElement("script"),at(i),dt(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},a.set(n,i))}}function Ag(e,t){Dl.M(e,t);var l=bn;if(l&&e){var a=La(l).hoistableScripts,n=_n(e),i=a.get(n);i||(i=l.querySelector(hi(n)),i||(e=M({src:e,async:!0,type:"module"},t),(t=$t.get(n))&&ao(e,t),i=l.createElement("script"),at(i),dt(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},a.set(n,i))}}function wm(e,t,l,a){var n=(n=se.current)?Nu(n):null;if(!n)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Sn(l.href),l=La(n).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Sn(l.href);var i=La(n).hoistableStyles,s=i.get(e);if(s||(n=n.ownerDocument||n,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,s),(i=n.querySelector(mi(e)))&&!i._p&&(s.instance=i,s.state.loading=5),$t.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},$t.set(e,l),i||zg(n,e,l,s.state))),t&&a===null)throw Error(o(528,""));return s}if(t&&a!==null)throw Error(o(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=_n(l),l=La(n).hoistableScripts,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Sn(e){return'href="'+Lt(e)+'"'}function mi(e){return'link[rel="stylesheet"]['+e+"]"}function Um(e){return M({},e,{"data-precedence":e.precedence,precedence:null})}function zg(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),dt(t,"link",l),at(t),e.head.appendChild(t))}function _n(e){return'[src="'+Lt(e)+'"]'}function hi(e){return"script[async]"+e}function Gm(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Lt(l.href)+'"]');if(a)return t.instance=a,at(a),a;var n=M({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),at(a),dt(a,"style",n),Ru(a,l.precedence,e),t.instance=a;case"stylesheet":n=Sn(l.href);var i=e.querySelector(mi(n));if(i)return t.state.loading|=4,t.instance=i,at(i),i;a=Um(l),(n=$t.get(n))&&lo(a,n),i=(e.ownerDocument||e).createElement("link"),at(i);var s=i;return s._p=new Promise(function(d,v){s.onload=d,s.onerror=v}),dt(i,"link",a),t.state.loading|=4,Ru(i,l.precedence,e),t.instance=i;case"script":return i=_n(l.src),(n=e.querySelector(hi(i)))?(t.instance=n,at(n),n):(a=l,(n=$t.get(i))&&(a=M({},l),ao(a,n)),e=e.ownerDocument||e,n=e.createElement("script"),at(n),dt(n,"link",a),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Ru(a,l.precedence,e));return t.instance}function Ru(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,i=n,s=0;s title"):null)}function Ng(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function km(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Rg(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var n=Sn(a.href),i=t.querySelector(mi(n));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Du.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=i,at(i);return}i=t.ownerDocument||t,a=Um(a),(n=$t.get(n))&&lo(a,n),i=i.createElement("link"),at(i);var s=i;s._p=new Promise(function(d,v){s.onload=d,s.onerror=v}),dt(i,"link",a),l.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Du.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var no=0;function Og(e,t){return e.stylesheets&&e.count===0&&Uu(e,e.stylesheets),0no?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function Du(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Uu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var wu=null;function Uu(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,wu=new Map,t.forEach(Dg,e),wu=null,Du.call(e))}function Dg(e,t){if(!(t.state.loading&4)){var l=wu.get(e);if(l)var a=l.get(null);else{l=new Map,wu.set(e,l);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(r){console.error(r)}}return u(),vo.exports=Wg(),vo.exports}var Pg=Ig(),ey=Object.defineProperty,Tn=(u,r)=>ey(u,"name",{value:r,configurable:!0}),Eh=!!(typeof window<"u"&&window.document&&window.document.createElement);function Bt(u,r,{checkForDefaultPrevented:f=!0}={}){return Tn(function(m){if(u?.(m),f===!1||!m||!m.defaultPrevented)return r?.(m)},"handleEvent")}Tn(Bt,"composeEventHandlers");function ty(u){if(!Eh)throw new Error("Cannot access window outside of the DOM");return u?.ownerDocument?.defaultView??window}Tn(ty,"getOwnerWindow");function Eo(u){if(!Eh)throw new Error("Cannot access document outside of the DOM");return u?.ownerDocument??document}Tn(Eo,"getOwnerDocument");function Th(u,r=!1){const{activeElement:f}=Eo(u);if(!f?.nodeName)return null;if(Ah(f)&&f.contentDocument)return Th(f.contentDocument.body,r);if(r){const o=f.getAttribute("aria-activedescendant");if(o){const m=Eo(f).getElementById(o);if(m)return m}}return f}Tn(Th,"getActiveElement");function Ah(u){return u.tagName==="IFRAME"}Tn(Ah,"isFrame");var ly=Object.defineProperty,Ft=(u,r)=>ly(u,"name",{value:r,configurable:!0});function ay(u,r){const f=g.createContext(r);f.displayName=u+"Context";const o=Ft(h=>{const{children:S,...E}=h,j=g.useMemo(()=>E,Object.values(E));return c.jsx(f.Provider,{value:j,children:S})},"Provider");o.displayName=u+"Provider";function m(h,S={}){const{optional:E=!1}=S,j=g.useContext(f);if(j)return j;if(r!==void 0)return r;if(!E)throw new Error(`\`${h}\` must be used within \`${u}\``)}return Ft(m,"useContext"),[o,m]}Ft(ay,"createContext");function ra(u,r=[]){let f=[];function o(h,S){const E=g.createContext(S);E.displayName=h+"Context";const j=f.length;f=[...f,S];const y=Ft(M=>{const{scope:O,children:Y,...H}=M,V=O?.[u]?.[j]||E,X=g.useMemo(()=>H,Object.values(H));return c.jsx(V.Provider,{value:X,children:Y})},"Provider");y.displayName=h+"Provider";function p(M,O,Y={}){const{optional:H=!1}=Y,V=O?.[u]?.[j]||E,X=g.useContext(V);if(X)return X;if(S!==void 0)return S;if(!H)throw new Error(`\`${M}\` must be used within \`${h}\``)}return Ft(p,"useContext"),[y,p]}Ft(o,"createContext");const m=Ft(()=>{const h=f.map(S=>g.createContext(S));return Ft(function(E){const j=E?.[u]||h;return g.useMemo(()=>({[`__scope${u}`]:{...E,[u]:j}}),[E,j])},"useScope")},"createScope");return m.scopeName=u,[o,zh(m,...r)]}Ft(ra,"createContextScope");function zh(...u){const r=u[0];if(u.length===1)return r;const f=Ft(()=>{const o=u.map(m=>({useScope:m(),scopeName:m.scopeName}));return Ft(function(h){const S=o.reduce((E,{useScope:j,scopeName:y})=>{const M=j(h)[`__scope${y}`];return{...E,...M}},{});return g.useMemo(()=>({[`__scope${r.scopeName}`]:S}),[S])},"useComposedScopes")},"createScope");return f.scopeName=r.scopeName,f}Ft(zh,"composeContextScopes");var sa=globalThis?.document?g.useLayoutEffect:()=>{},ny=Object.defineProperty,iy=(u,r)=>ny(u,"name",{value:r,configurable:!0}),dh=En[" useEffectEvent ".trim().toString()],mh=En[" useInsertionEffect ".trim().toString()];function Nh(u){if(typeof dh=="function")return dh(u);const r=g.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof mh=="function"?mh(()=>{r.current=u}):sa(()=>{r.current=u}),g.useMemo(()=>((...f)=>r.current?.(...f)),[])}iy(Nh,"useEffectEvent");var uy=Object.defineProperty,Mi=(u,r)=>uy(u,"name",{value:r,configurable:!0}),cy=En[" useInsertionEffect ".trim().toString()]||sa;function Ci({prop:u,defaultProp:r,onChange:f=Mi(()=>{},"onChange"),caller:o}){const[m,h,S]=Rh({defaultProp:r,onChange:f}),E=u!==void 0,j=E?u:m,y=g.useCallback(p=>{if(E){const M=Oh(p)?p(u):p;M!==u&&S.current?.(M)}else h(p)},[E,u,h,S]);return[j,y]}Mi(Ci,"useControllableState");function Rh({defaultProp:u,onChange:r}){const[f,o]=g.useState(u),m=g.useRef(f),h=g.useRef(r);return cy(()=>{h.current=r},[r]),g.useEffect(()=>{m.current!==f&&(h.current?.(f),m.current=f)},[f,m]),[f,o,h]}Mi(Rh,"useUncontrolledState");function Oh(u){return typeof u=="function"}Mi(Oh,"isFunction");var hh=Symbol("RADIX:SYNC_STATE");function sy(u,r,f,o){const{prop:m,defaultProp:h,onChange:S,caller:E}=r,j=m!==void 0,y=Nh(S),p=[{...f,state:h}];o&&p.push(o);const[M,O]=g.useReducer((X,k)=>{if(k.type===hh)return{...X,state:k.state};const Z=u(X,k);return j&&!Object.is(Z.state,X.state)&&y(Z.state),Z},...p),Y=M.state,H=g.useRef(Y);g.useEffect(()=>{H.current!==Y&&(H.current=Y,j||y(Y))},[Y,H,j]);const V=g.useMemo(()=>m!==void 0?{...M,state:m}:M,[M,m]);return g.useEffect(()=>{j&&!Object.is(m,M.state)&&O({type:hh,state:m})},[m,M.state,j]),[V,O]}Mi(sy,"useControllableStateReducer");var oy=Object.defineProperty,Ho=(u,r)=>oy(u,"name",{value:r,configurable:!0});function To(u,r){if(typeof u=="function")return u(r);u!=null&&(u.current=r)}Ho(To,"setRef");function Dh(...u){return r=>{let f=!1;const o=u.map(m=>{const h=To(m,r);return!f&&typeof h=="function"&&(f=!0),h});if(f)return()=>{for(let m=0;mry(u,"name",{value:r,configurable:!0});function Mn(u){const r=g.forwardRef((f,o)=>{let{children:m,...h}=f,S=null,E=!1;const j=[];Ao(m)&&typeof Vu=="function"&&(m=Vu(m._payload)),g.Children.forEach(m,O=>{if(Bh(O)){E=!0;const Y=O;let H="child"in Y.props?Y.props.child:Y.props.children;Ao(H)&&typeof Vu=="function"&&(H=Vu(H._payload)),S=dy(Y,H),j.push(S?.props?.children)}else j.push(O)}),S?S=g.cloneElement(S,void 0,j):!E&&g.Children.count(m)===1&&g.isValidElement(m)&&(S=m);const y=S?Gh(S):void 0,p=ll(o,y);if(!S){if(m||m===0)throw new Error(E?py(u):hy(u));return m}const M=Uh(h,S.props??{});return S.type!==g.Fragment&&(M.ref=o?p:y),g.cloneElement(S,M)});return r.displayName=`${u}.Slot`,r}nl(Mn,"createSlot");var wh=Symbol.for("radix.slottable");function fy(u){const r=nl(f=>"child"in f?f.children(f.child):f.children,"Slottable");return r.displayName=`${u}.Slottable`,r.__radixId=wh,r}nl(fy,"createSlottable");var dy=nl((u,r)=>{if("child"in u.props){const f=u.props.child;return g.isValidElement(f)?g.cloneElement(f,void 0,u.props.children(f.props.children)):null}return g.isValidElement(r)?r:null},"getSlottableElementFromSlottable");function Uh(u,r){const f={...r};for(const o in r){const m=u[o],h=r[o];/^on[A-Z]/.test(o)?m&&h?f[o]=(...E)=>{const j=h(...E);return m(...E),j}:m&&(f[o]=m):o==="style"?f[o]={...m,...h}:o==="className"&&(f[o]=[m,h].filter(Boolean).join(" "))}return{...u,...f}}nl(Uh,"mergeProps");function Gh(u){let r=Object.getOwnPropertyDescriptor(u.props,"ref")?.get,f=r&&"isReactWarning"in r&&r.isReactWarning;return f?u.ref:(r=Object.getOwnPropertyDescriptor(u,"ref")?.get,f=r&&"isReactWarning"in r&&r.isReactWarning,f?u.props.ref:u.props.ref||u.ref)}nl(Gh,"getElementRef");function Bh(u){return g.isValidElement(u)&&typeof u.type=="function"&&"__radixId"in u.type&&u.type.__radixId===wh}nl(Bh,"isSlottable");var my=Symbol.for("react.lazy");function Ao(u){return u!=null&&typeof u=="object"&&"$$typeof"in u&&u.$$typeof===my&&"_payload"in u&&Hh(u._payload)}nl(Ao,"isLazyComponent");function Hh(u){return typeof u=="object"&&u!==null&&"then"in u}nl(Hh,"isPromiseLike");var hy=nl(u=>`${u} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),py=nl(u=>`${u} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Vu=En[" use ".trim().toString()],vy=Object.defineProperty,gy=(u,r)=>vy(u,"name",{value:r,configurable:!0}),yy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Et=yy.reduce((u,r)=>{const f=Mn(`Primitive.${r}`),o=g.forwardRef((m,h)=>{const{asChild:S,...E}=m,j=S?f:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(j,{...E,ref:h})});return o.displayName=`Primitive.${r}`,{...u,[r]:o}},{});function by(u,r){u&&Bo.flushSync(()=>u.dispatchEvent(r))}gy(by,"dispatchDiscreteCustomEvent");var Sy=Object.defineProperty,Ul=(u,r)=>Sy(u,"name",{value:r,configurable:!0});function kh(u,r){return g.useReducer((f,o)=>r[f][o]??f,u)}Ul(kh,"useStateMachine");var qh=Ul(u=>{const{present:r,children:f}=u,o=Lh(r),m=typeof f=="function"?f({present:o.isPresent}):g.Children.only(f),h=Yh(o.ref,Vh(m));return typeof f=="function"||o.isPresent?g.cloneElement(m,{ref:h}):null},"Presence");function Lh(u){const[r,f]=g.useState(),o=g.useRef(null),m=g.useRef(u),h=g.useRef("none"),S=g.useRef(void 0),E=u?"mounted":"unmounted",[j,y]=kh(E,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{j==="mounted"?(h.current=S.current??jn(o.current),S.current=void 0):h.current="none"},[j]),sa(()=>{const p=o.current,M=m.current;if(M!==u){const Y=h.current,H=jn(p);u?(S.current=H,y("MOUNT")):H==="none"||p?.display==="none"?y("UNMOUNT"):y(M&&Y!==H?"ANIMATION_OUT":"UNMOUNT"),m.current=u}},[u,y]),sa(()=>{if(r){let p;const M=r.ownerDocument.defaultView??window,O=Ul(H=>{const X=jn(o.current).includes(CSS.escape(H.animationName));if(H.target===r&&X&&(y("ANIMATION_END"),!m.current)){const k=r.style.animationFillMode;r.style.animationFillMode="forwards",p=M.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=k)})}},"handleAnimationEnd"),Y=Ul(H=>{H.target===r&&(h.current=jn(o.current))},"handleAnimationStart");return r.addEventListener("animationstart",Y),r.addEventListener("animationcancel",O),r.addEventListener("animationend",O),()=>{M.clearTimeout(p),r.removeEventListener("animationstart",Y),r.removeEventListener("animationcancel",O),r.removeEventListener("animationend",O)}}else y("ANIMATION_END")},[r,y]),{isPresent:["mounted","unmountSuspended"].includes(j),ref:g.useCallback(p=>{if(p){const M=getComputedStyle(p);o.current=M,S.current=jn(M)}else o.current=null;f(p)},[])}}Ul(Lh,"usePresence");function zo(u,r){if(typeof u=="function")return u(r);u!=null&&(u.current=r)}Ul(zo,"setRef");function Yh(...u){const r=g.useRef(u);return r.current=u,g.useCallback(f=>{const o=r.current;let m=!1;const h=o.map(S=>{const E=zo(S,f);return!m&&typeof E=="function"&&(m=!0),E});if(m)return()=>{for(let S=0;S_y(u,"name",{value:r,configurable:!0}),jy=En[" useId ".trim().toString()]||(()=>{}),My=0;function Zu(u){const[r,f]=g.useState(jy());return sa(()=>{u||f(o=>o??String(My++))},[u]),u||(r?`radix-${r}`:"")}xy(Zu,"useId");var Cy=Object.defineProperty,Ei=(u,r)=>Cy(u,"name",{value:r,configurable:!0}),ko="Collapsible",[Ey,x1]=ra(ko),[Ty,qo]=Ey(ko),Ay=g.forwardRef(Ei(function(r,f){const{__scopeCollapsible:o,open:m,defaultOpen:h,disabled:S,onOpenChange:E,...j}=r,[y,p]=Ci({prop:m,defaultProp:h??!1,onChange:E,caller:ko});return c.jsx(Ty,{scope:o,disabled:S,contentId:Zu(),open:y,onOpenToggle:g.useCallback(()=>p(M=>!M),[p]),children:c.jsx(Et.div,{"data-state":Ku(y),"data-disabled":S?"":void 0,...j,ref:f})})},"Collapsible")),zy="CollapsibleTrigger",Ny=g.forwardRef(Ei(function(r,f){const{__scopeCollapsible:o,...m}=r,h=qo(zy,o);return c.jsx(Et.button,{type:"button","aria-controls":h.open?h.contentId:void 0,"aria-expanded":h.open||!1,"data-state":Ku(h.open),"data-disabled":h.disabled?"":void 0,disabled:h.disabled,...m,ref:f,onClick:Bt(r.onClick,h.onOpenToggle)})},"CollapsibleTrigger")),Xh="CollapsibleContent",Ry=g.forwardRef(Ei(function(r,f){const{forceMount:o,...m}=r,h=qo(Xh,r.__scopeCollapsible);return c.jsx(qh,{present:o||h.open,children:({present:S})=>c.jsx(Oy,{...m,ref:f,present:S})})},"CollapsibleContent")),Oy=g.forwardRef(Ei(function(r,f){const{__scopeCollapsible:o,present:m,children:h,...S}=r,E=qo(Xh,o),[j,y]=g.useState(m),p=g.useRef(null),M=ll(f,p),O=g.useRef(0),Y=O.current,H=g.useRef(0),V=H.current,X=E.open||j,k=g.useRef(X),Z=g.useRef(void 0);return g.useEffect(()=>{const w=requestAnimationFrame(()=>k.current=!1);return()=>cancelAnimationFrame(w)},[]),sa(()=>{const w=p.current;if(w){Z.current=Z.current||{transitionDuration:w.style.transitionDuration,animationName:w.style.animationName},w.style.transitionDuration="0s",w.style.animationName="none";const q=w.getBoundingClientRect();O.current=q.height,H.current=q.width,k.current||(w.style.transitionDuration=Z.current.transitionDuration,w.style.animationName=Z.current.animationName),y(m)}},[E.open,m]),c.jsx(Et.div,{"data-state":Ku(E.open),"data-disabled":E.disabled?"":void 0,id:E.contentId,hidden:!X,...S,ref:M,style:{"--radix-collapsible-content-height":Y?`${Y}px`:void 0,"--radix-collapsible-content-width":V?`${V}px`:void 0,...r.style},children:X&&h})},"CollapsibleContentImpl"));function Ku(u){return u?"open":"closed"}Ei(Ku,"getState");var Dy=Ay,wy=Ny,Uy=Ry,Gy=Object.defineProperty,Gl=(u,r)=>Gy(u,"name",{value:r,configurable:!0}),Qh="Progress",Lo=100,[By,j1]=ra(Qh),[Hy,ky]=By(Qh),qy=g.forwardRef(Gl(function(r,f){const{__scopeProgress:o,value:m=null,max:h,getValueLabel:S=Zh,...E}=r;(h||h===0)&&!No(h)&&console.error(Kh(`${h}`,"Progress"));const j=No(h)?h:Lo;m!==null&&!Ro(m,j)&&console.error(Jh(`${m}`,"Progress"));const y=Ro(m,j)?m:null,p=xi(y)?S(y,j):void 0;return c.jsx(Hy,{scope:o,value:y,max:j,children:c.jsx(Et.div,{"aria-valuemax":j,"aria-valuemin":0,"aria-valuenow":xi(y)?y:void 0,"aria-valuetext":p,role:"progressbar","data-state":Yo(y,j),"data-value":y??void 0,"data-max":j,...E,ref:f})})},"Progress")),Ly="ProgressIndicator",Yy=g.forwardRef(Gl(function(r,f){const{__scopeProgress:o,...m}=r,h=ky(Ly,o);return c.jsx(Et.div,{"data-state":Yo(h.value,h.max),"data-value":h.value??void 0,"data-max":h.max,...m,ref:f})},"ProgressIndicator"));function Zh(u,r){return`${Math.round(u/r*100)}%`}Gl(Zh,"defaultGetValueLabel");function Yo(u,r){return u==null?"indeterminate":u===r?"complete":"loading"}Gl(Yo,"getProgressState");function xi(u){return typeof u=="number"}Gl(xi,"isNumber");function No(u){return xi(u)&&!isNaN(u)&&u>0}Gl(No,"isValidMaxNumber");function Ro(u,r){return xi(u)&&!isNaN(u)&&u<=r&&u>=0}Gl(Ro,"isValidValueNumber");function Kh(u,r){return`Invalid prop \`max\` of value \`${u}\` supplied to \`${r}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Lo}\`.`}Gl(Kh,"getInvalidMaxError");function Jh(u,r){return`Invalid prop \`value\` of value \`${u}\` supplied to \`${r}\`. The \`value\` prop must be: +`+a.stack}}var vl=Object.prototype.hasOwnProperty,le=u.unstable_scheduleCallback,Ll=u.unstable_cancelCallback,F=u.unstable_shouldYield,Re=u.unstable_requestPaint,ve=u.unstable_now,Vt=u.unstable_getCurrentPriorityLevel,bt=u.unstable_ImmediatePriority,Ae=u.unstable_UserBlockingPriority,pt=u.unstable_NormalPriority,gl=u.unstable_LowPriority,ol=u.unstable_IdlePriority,rl=u.log,ec=u.unstable_setDisableYieldValue,ya=null,St=null;function tl(e){if(typeof rl=="function"&&ec(e),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(ya,e)}catch{}}var vt=Math.clz32?Math.clz32:tc,Ri=Math.log,Oi=Math.LN2;function tc(e){return e>>>=0,e===0?32:31-(Ri(e)/Oi|0)|0}var qa=256,ba=262144,La=4194304;function yl(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ya(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var n=0,i=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var d=a&134217727;return d!==0?(a=d&~i,a!==0?n=yl(a):(s&=d,s!==0?n=yl(s):l||(l=d&~e,l!==0&&(n=yl(l))))):(d=a&~i,d!==0?n=yl(d):s!==0?n=yl(s):l||(l=a&~e,l!==0&&(n=yl(l)))),n===0?0:t!==0&&t!==n&&(t&i)===0&&(i=n&-n,l=t&-t,i>=l||i===32&&(l&4194048)!==0)?t:n}function Yl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function lc(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Di(){var e=La;return La<<=1,(La&62914560)===0&&(La=4194304),e}function b(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function ce(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ge(e,t,l,a,n,i){var s=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var d=e.entanglements,v=e.expirationTimes,A=e.hiddenUpdates;for(l=s&~l;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Gp=/[\n"\\]/g;function Qt(e){return e.replace(Gp,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function sc(e,t,l,a,n,i,s,d){e.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.type=s:e.removeAttribute("type"),t!=null?s==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Xt(t)):e.value!==""+Xt(t)&&(e.value=""+Xt(t)):s!=="submit"&&s!=="reset"||e.removeAttribute("value"),t!=null?oc(e,s,Xt(t)):l!=null?oc(e,s,Xt(l)):a!=null&&e.removeAttribute("value"),n==null&&i!=null&&(e.defaultChecked=!!i),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.name=""+Xt(d):e.removeAttribute("name")}function vr(e,t,l,a,n,i,s,d){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||l!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){cc(e);return}l=l!=null?""+Xt(l):"",t=t!=null?""+Xt(t):l,d||t===e.value||(e.value=t),e.defaultValue=t}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=d?e.checked:!!a,e.defaultChecked=!!a,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.name=s),cc(e)}function oc(e,t,l){t==="number"&&Bi(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Ja(e,t,l,a){if(e=e.options,t){t={};for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hc=!1;if(_l)try{var Gn={};Object.defineProperty(Gn,"passive",{get:function(){hc=!0}}),window.addEventListener("test",Gn,Gn),window.removeEventListener("test",Gn,Gn)}catch{hc=!1}var Xl=null,pc=null,ki=null;function jr(){if(ki)return ki;var e,t=pc,l=t.length,a,n="value"in Xl?Xl.value:Xl.textContent,i=n.length;for(e=0;e=kn),zr=" ",Nr=!1;function Rr(e,t){switch(e){case"keyup":return rv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Or(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ia=!1;function dv(e,t){switch(e){case"compositionend":return Or(t);case"keypress":return t.which!==32?null:(Nr=!0,zr);case"textInput":return e=t.data,e===zr&&Nr?null:e;default:return null}}function mv(e,t){if(Ia)return e==="compositionend"||!Sc&&Rr(e,t)?(e=jr(),ki=pc=Xl=null,Ia=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=qr(l)}}function Yr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Yr(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Bi(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=Bi(e.document)}return t}function jc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var _v=_l&&"documentMode"in document&&11>=document.documentMode,Pa=null,Mc=null,Vn=null,Cc=!1;function Xr(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Cc||Pa==null||Pa!==Bi(a)||(a=Pa,"selectionStart"in a&&jc(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Vn&&Yn(Vn,a)||(Vn=a,a=Ou(Mc,"onSelect"),0>=s,n-=s,fl=1<<32-vt(t)+n|l<fe?(_e=P,P=null):_e=P.sibling;var Te=z(C,P,T[fe],w);if(Te===null){P===null&&(P=_e);break}e&&P&&Te.alternate===null&&t(C,P),S=i(Te,S,fe),Ee===null?ae=Te:Ee.sibling=Te,Ee=Te,P=_e}if(fe===T.length)return l(C,P),xe&&jl(C,fe),ae;if(P===null){for(;fefe?(_e=P,P=null):_e=P.sibling;var da=z(C,P,Te.value,w);if(da===null){P===null&&(P=_e);break}e&&P&&da.alternate===null&&t(C,P),S=i(da,S,fe),Ee===null?ae=da:Ee.sibling=da,Ee=da,P=_e}if(Te.done)return l(C,P),xe&&jl(C,fe),ae;if(P===null){for(;!Te.done;fe++,Te=T.next())Te=G(C,Te.value,w),Te!==null&&(S=i(Te,S,fe),Ee===null?ae=Te:Ee.sibling=Te,Ee=Te);return xe&&jl(C,fe),ae}for(P=a(P);!Te.done;fe++,Te=T.next())Te=N(P,C,fe,Te.value,w),Te!==null&&(e&&Te.alternate!==null&&P.delete(Te.key===null?fe:Te.key),S=i(Te,S,fe),Ee===null?ae=Te:Ee.sibling=Te,Ee=Te);return e&&P.forEach(function(Lg){return t(C,Lg)}),xe&&jl(C,fe),ae}function Ge(C,S,T,w){if(typeof T=="object"&&T!==null&&T.type===X&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case Y:e:{for(var ae=T.key;S!==null;){if(S.key===ae){if(ae=T.type,ae===X){if(S.tag===7){l(C,S.sibling),w=n(S,T.props.children),w.return=C,C=w;break e}}else if(S.elementType===ae||typeof ae=="object"&&ae!==null&&ae.$$typeof===ue&&Na(ae)===S.type){l(C,S.sibling),w=n(S,T.props),$n(w,T),w.return=C,C=w;break e}l(C,S);break}else t(C,S);S=S.sibling}T.type===X?(w=Ca(T.props.children,C.mode,w,T.key),w.return=C,C=w):(w=$i(T.type,T.key,T.props,null,C.mode,w),$n(w,T),w.return=C,C=w)}return s(C);case B:e:{for(ae=T.key;S!==null;){if(S.key===ae)if(S.tag===4&&S.stateNode.containerInfo===T.containerInfo&&S.stateNode.implementation===T.implementation){l(C,S.sibling),w=n(S,T.children||[]),w.return=C,C=w;break e}else{l(C,S);break}else t(C,S);S=S.sibling}w=Oc(T,C.mode,w),w.return=C,C=w}return s(C);case ue:return T=Na(T),Ge(C,S,T,w)}if(Fe(T))return W(C,S,T,w);if(de(T)){if(ae=de(T),typeof ae!="function")throw Error(o(150));return T=ae.call(T),ne(C,S,T,w)}if(typeof T.then=="function")return Ge(C,S,lu(T),w);if(T.$$typeof===k)return Ge(C,S,Ii(C,T),w);au(C,T)}return typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint"?(T=""+T,S!==null&&S.tag===6?(l(C,S.sibling),w=n(S,T),w.return=C,C=w):(l(C,S),w=Rc(T,C.mode,w),w.return=C,C=w),s(C)):l(C,S)}return function(C,S,T,w){try{Jn=0;var ae=Ge(C,S,T,w);return fn=null,ae}catch(P){if(P===rn||P===eu)throw P;var Ee=Rt(29,P,null,C.mode);return Ee.lanes=w,Ee.return=C,Ee}}}var Oa=hf(!0),pf=hf(!1),$l=!1;function Xc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Fl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Wl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ze&2)!==0){var n=a.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),a.pending=t,t=Ji(e),Wr(e,null,l),t}return Ki(e,a,t,l),Ji(e)}function Fn(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,wi(e,l)}}function Zc(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var n=null,i=null;if(l=l.firstBaseUpdate,l!==null){do{var s={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};i===null?n=i=s:i=i.next=s,l=l.next}while(l!==null);i===null?n=i=t:i=i.next=t}else n=i=t;l={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:i,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Kc=!1;function Wn(){if(Kc){var e=on;if(e!==null)throw e}}function In(e,t,l,a){Kc=!1;var n=e.updateQueue;$l=!1;var i=n.firstBaseUpdate,s=n.lastBaseUpdate,d=n.shared.pending;if(d!==null){n.shared.pending=null;var v=d,A=v.next;v.next=null,s===null?i=A:s.next=A,s=v;var D=e.alternate;D!==null&&(D=D.updateQueue,d=D.lastBaseUpdate,d!==s&&(d===null?D.firstBaseUpdate=A:d.next=A,D.lastBaseUpdate=v))}if(i!==null){var G=n.baseState;s=0,D=A=v=null,d=i;do{var z=d.lane&-536870913,N=z!==d.lane;if(N?(Se&z)===z:(a&z)===z){z!==0&&z===sn&&(Kc=!0),D!==null&&(D=D.next={lane:0,tag:d.tag,payload:d.payload,callback:null,next:null});e:{var W=e,ne=d;z=t;var Ge=l;switch(ne.tag){case 1:if(W=ne.payload,typeof W=="function"){G=W.call(Ge,G,z);break e}G=W;break e;case 3:W.flags=W.flags&-65537|128;case 0:if(W=ne.payload,z=typeof W=="function"?W.call(Ge,G,z):W,z==null)break e;G=M({},G,z);break e;case 2:$l=!0}}z=d.callback,z!==null&&(e.flags|=64,N&&(e.flags|=8192),N=n.callbacks,N===null?n.callbacks=[z]:N.push(z))}else N={lane:z,tag:d.tag,payload:d.payload,callback:d.callback,next:null},D===null?(A=D=N,v=G):D=D.next=N,s|=z;if(d=d.next,d===null){if(d=n.shared.pending,d===null)break;N=d,d=N.next,N.next=null,n.lastBaseUpdate=N,n.shared.pending=null}}while(!0);D===null&&(v=G),n.baseState=v,n.firstBaseUpdate=A,n.lastBaseUpdate=D,i===null&&(n.shared.lanes=0),la|=s,e.lanes=s,e.memoizedState=G}}function vf(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function gf(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;ei?i:8;var s=R.T,d={};R.T=d,ds(e,!1,t,l);try{var v=n(),A=R.S;if(A!==null&&A(d,v),v!==null&&typeof v=="object"&&typeof v.then=="function"){var D=Nv(v,a);ti(e,t,D,Gt(e))}else ti(e,t,a,Gt(e))}catch(G){ti(e,t,{then:function(){},status:"rejected",reason:G},Gt())}finally{q.p=i,s!==null&&d.types!==null&&(s.types=d.types),R.T=s}}function Gv(){}function rs(e,t,l,a){if(e.tag!==5)throw Error(o(476));var n=$f(e).queue;Jf(e,n,t,I,l===null?Gv:function(){return Ff(e),l(a)})}function $f(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tl,lastRenderedState:I},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tl,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ff(e){var t=$f(e);t.next===null&&(t=e.alternate.memoizedState),ti(e,t.next.queue,{},Gt())}function fs(){return ft(yi)}function Wf(){return $e().memoizedState}function If(){return $e().memoizedState}function Bv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Gt();e=Fl(l);var a=Wl(t,e,l);a!==null&&(At(a,t,l),Fn(a,t,l)),t={cache:qc()},e.payload=t;return}t=t.return}}function Hv(e,t,l){var a=Gt();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},mu(e)?ed(t,l):(l=zc(e,t,l,a),l!==null&&(At(l,e,a),td(l,t,a)))}function Pf(e,t,l){var a=Gt();ti(e,t,l,a)}function ti(e,t,l,a){var n={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(mu(e))ed(t,n);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,d=i(s,l);if(n.hasEagerState=!0,n.eagerState=d,Nt(d,s))return Ki(e,t,n,0),Be===null&&Zi(),!1}catch{}if(l=zc(e,t,n,a),l!==null)return At(l,e,a),td(l,t,a),!0}return!1}function ds(e,t,l,a){if(a={lane:2,revertLane:Xs(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},mu(e)){if(t)throw Error(o(479))}else t=zc(e,l,a,2),t!==null&&At(t,e,2)}function mu(e){var t=e.alternate;return e===re||t!==null&&t===re}function ed(e,t){mn=uu=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function td(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,wi(e,l)}}var li={readContext:ft,use:ou,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useLayoutEffect:Ze,useInsertionEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useSyncExternalStore:Ze,useId:Ze,useHostTransitionStatus:Ze,useFormState:Ze,useActionState:Ze,useOptimistic:Ze,useMemoCache:Ze,useCacheRefresh:Ze};li.useEffectEvent=Ze;var ld={readContext:ft,use:ou,useCallback:function(e,t){return _t().memoizedState=[e,t===void 0?null:t],e},useContext:ft,useEffect:kf,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,fu(4194308,4,Vf.bind(null,t,e),l)},useLayoutEffect:function(e,t){return fu(4194308,4,e,t)},useInsertionEffect:function(e,t){fu(4,2,e,t)},useMemo:function(e,t){var l=_t();t=t===void 0?null:t;var a=e();if(Da){tl(!0);try{e()}finally{tl(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=_t();if(l!==void 0){var n=l(t);if(Da){tl(!0);try{l(t)}finally{tl(!1)}}}else n=t;return a.memoizedState=a.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},a.queue=e,e=e.dispatch=Hv.bind(null,re,e),[a.memoizedState,e]},useRef:function(e){var t=_t();return e={current:e},t.memoizedState=e},useState:function(e){e=is(e);var t=e.queue,l=Pf.bind(null,re,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:ss,useDeferredValue:function(e,t){var l=_t();return os(l,e,t)},useTransition:function(){var e=is(!1);return e=Jf.bind(null,re,e.queue,!0,!1),_t().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=re,n=_t();if(xe){if(l===void 0)throw Error(o(407));l=l()}else{if(l=t(),Be===null)throw Error(o(349));(Se&127)!==0||jf(a,t,l)}n.memoizedState=l;var i={value:l,getSnapshot:t};return n.queue=i,kf(Cf.bind(null,a,i,e),[e]),a.flags|=2048,pn(9,{destroy:void 0},Mf.bind(null,a,i,l,t),null),l},useId:function(){var e=_t(),t=Be.identifierPrefix;if(xe){var l=dl,a=fl;l=(a&~(1<<32-vt(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=cu++,0<\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof a.is=="string"?s.createElement("select",{is:a.is}):s.createElement("select"),a.multiple?i.multiple=!0:a.size&&(i.size=a.size);break;default:i=typeof a.is=="string"?s.createElement(n,{is:a.is}):s.createElement(n)}}i[ot]=t,i[xt]=a;e:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)i.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=i;e:switch(mt(i,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&zl(t)}}return Ye(t),Es(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&zl(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(o(166));if(e=oe.current,un(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,n=rt,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}e[ot]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||_m(e.nodeValue,l)),e||Kl(t,!0)}else e=Du(e).createTextNode(a),e[ot]=t,t.stateNode=e}return Ye(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=un(t),l!==null){if(e===null){if(!a)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[ot]=t}else Ea(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ye(t),e=!1}else l=Gc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Dt(t),t):(Dt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Ye(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=un(t),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(o(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(o(317));n[ot]=t}else Ea(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ye(t),n=!1}else n=Gc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(Dt(t),t):(Dt(t),null)}return Dt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),i=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(i=a.memoizedState.cachePool.pool),i!==n&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),yu(t,t.updateQueue),Ye(t),null);case 4:return ke(),e===null&&Js(t.stateNode.containerInfo),Ye(t),null;case 10:return Cl(t.type),Ye(t),null;case 19:if(U(Je),a=t.memoizedState,a===null)return Ye(t),null;if(n=(t.flags&128)!==0,i=a.rendering,i===null)if(n)ni(a,!1);else{if(Ke!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=iu(e),i!==null){for(t.flags|=128,ni(a,!1),e=i.updateQueue,t.updateQueue=e,yu(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Ir(l,e),l=l.sibling;return K(Je,Je.current&1|2),xe&&jl(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&ve()>ju&&(t.flags|=128,n=!0,ni(a,!1),t.lanes=4194304)}else{if(!n)if(e=iu(i),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,yu(t,e),ni(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!xe)return Ye(t),null}else 2*ve()-a.renderingStartTime>ju&&l!==536870912&&(t.flags|=128,n=!0,ni(a,!1),t.lanes=4194304);a.isBackwards?(i.sibling=t.child,t.child=i):(e=a.last,e!==null?e.sibling=i:t.child=i,a.last=i)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=ve(),e.sibling=null,l=Je.current,K(Je,n?l&1|2:l&1),xe&&jl(t,a.treeForkCount),e):(Ye(t),null);case 22:case 23:return Dt(t),$c(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(Ye(t),t.subtreeFlags&6&&(t.flags|=8192)):Ye(t),l=t.updateQueue,l!==null&&yu(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&U(za),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Cl(We),Ye(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Vv(e,t){switch(wc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Cl(We),ke(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Lt(t),null;case 31:if(t.memoizedState!==null){if(Dt(t),t.alternate===null)throw Error(o(340));Ea()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Dt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Ea()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(Je),null;case 4:return ke(),null;case 10:return Cl(t.type),null;case 22:case 23:return Dt(t),$c(),e!==null&&U(za),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Cl(We),null;case 25:return null;default:return null}}function Ed(e,t){switch(wc(t),t.tag){case 3:Cl(We),ke();break;case 26:case 27:case 5:Lt(t);break;case 4:ke();break;case 31:t.memoizedState!==null&&Dt(t);break;case 13:Dt(t);break;case 19:U(Je);break;case 10:Cl(t.type);break;case 22:case 23:Dt(t),$c(),e!==null&&U(za);break;case 24:Cl(We)}}function ii(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var n=a.next;l=n;do{if((l.tag&e)===e){a=void 0;var i=l.create,s=l.inst;a=i(),s.destroy=a}l=l.next}while(l!==n)}}catch(d){De(t,t.return,d)}}function ea(e,t,l){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var i=n.next;a=i;do{if((a.tag&e)===e){var s=a.inst,d=s.destroy;if(d!==void 0){s.destroy=void 0,n=t;var v=l,A=d;try{A()}catch(D){De(n,v,D)}}}a=a.next}while(a!==i)}}catch(D){De(t,t.return,D)}}function Td(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{gf(t,l)}catch(a){De(e,e.return,a)}}}function Ad(e,t,l){l.props=wa(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){De(e,t,a)}}function ui(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(n){De(e,t,n)}}function ml(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(n){De(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(n){De(e,t,n)}else l.current=null}function zd(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(n){De(e,e.return,n)}}function Ts(e,t,l){try{var a=e.stateNode;fg(a,e.type,l,t),a[xt]=t}catch(n){De(e,e.return,n)}}function Nd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ca(e.type)||e.tag===4}function As(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Nd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ca(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function zs(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Sl));else if(a!==4&&(a===27&&ca(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(zs(e,t,l),e=e.sibling;e!==null;)zs(e,t,l),e=e.sibling}function bu(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&ca(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(bu(e,t,l),e=e.sibling;e!==null;)bu(e,t,l),e=e.sibling}function Rd(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);mt(t,a,l),t[ot]=e,t[xt]=l}catch(i){De(e,e.return,i)}}var Nl=!1,et=!1,Ns=!1,Od=typeof WeakSet=="function"?WeakSet:Set,it=null;function Xv(e,t){if(e=e.containerInfo,Ws=qu,e=Vr(e),jc(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var n=a.anchorOffset,i=a.focusNode;a=a.focusOffset;try{l.nodeType,i.nodeType}catch{l=null;break e}var s=0,d=-1,v=-1,A=0,D=0,G=e,z=null;t:for(;;){for(var N;G!==l||n!==0&&G.nodeType!==3||(d=s+n),G!==i||a!==0&&G.nodeType!==3||(v=s+a),G.nodeType===3&&(s+=G.nodeValue.length),(N=G.firstChild)!==null;)z=G,G=N;for(;;){if(G===e)break t;if(z===l&&++A===n&&(d=s),z===i&&++D===a&&(v=s),(N=G.nextSibling)!==null)break;G=z,z=G.parentNode}G=N}l=d===-1||v===-1?null:{start:d,end:v}}else l=null}l=l||{start:0,end:0}}else l=null;for(Is={focusedElem:e,selectionRange:l},qu=!1,it=t;it!==null;)if(t=it,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,it=e;else for(;it!==null;){switch(t=it,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l title"))),mt(i,a,l),i[ot]=e,nt(i),a=i;break e;case"link":var s=Hm("link","href",n).get(a+(l.href||""));if(s){for(var d=0;dGe&&(s=Ge,Ge=ne,ne=s);var C=Lr(d,ne),S=Lr(d,Ge);if(C&&S&&(N.rangeCount!==1||N.anchorNode!==C.node||N.anchorOffset!==C.offset||N.focusNode!==S.node||N.focusOffset!==S.offset)){var T=G.createRange();T.setStart(C.node,C.offset),N.removeAllRanges(),ne>Ge?(N.addRange(T),N.extend(S.node,S.offset)):(T.setEnd(S.node,S.offset),N.addRange(T))}}}}for(G=[],N=d;N=N.parentNode;)N.nodeType===1&&G.push({element:N,left:N.scrollLeft,top:N.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;dl?32:l,R.T=null,l=Bs,Bs=null;var i=na,s=Ul;if(lt=0,Sn=na=null,Ul=0,(ze&6)!==0)throw Error(o(331));var d=ze;if(ze|=4,Vd(i.current),qd(i,i.current,s,l),ze=d,di(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(ya,i)}catch{}return!0}finally{q.p=n,R.T=a,cm(e,t)}}function om(e,t,l){t=Kt(l,t),t=vs(e.stateNode,t,2),e=Wl(e,t,2),e!==null&&(ce(e,2),hl(e))}function De(e,t,l){if(e.tag===3)om(e,e,l);else for(;t!==null;){if(t.tag===3){om(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(aa===null||!aa.has(a))){e=Kt(l,e),l=rd(2),a=Wl(t,l,2),a!==null&&(fd(l,a,t,e),ce(a,2),hl(a));break}}t=t.return}}function Ls(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new Kv;var n=new Set;a.set(t,n)}else n=a.get(t),n===void 0&&(n=new Set,a.set(t,n));n.has(l)||(Ds=!0,n.add(l),e=Iv.bind(null,e,t,l),t.then(e,e))}function Iv(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Be===e&&(Se&l)===l&&(Ke===4||Ke===3&&(Se&62914560)===Se&&300>ve()-xu?(ze&2)===0&&_n(e,0):ws|=l,bn===Se&&(bn=0)),hl(e)}function rm(e,t){t===0&&(t=Di()),e=Ma(e,t),e!==null&&(ce(e,t),hl(e))}function Pv(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),rm(e,l)}function eg(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,n=e.memoizedState;n!==null&&(l=n.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(o(314))}a!==null&&a.delete(t),rm(e,l)}function tg(e,t){return le(e,t)}var zu=null,jn=null,Ys=!1,Nu=!1,Vs=!1,ua=0;function hl(e){e!==jn&&e.next===null&&(jn===null?zu=jn=e:jn=jn.next=e),Nu=!0,Ys||(Ys=!0,ag())}function di(e,t){if(!Vs&&Nu){Vs=!0;do for(var l=!1,a=zu;a!==null;){if(e!==0){var n=a.pendingLanes;if(n===0)var i=0;else{var s=a.suspendedLanes,d=a.pingedLanes;i=(1<<31-vt(42|e)+1)-1,i&=n&~(s&~d),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(l=!0,hm(a,i))}else i=Se,i=Ya(a,a===Be?i:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(i&3)===0||Yl(a,i)||(l=!0,hm(a,i));a=a.next}while(l);Vs=!1}}function lg(){fm()}function fm(){Nu=Ys=!1;var e=0;ua!==0&&mg()&&(e=ua);for(var t=ve(),l=null,a=zu;a!==null;){var n=a.next,i=dm(a,t);i===0?(a.next=null,l===null?zu=n:l.next=n,n===null&&(jn=l)):(l=a,(e!==0||(i&3)!==0)&&(Nu=!0)),a=n}lt!==0&<!==5||di(e),ua!==0&&(ua=0)}function dm(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,n=e.expirationTimes,i=e.pendingLanes&-62914561;0d)break;var D=v.transferSize,G=v.initiatorType;D&&xm(G)&&(v=v.responseEnd,s+=D*(v"u"?null:document;function wm(e,t,l){var a=Mn;if(a&&typeof t=="string"&&t){var n=Qt(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof l=="string"&&(n+='[crossorigin="'+l+'"]'),Dm.has(n)||(Dm.add(n),e={rel:e,crossOrigin:l,href:t},a.querySelector(n)===null&&(t=a.createElement("link"),mt(t,"link",e),nt(t),a.head.appendChild(t)))}}function xg(e){Gl.D(e),wm("dns-prefetch",e,null)}function jg(e,t){Gl.C(e,t),wm("preconnect",e,t)}function Mg(e,t,l){Gl.L(e,t,l);var a=Mn;if(a&&e&&t){var n='link[rel="preload"][as="'+Qt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(n+='[imagesrcset="'+Qt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(n+='[imagesizes="'+Qt(l.imageSizes)+'"]')):n+='[href="'+Qt(e)+'"]';var i=n;switch(t){case"style":i=Cn(e);break;case"script":i=En(e)}Pt.has(i)||(e=M({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Pt.set(i,e),a.querySelector(n)!==null||t==="style"&&a.querySelector(vi(i))||t==="script"&&a.querySelector(gi(i))||(t=a.createElement("link"),mt(t,"link",e),nt(t),a.head.appendChild(t)))}}function Cg(e,t){Gl.m(e,t);var l=Mn;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+Qt(a)+'"][href="'+Qt(e)+'"]',i=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=En(e)}if(!Pt.has(i)&&(e=M({rel:"modulepreload",href:e},t),Pt.set(i,e),l.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(gi(i)))return}a=l.createElement("link"),mt(a,"link",e),nt(a),l.head.appendChild(a)}}}function Eg(e,t,l){Gl.S(e,t,l);var a=Mn;if(a&&e){var n=Za(a).hoistableStyles,i=Cn(e);t=t||"default";var s=n.get(i);if(!s){var d={loading:0,preload:null};if(s=a.querySelector(vi(i)))d.loading=5;else{e=M({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Pt.get(i))&&io(e,l);var v=s=a.createElement("link");nt(v),mt(v,"link",e),v._p=new Promise(function(A,D){v.onload=A,v.onerror=D}),v.addEventListener("load",function(){d.loading|=1}),v.addEventListener("error",function(){d.loading|=2}),d.loading|=4,Uu(s,t,a)}s={type:"stylesheet",instance:s,count:1,state:d},n.set(i,s)}}}function Tg(e,t){Gl.X(e,t);var l=Mn;if(l&&e){var a=Za(l).hoistableScripts,n=En(e),i=a.get(n);i||(i=l.querySelector(gi(n)),i||(e=M({src:e,async:!0},t),(t=Pt.get(n))&&uo(e,t),i=l.createElement("script"),nt(i),mt(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},a.set(n,i))}}function Ag(e,t){Gl.M(e,t);var l=Mn;if(l&&e){var a=Za(l).hoistableScripts,n=En(e),i=a.get(n);i||(i=l.querySelector(gi(n)),i||(e=M({src:e,async:!0,type:"module"},t),(t=Pt.get(n))&&uo(e,t),i=l.createElement("script"),nt(i),mt(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},a.set(n,i))}}function Um(e,t,l,a){var n=(n=oe.current)?wu(n):null;if(!n)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Cn(l.href),l=Za(n).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Cn(l.href);var i=Za(n).hoistableStyles,s=i.get(e);if(s||(n=n.ownerDocument||n,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,s),(i=n.querySelector(vi(e)))&&!i._p&&(s.instance=i,s.state.loading=5),Pt.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Pt.set(e,l),i||zg(n,e,l,s.state))),t&&a===null)throw Error(o(528,""));return s}if(t&&a!==null)throw Error(o(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=En(l),l=Za(n).hoistableScripts,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Cn(e){return'href="'+Qt(e)+'"'}function vi(e){return'link[rel="stylesheet"]['+e+"]"}function Gm(e){return M({},e,{"data-precedence":e.precedence,precedence:null})}function zg(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),mt(t,"link",l),nt(t),e.head.appendChild(t))}function En(e){return'[src="'+Qt(e)+'"]'}function gi(e){return"script[async]"+e}function Bm(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Qt(l.href)+'"]');if(a)return t.instance=a,nt(a),a;var n=M({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),nt(a),mt(a,"style",n),Uu(a,l.precedence,e),t.instance=a;case"stylesheet":n=Cn(l.href);var i=e.querySelector(vi(n));if(i)return t.state.loading|=4,t.instance=i,nt(i),i;a=Gm(l),(n=Pt.get(n))&&io(a,n),i=(e.ownerDocument||e).createElement("link"),nt(i);var s=i;return s._p=new Promise(function(d,v){s.onload=d,s.onerror=v}),mt(i,"link",a),t.state.loading|=4,Uu(i,l.precedence,e),t.instance=i;case"script":return i=En(l.src),(n=e.querySelector(gi(i)))?(t.instance=n,nt(n),n):(a=l,(n=Pt.get(i))&&(a=M({},l),uo(a,n)),e=e.ownerDocument||e,n=e.createElement("script"),nt(n),mt(n,"link",a),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Uu(a,l.precedence,e));return t.instance}function Uu(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,i=n,s=0;s title"):null)}function Ng(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function qm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Rg(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var n=Cn(a.href),i=t.querySelector(vi(n));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Bu.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=i,nt(i);return}i=t.ownerDocument||t,a=Gm(a),(n=Pt.get(n))&&io(a,n),i=i.createElement("link"),nt(i);var s=i;s._p=new Promise(function(d,v){s.onload=d,s.onerror=v}),mt(i,"link",a),l.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Bu.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var co=0;function Og(e,t){return e.stylesheets&&e.count===0&&ku(e,e.stylesheets),0co?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function Bu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ku(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Hu=null;function ku(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Hu=new Map,t.forEach(Dg,e),Hu=null,Bu.call(e))}function Dg(e,t){if(!(t.state.loading&4)){var l=Hu.get(e);if(l)var a=l.get(null);else{l=new Map,Hu.set(e,l);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(r){console.error(r)}}return u(),bo.exports=Wg(),bo.exports}var Pg=Ig(),ey=Object.defineProperty,Rn=(u,r)=>ey(u,"name",{value:r,configurable:!0}),Th=!!(typeof window<"u"&&window.document&&window.document.createElement);function kt(u,r,{checkForDefaultPrevented:f=!0}={}){return Rn(function(m){if(u?.(m),f===!1||!m||!m.defaultPrevented)return r?.(m)},"handleEvent")}Rn(kt,"composeEventHandlers");function ty(u){if(!Th)throw new Error("Cannot access window outside of the DOM");return u?.ownerDocument?.defaultView??window}Rn(ty,"getOwnerWindow");function zo(u){if(!Th)throw new Error("Cannot access document outside of the DOM");return u?.ownerDocument??document}Rn(zo,"getOwnerDocument");function Ah(u,r=!1){const{activeElement:f}=zo(u);if(!f?.nodeName)return null;if(zh(f)&&f.contentDocument)return Ah(f.contentDocument.body,r);if(r){const o=f.getAttribute("aria-activedescendant");if(o){const m=zo(f).getElementById(o);if(m)return m}}return f}Rn(Ah,"getActiveElement");function zh(u){return u.tagName==="IFRAME"}Rn(zh,"isFrame");var ly=Object.defineProperty,el=(u,r)=>ly(u,"name",{value:r,configurable:!0});function ay(u,r){const f=g.createContext(r);f.displayName=u+"Context";const o=el(h=>{const{children:_,...E}=h,j=g.useMemo(()=>E,Object.values(E));return c.jsx(f.Provider,{value:j,children:_})},"Provider");o.displayName=u+"Provider";function m(h,_={}){const{optional:E=!1}=_,j=g.useContext(f);if(j)return j;if(r!==void 0)return r;if(!E)throw new Error(`\`${h}\` must be used within \`${u}\``)}return el(m,"useContext"),[o,m]}el(ay,"createContext");function va(u,r=[]){let f=[];function o(h,_){const E=g.createContext(_);E.displayName=h+"Context";const j=f.length;f=[...f,_];const y=el(M=>{const{scope:O,children:Y,...B}=M,X=O?.[u]?.[j]||E,Z=g.useMemo(()=>B,Object.values(B));return c.jsx(X.Provider,{value:Z,children:Y})},"Provider");y.displayName=h+"Provider";function p(M,O,Y={}){const{optional:B=!1}=Y,X=O?.[u]?.[j]||E,Z=g.useContext(X);if(Z)return Z;if(_!==void 0)return _;if(!B)throw new Error(`\`${M}\` must be used within \`${h}\``)}return el(p,"useContext"),[y,p]}el(o,"createContext");const m=el(()=>{const h=f.map(_=>g.createContext(_));return el(function(E){const j=E?.[u]||h;return g.useMemo(()=>({[`__scope${u}`]:{...E,[u]:j}}),[E,j])},"useScope")},"createScope");return m.scopeName=u,[o,Nh(m,...r)]}el(va,"createContextScope");function Nh(...u){const r=u[0];if(u.length===1)return r;const f=el(()=>{const o=u.map(m=>({useScope:m(),scopeName:m.scopeName}));return el(function(h){const _=o.reduce((E,{useScope:j,scopeName:y})=>{const M=j(h)[`__scope${y}`];return{...E,...M}},{});return g.useMemo(()=>({[`__scope${r.scopeName}`]:_}),[_])},"useComposedScopes")},"createScope");return f.scopeName=r.scopeName,f}el(Nh,"composeContextScopes");var ma=globalThis?.document?g.useLayoutEffect:()=>{},ny=Object.defineProperty,iy=(u,r)=>ny(u,"name",{value:r,configurable:!0}),mh=Nn[" useEffectEvent ".trim().toString()],hh=Nn[" useInsertionEffect ".trim().toString()];function Rh(u){if(typeof mh=="function")return mh(u);const r=g.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof hh=="function"?hh(()=>{r.current=u}):ma(()=>{r.current=u}),g.useMemo(()=>((...f)=>r.current?.(...f)),[])}iy(Rh,"useEffectEvent");var uy=Object.defineProperty,Ti=(u,r)=>uy(u,"name",{value:r,configurable:!0}),cy=Nn[" useInsertionEffect ".trim().toString()]||ma;function Ai({prop:u,defaultProp:r,onChange:f=Ti(()=>{},"onChange"),caller:o}){const[m,h,_]=Oh({defaultProp:r,onChange:f}),E=u!==void 0,j=E?u:m,y=g.useCallback(p=>{if(E){const M=Dh(p)?p(u):p;M!==u&&_.current?.(M)}else h(p)},[E,u,h,_]);return[j,y]}Ti(Ai,"useControllableState");function Oh({defaultProp:u,onChange:r}){const[f,o]=g.useState(u),m=g.useRef(f),h=g.useRef(r);return cy(()=>{h.current=r},[r]),g.useEffect(()=>{m.current!==f&&(h.current?.(f),m.current=f)},[f,m]),[f,o,h]}Ti(Oh,"useUncontrolledState");function Dh(u){return typeof u=="function"}Ti(Dh,"isFunction");var ph=Symbol("RADIX:SYNC_STATE");function sy(u,r,f,o){const{prop:m,defaultProp:h,onChange:_,caller:E}=r,j=m!==void 0,y=Rh(_),p=[{...f,state:h}];o&&p.push(o);const[M,O]=g.useReducer((Z,L)=>{if(L.type===ph)return{...Z,state:L.state};const Q=u(Z,L);return j&&!Object.is(Q.state,Z.state)&&y(Q.state),Q},...p),Y=M.state,B=g.useRef(Y);g.useEffect(()=>{B.current!==Y&&(B.current=Y,j||y(Y))},[Y,B,j]);const X=g.useMemo(()=>m!==void 0?{...M,state:m}:M,[M,m]);return g.useEffect(()=>{j&&!Object.is(m,M.state)&&O({type:ph,state:m})},[m,M.state,j]),[X,O]}Ti(sy,"useControllableStateReducer");var oy=Object.defineProperty,Lo=(u,r)=>oy(u,"name",{value:r,configurable:!0});function No(u,r){if(typeof u=="function")return u(r);u!=null&&(u.current=r)}Lo(No,"setRef");function wh(...u){return r=>{let f=!1;const o=u.map(m=>{const h=No(m,r);return!f&&typeof h=="function"&&(f=!0),h});if(f)return()=>{for(let m=0;mry(u,"name",{value:r,configurable:!0});function zn(u){const r=g.forwardRef((f,o)=>{let{children:m,...h}=f,_=null,E=!1;const j=[];Ro(m)&&typeof Ku=="function"&&(m=Ku(m._payload)),g.Children.forEach(m,O=>{if(Hh(O)){E=!0;const Y=O;let B="child"in Y.props?Y.props.child:Y.props.children;Ro(B)&&typeof Ku=="function"&&(B=Ku(B._payload)),_=dy(Y,B),j.push(_?.props?.children)}else j.push(O)}),_?_=g.cloneElement(_,void 0,j):!E&&g.Children.count(m)===1&&g.isValidElement(m)&&(_=m);const y=_?Bh(_):void 0,p=ul(o,y);if(!_){if(m||m===0)throw new Error(E?py(u):hy(u));return m}const M=Gh(h,_.props??{});return _.type!==g.Fragment&&(M.ref=o?p:y),g.cloneElement(_,M)});return r.displayName=`${u}.Slot`,r}sl(zn,"createSlot");var Uh=Symbol.for("radix.slottable");function fy(u){const r=sl(f=>"child"in f?f.children(f.child):f.children,"Slottable");return r.displayName=`${u}.Slottable`,r.__radixId=Uh,r}sl(fy,"createSlottable");var dy=sl((u,r)=>{if("child"in u.props){const f=u.props.child;return g.isValidElement(f)?g.cloneElement(f,void 0,u.props.children(f.props.children)):null}return g.isValidElement(r)?r:null},"getSlottableElementFromSlottable");function Gh(u,r){const f={...r};for(const o in r){const m=u[o],h=r[o];/^on[A-Z]/.test(o)?m&&h?f[o]=(...E)=>{const j=h(...E);return m(...E),j}:m&&(f[o]=m):o==="style"?f[o]={...m,...h}:o==="className"&&(f[o]=[m,h].filter(Boolean).join(" "))}return{...u,...f}}sl(Gh,"mergeProps");function Bh(u){let r=Object.getOwnPropertyDescriptor(u.props,"ref")?.get,f=r&&"isReactWarning"in r&&r.isReactWarning;return f?u.ref:(r=Object.getOwnPropertyDescriptor(u,"ref")?.get,f=r&&"isReactWarning"in r&&r.isReactWarning,f?u.props.ref:u.props.ref||u.ref)}sl(Bh,"getElementRef");function Hh(u){return g.isValidElement(u)&&typeof u.type=="function"&&"__radixId"in u.type&&u.type.__radixId===Uh}sl(Hh,"isSlottable");var my=Symbol.for("react.lazy");function Ro(u){return u!=null&&typeof u=="object"&&"$$typeof"in u&&u.$$typeof===my&&"_payload"in u&&kh(u._payload)}sl(Ro,"isLazyComponent");function kh(u){return typeof u=="object"&&u!==null&&"then"in u}sl(kh,"isPromiseLike");var hy=sl(u=>`${u} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),py=sl(u=>`${u} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Ku=Nn[" use ".trim().toString()],vy=Object.defineProperty,gy=(u,r)=>vy(u,"name",{value:r,configurable:!0}),yy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],zt=yy.reduce((u,r)=>{const f=zn(`Primitive.${r}`),o=g.forwardRef((m,h)=>{const{asChild:_,...E}=m,j=_?f:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(j,{...E,ref:h})});return o.displayName=`Primitive.${r}`,{...u,[r]:o}},{});function by(u,r){u&&qo.flushSync(()=>u.dispatchEvent(r))}gy(by,"dispatchDiscreteCustomEvent");var Sy=Object.defineProperty,Hl=(u,r)=>Sy(u,"name",{value:r,configurable:!0});function qh(u,r){return g.useReducer((f,o)=>r[f][o]??f,u)}Hl(qh,"useStateMachine");var Lh=Hl(u=>{const{present:r,children:f}=u,o=Yh(r),m=typeof f=="function"?f({present:o.isPresent}):g.Children.only(f),h=Vh(o.ref,Xh(m));return typeof f=="function"||o.isPresent?g.cloneElement(m,{ref:h}):null},"Presence");function Yh(u){const[r,f]=g.useState(),o=g.useRef(null),m=g.useRef(u),h=g.useRef("none"),_=g.useRef(void 0),E=u?"mounted":"unmounted",[j,y]=qh(E,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{j==="mounted"?(h.current=_.current??An(o.current),_.current=void 0):h.current="none"},[j]),ma(()=>{const p=o.current,M=m.current;if(M!==u){const Y=h.current,B=An(p);u?(_.current=B,y("MOUNT")):B==="none"||p?.display==="none"?y("UNMOUNT"):y(M&&Y!==B?"ANIMATION_OUT":"UNMOUNT"),m.current=u}},[u,y]),ma(()=>{if(r){let p;const M=r.ownerDocument.defaultView??window,O=Hl(B=>{const Z=An(o.current).includes(CSS.escape(B.animationName));if(B.target===r&&Z&&(y("ANIMATION_END"),!m.current)){const L=r.style.animationFillMode;r.style.animationFillMode="forwards",p=M.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=L)})}},"handleAnimationEnd"),Y=Hl(B=>{B.target===r&&(h.current=An(o.current))},"handleAnimationStart");return r.addEventListener("animationstart",Y),r.addEventListener("animationcancel",O),r.addEventListener("animationend",O),()=>{M.clearTimeout(p),r.removeEventListener("animationstart",Y),r.removeEventListener("animationcancel",O),r.removeEventListener("animationend",O)}}else y("ANIMATION_END")},[r,y]),{isPresent:["mounted","unmountSuspended"].includes(j),ref:g.useCallback(p=>{if(p){const M=getComputedStyle(p);o.current=M,_.current=An(M)}else o.current=null;f(p)},[])}}Hl(Yh,"usePresence");function Oo(u,r){if(typeof u=="function")return u(r);u!=null&&(u.current=r)}Hl(Oo,"setRef");function Vh(...u){const r=g.useRef(u);return r.current=u,g.useCallback(f=>{const o=r.current;let m=!1;const h=o.map(_=>{const E=Oo(_,f);return!m&&typeof E=="function"&&(m=!0),E});if(m)return()=>{for(let _=0;__y(u,"name",{value:r,configurable:!0}),jy=Nn[" useId ".trim().toString()]||(()=>{}),My=0;function Fu(u){const[r,f]=g.useState(jy());return ma(()=>{u||f(o=>o??String(My++))},[u]),u||(r?`radix-${r}`:"")}xy(Fu,"useId");var Cy=Object.defineProperty,zi=(u,r)=>Cy(u,"name",{value:r,configurable:!0}),Yo="Collapsible",[Ey,x1]=va(Yo),[Ty,Vo]=Ey(Yo),Ay=g.forwardRef(zi(function(r,f){const{__scopeCollapsible:o,open:m,defaultOpen:h,disabled:_,onOpenChange:E,...j}=r,[y,p]=Ai({prop:m,defaultProp:h??!1,onChange:E,caller:Yo});return c.jsx(Ty,{scope:o,disabled:_,contentId:Fu(),open:y,onOpenToggle:g.useCallback(()=>p(M=>!M),[p]),children:c.jsx(zt.div,{"data-state":Wu(y),"data-disabled":_?"":void 0,...j,ref:f})})},"Collapsible")),zy="CollapsibleTrigger",Ny=g.forwardRef(zi(function(r,f){const{__scopeCollapsible:o,...m}=r,h=Vo(zy,o);return c.jsx(zt.button,{type:"button","aria-controls":h.open?h.contentId:void 0,"aria-expanded":h.open||!1,"data-state":Wu(h.open),"data-disabled":h.disabled?"":void 0,disabled:h.disabled,...m,ref:f,onClick:kt(r.onClick,h.onOpenToggle)})},"CollapsibleTrigger")),Qh="CollapsibleContent",Ry=g.forwardRef(zi(function(r,f){const{forceMount:o,...m}=r,h=Vo(Qh,r.__scopeCollapsible);return c.jsx(Lh,{present:o||h.open,children:({present:_})=>c.jsx(Oy,{...m,ref:f,present:_})})},"CollapsibleContent")),Oy=g.forwardRef(zi(function(r,f){const{__scopeCollapsible:o,present:m,children:h,..._}=r,E=Vo(Qh,o),[j,y]=g.useState(m),p=g.useRef(null),M=ul(f,p),O=g.useRef(0),Y=O.current,B=g.useRef(0),X=B.current,Z=E.open||j,L=g.useRef(Z),Q=g.useRef(void 0);return g.useEffect(()=>{const k=requestAnimationFrame(()=>L.current=!1);return()=>cancelAnimationFrame(k)},[]),ma(()=>{const k=p.current;if(k){Q.current=Q.current||{transitionDuration:k.style.transitionDuration,animationName:k.style.animationName},k.style.transitionDuration="0s",k.style.animationName="none";const H=k.getBoundingClientRect();O.current=H.height,B.current=H.width,L.current||(k.style.transitionDuration=Q.current.transitionDuration,k.style.animationName=Q.current.animationName),y(m)}},[E.open,m]),c.jsx(zt.div,{"data-state":Wu(E.open),"data-disabled":E.disabled?"":void 0,id:E.contentId,hidden:!Z,..._,ref:M,style:{"--radix-collapsible-content-height":Y?`${Y}px`:void 0,"--radix-collapsible-content-width":X?`${X}px`:void 0,...r.style},children:Z&&h})},"CollapsibleContentImpl"));function Wu(u){return u?"open":"closed"}zi(Wu,"getState");var Dy=Ay,wy=Ny,Uy=Ry,Gy=Object.defineProperty,kl=(u,r)=>Gy(u,"name",{value:r,configurable:!0}),Zh="Progress",Xo=100,[By,j1]=va(Zh),[Hy,ky]=By(Zh),qy=g.forwardRef(kl(function(r,f){const{__scopeProgress:o,value:m=null,max:h,getValueLabel:_=Kh,...E}=r;(h||h===0)&&!Do(h)&&console.error(Jh(`${h}`,"Progress"));const j=Do(h)?h:Xo;m!==null&&!wo(m,j)&&console.error($h(`${m}`,"Progress"));const y=wo(m,j)?m:null,p=Ci(y)?_(y,j):void 0;return c.jsx(Hy,{scope:o,value:y,max:j,children:c.jsx(zt.div,{"aria-valuemax":j,"aria-valuemin":0,"aria-valuenow":Ci(y)?y:void 0,"aria-valuetext":p,role:"progressbar","data-state":Qo(y,j),"data-value":y??void 0,"data-max":j,...E,ref:f})})},"Progress")),Ly="ProgressIndicator",Yy=g.forwardRef(kl(function(r,f){const{__scopeProgress:o,...m}=r,h=ky(Ly,o);return c.jsx(zt.div,{"data-state":Qo(h.value,h.max),"data-value":h.value??void 0,"data-max":h.max,...m,ref:f})},"ProgressIndicator"));function Kh(u,r){return`${Math.round(u/r*100)}%`}kl(Kh,"defaultGetValueLabel");function Qo(u,r){return u==null?"indeterminate":u===r?"complete":"loading"}kl(Qo,"getProgressState");function Ci(u){return typeof u=="number"}kl(Ci,"isNumber");function Do(u){return Ci(u)&&!isNaN(u)&&u>0}kl(Do,"isValidMaxNumber");function wo(u,r){return Ci(u)&&!isNaN(u)&&u<=r&&u>=0}kl(wo,"isValidValueNumber");function Jh(u,r){return`Invalid prop \`max\` of value \`${u}\` supplied to \`${r}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Xo}\`.`}kl(Jh,"getInvalidMaxError");function $h(u,r){return`Invalid prop \`value\` of value \`${u}\` supplied to \`${r}\`. The \`value\` prop must be: - a positive number - - less than the value passed to \`max\` (or ${Lo} if no \`max\` prop is set) + - less than the value passed to \`max\` (or ${Xo} if no \`max\` prop is set) - \`null\` or \`undefined\` if the progress is indeterminate. -Defaulting to \`null\`.`}Gl(Jh,"getInvalidValueError");var Vy=qy,Xy=Yy,Qy=Object.defineProperty,Zy=(u,r)=>Qy(u,"name",{value:r,configurable:!0});function $h(u){const[r,f]=g.useState(void 0);return sa(()=>{if(u){f({width:u.offsetWidth,height:u.offsetHeight});const o=new ResizeObserver(m=>{if(!Array.isArray(m)||!m.length)return;const h=m[0];let S,E;if("borderBoxSize"in h){const j=h.borderBoxSize,y=Array.isArray(j)?j[0]:j;S=y.inlineSize,E=y.blockSize}else S=u.offsetWidth,E=u.offsetHeight;f({width:S,height:E})});return o.observe(u,{box:"border-box"}),()=>o.unobserve(u)}else f(void 0)},[u]),r}Zy($h,"useSize");var Ky=Object.defineProperty,oa=(u,r)=>Ky(u,"name",{value:r,configurable:!0}),Vo="Switch",[Jy,M1]=ra(Vo),[$y,Xo]=Jy(Vo);function Fh(u){const{__scopeSwitch:r,checked:f,children:o,defaultChecked:m,disabled:h,form:S,name:E,onCheckedChange:j,required:y,value:p="on",internal_do_not_use_render:M}=u,[O,Y]=Ci({prop:f,defaultProp:m??!1,onChange:j,caller:Vo}),[H,V]=g.useState(null),[X,k]=g.useState(null),Z=g.useRef(!1),[w,q]=g.useReducer(K=>K+1,0),$=H?!!S||!!H.closest("form"):!0,W={checked:O,setChecked:Y,disabled:h,control:H,setControl:V,name:E,form:S,value:p,hasConsumerStoppedPropagationRef:Z,userInteractionCount:w,onUserInteraction:q,required:y,defaultChecked:m,isFormControl:$,bubbleInput:X,setBubbleInput:k};return c.jsx($y,{scope:r,...W,children:Wh(M)?M(W):o})}oa(Fh,"SwitchProvider");var Fy="SwitchTrigger",Wy=g.forwardRef(oa(function({__scopeSwitch:r,onClick:f,...o},m){const{control:h,form:S,value:E,disabled:j,checked:y,required:p,setControl:M,setChecked:O,hasConsumerStoppedPropagationRef:Y,onUserInteraction:H,isFormControl:V,bubbleInput:X}=Xo(Fy,r),k=ll(m,M),Z=g.useRef(y);return g.useEffect(()=>{const w=S?h?.ownerDocument.getElementById(S):h?.form;if(w instanceof HTMLFormElement){const q=oa(()=>O(Z.current),"reset");return w.addEventListener("reset",q),()=>w.removeEventListener("reset",q)}},[h,S,O]),c.jsx(Et.button,{type:"button",role:"switch","aria-checked":y,"aria-required":p,"data-state":Qo(y),"data-disabled":j?"":void 0,disabled:j,value:E,...o,ref:k,onClick:Bt(f,w=>{H(),O(q=>!q),X&&V&&(Y.current=w.isPropagationStopped(),Y.current||w.stopPropagation())})})},"SwitchTrigger")),Iy=g.forwardRef(oa(function(r,f){const{__scopeSwitch:o,name:m,checked:h,defaultChecked:S,required:E,disabled:j,value:y,onCheckedChange:p,form:M,...O}=r;return c.jsx(Fh,{__scopeSwitch:o,checked:h,defaultChecked:S,disabled:j,required:E,onCheckedChange:p,name:m,form:M,value:y,internal_do_not_use_render:({isFormControl:Y})=>c.jsxs(c.Fragment,{children:[c.jsx(Wy,{...O,ref:f,__scopeSwitch:o}),Y&&c.jsx(l0,{__scopeSwitch:o})]})})},"Switch")),Py="SwitchThumb",e0=g.forwardRef(oa(function(r,f){const{__scopeSwitch:o,...m}=r,h=Xo(Py,o);return c.jsx(Et.span,{"data-state":Qo(h.checked),"data-disabled":h.disabled?"":void 0,...m,ref:f})},"SwitchThumb")),t0="SwitchBubbleInput",l0=g.forwardRef(oa(function({__scopeSwitch:r,onClick:f,...o},m){const{control:h,hasConsumerStoppedPropagationRef:S,userInteractionCount:E,checked:j,defaultChecked:y,required:p,disabled:M,name:O,value:Y,form:H,bubbleInput:V,setBubbleInput:X}=Xo(t0,r),k=ll(m,X),Z=$h(h),w=g.useRef(!1),q=g.useRef(j),$=g.useRef(E);g.useEffect(()=>{const K=V;if(!K)return;const ne=window.HTMLInputElement.prototype,Me=Object.getOwnPropertyDescriptor(ne,"checked").set,Ce=E!==$.current;$.current=E;const xe=q.current!==j;q.current=j;const ce=!(Ce&&S.current);if(xe&&Me){w.current=!Ce;const Ne=new Event("click",{bubbles:ce});Me.call(K,j),K.dispatchEvent(Ne),w.current=!1}},[V,j,S,E]);const W=g.useRef(j);return c.jsx(Et.input,{type:"checkbox","aria-hidden":!0,defaultChecked:y??W.current,required:p,disabled:M,name:O,value:Y,form:H,...o,tabIndex:-1,ref:k,onClick:Bt(f,K=>{w.current&&K.stopPropagation()}),style:{...o.style,...Z,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function Wh(u){return typeof u=="function"}oa(Wh,"isFunction");function Qo(u){return u?"checked":"unchecked"}oa(Qo,"getState");var a0=Object.defineProperty,ut=(u,r)=>a0(u,"name",{value:r,configurable:!0});function Ih(u){const r=u+"CollectionProvider",[f,o]=ra(r),[m,h]=f(r,{collectionRef:{current:null},itemMap:new Map}),S=ut(V=>{const{scope:X,children:k}=V,Z=g.useRef(null),w=g.useRef(new Map).current;return c.jsx(m,{scope:X,itemMap:w,collectionRef:Z,children:k})},"CollectionProvider");S.displayName=r;const E=u+"CollectionSlot",j=Mn(E),y=g.forwardRef((V,X)=>{const{scope:k,children:Z}=V,w=h(E,k),q=ll(X,w.collectionRef);return c.jsx(j,{ref:q,children:Z})});y.displayName=E;const p=u+"CollectionItemSlot",M="data-radix-collection-item",O=Mn(p),Y=g.forwardRef((V,X)=>{const{scope:k,children:Z,...w}=V,q=g.useRef(null),$=ll(X,q),W=h(p,k);return g.useEffect(()=>(W.itemMap.set(q,{ref:q,...w}),()=>{W.itemMap.delete(q)})),c.jsx(O,{[M]:"",ref:$,children:Z})});Y.displayName=p;function H(V){const X=h(u+"CollectionConsumer",V);return g.useCallback(()=>{const Z=X.collectionRef.current;if(!Z)return[];const w=Array.from(Z.querySelectorAll(`[${M}]`));return Array.from(X.itemMap.values()).sort((W,K)=>w.indexOf(W.ref.current)-w.indexOf(K.ref.current))},[X.collectionRef,X.itemMap])}return ut(H,"useCollection"),[{Provider:S,Slot:y,ItemSlot:Y},H,o]}ut(Ih,"createCollection");var ph=new WeakMap,tt,Ut,bo=(Ut=class extends Map{constructor(f){super(f);th(this,tt);fo(this,tt,[...super.keys()]),ph.set(this,!0)}set(f,o){return ph.get(this)&&(this.has(f)?pt(this,tt)[pt(this,tt).indexOf(f)]=f:pt(this,tt).push(f)),super.set(f,o),this}insert(f,o,m){const h=this.has(o),S=pt(this,tt).length,E=Zo(f);let j=E>=0?E:S+E;const y=j<0||j>=S?-1:j;if(y===this.size||h&&y===this.size-1||y===-1)return this.set(o,m),this;const p=this.size+(h?0:1);E<0&&j++;const M=[...pt(this,tt)];let O,Y=!1;for(let H=j;H=this.size&&(h=this.size-1),this.at(h)}keyFrom(f,o){const m=this.indexOf(f);if(m===-1)return;let h=m+o;return h<0&&(h=0),h>=this.size&&(h=this.size-1),this.keyAt(h)}find(f,o){let m=0;for(const h of this){if(Reflect.apply(f,o,[h,m,this]))return h;m++}}findIndex(f,o){let m=0;for(const h of this){if(Reflect.apply(f,o,[h,m,this]))return m;m++}return-1}filter(f,o){const m=[];let h=0;for(const S of this)Reflect.apply(f,o,[S,h,this])&&m.push(S),h++;return new Ut(m)}map(f,o){const m=[];let h=0;for(const S of this)m.push([S[0],Reflect.apply(f,o,[S,h,this])]),h++;return new Ut(m)}reduce(...f){const[o,m]=f;let h=0,S=m??this.at(0);for(const E of this)h===0&&f.length===1?S=E:S=Reflect.apply(o,this,[S,E,h,this]),h++;return S}reduceRight(...f){const[o,m]=f;let h=m??this.at(-1);for(let S=this.size-1;S>=0;S--){const E=this.at(S);S===this.size-1&&f.length===1?h=E:h=Reflect.apply(o,this,[h,E,S,this])}return h}toSorted(f){const o=[...this.entries()].sort(f);return new Ut(o)}toReversed(){const f=new Ut;for(let o=this.size-1;o>=0;o--){const m=this.keyAt(o),h=this.get(m);f.set(m,h)}return f}toSpliced(...f){const o=[...this.entries()];return o.splice(...f),new Ut(o)}slice(f,o){const m=new Ut;let h=this.size-1;if(f===void 0)return m;f<0&&(f=f+this.size),o!==void 0&&o>0&&(h=o-1);for(let S=f;S<=h;S++){const E=this.keyAt(S),j=this.get(E);m.set(E,j)}return m}every(f,o){let m=0;for(const h of this){if(!Reflect.apply(f,o,[h,m,this]))return!1;m++}return!0}some(f,o){let m=0;for(const h of this){if(Reflect.apply(f,o,[h,m,this]))return!0;m++}return!1}},tt=new WeakMap,ut(Ut,"OrderedDict"),Ut);function Xu(u,r){if("at"in Array.prototype)return Array.prototype.at.call(u,r);const f=Ph(u,r);return f===-1?void 0:u[f]}ut(Xu,"at");function Ph(u,r){const f=u.length,o=Zo(r),m=o>=0?o:f+o;return m<0||m>=f?-1:m}ut(Ph,"toSafeIndex");function Zo(u){return u!==u||u===0?0:Math.trunc(u)}ut(Zo,"toSafeInteger");function n0(u){const r=u+"CollectionProvider",[f,o]=ra(r),[m,h]=f(r,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new bo,setItemMap:ut(()=>{},"setItemMap")}),S=ut(({state:w,...q})=>w?c.jsx(j,{...q,state:w}):c.jsx(E,{...q}),"CollectionProvider");S.displayName=r;const E=ut(w=>{const q=X();return c.jsx(j,{...w,state:q})},"CollectionInit");E.displayName=r+"Init";const j=ut(w=>{const{scope:q,children:$,state:W}=w,K=g.useRef(null),[ne,ee]=g.useState(null),Me=ll(K,ee),[Ce,xe]=W;return g.useEffect(()=>{if(!ne)return;const ce=lp(()=>{});return ce.observe(ne,{childList:!0,subtree:!0}),()=>{ce.disconnect()}},[ne]),c.jsx(m,{scope:q,itemMap:Ce,setItemMap:xe,collectionRef:Me,collectionRefObject:K,collectionElement:ne,children:$})},"CollectionProviderImpl");j.displayName=r+"Impl";const y=u+"CollectionSlot",p=Mn(y),M=g.forwardRef((w,q)=>{const{scope:$,children:W}=w,K=h(y,$),ne=ll(q,K.collectionRef);return c.jsx(p,{ref:ne,children:W})});M.displayName=y;const O=u+"CollectionItemSlot",Y="data-radix-collection-item",H=Mn(O),V=g.forwardRef((w,q)=>{const{scope:$,children:W,...K}=w,ne=g.useRef(null),[ee,Me]=g.useState(null),Ce=ll(q,ne,Me),xe=h(O,$),{setItemMap:ce}=xe,Ne=g.useRef(K);ep(Ne.current,K)||(Ne.current=K);const Ye=Ne.current;return g.useEffect(()=>{const R=Ye;return ce(L=>ee?L.has(ee)?L.set(ee,{...R,element:ee}).toSorted(Oo):(L.set(ee,{...R,element:ee}),L.toSorted(Oo)):L),()=>{ce(L=>!ee||!L.has(ee)?L:(L.delete(ee),new bo(L)))}},[ee,Ye,ce]),c.jsx(H,{[Y]:"",ref:Ce,children:W})});V.displayName=O;function X(){return g.useState(new bo)}ut(X,"useInitCollection");function k(w){const{itemMap:q}=h(u+"CollectionConsumer",w);return q}return ut(k,"useCollection"),[{Provider:S,Slot:M,ItemSlot:V},{createCollectionScope:o,useCollection:k,useInitCollection:X}]}ut(n0,"createCollection");function ep(u,r){if(u===r)return!0;if(typeof u!="object"||typeof r!="object"||u==null||r==null)return!1;const f=Object.keys(u),o=Object.keys(r);if(f.length!==o.length)return!1;for(const m of f)if(!Object.prototype.hasOwnProperty.call(r,m)||u[m]!==r[m])return!1;return!0}ut(ep,"shallowEqual");function tp(u,r){return!!(r.compareDocumentPosition(u)&Node.DOCUMENT_POSITION_PRECEDING)}ut(tp,"isElementPreceding");function Oo(u,r){return!u[1].element||!r[1].element?0:tp(u[1].element,r[1].element)?-1:1}ut(Oo,"sortByDocumentPosition");function lp(u){return new MutationObserver(f=>{for(const o of f)if(o.type==="childList"){u();return}})}ut(lp,"getChildListObserver");var i0=Object.defineProperty,u0=(u,r)=>i0(u,"name",{value:r,configurable:!0});function ap(u){const r=g.useRef(u);return g.useEffect(()=>{r.current=u}),g.useMemo(()=>((...f)=>r.current?.(...f)),[])}u0(ap,"useCallbackRef");var c0=Object.defineProperty,s0=(u,r)=>c0(u,"name",{value:r,configurable:!0}),o0=g.createContext(void 0);function Ko(u){const r=g.useContext(o0);return u||r||"ltr"}s0(Ko,"useDirection");var r0=Object.defineProperty,Jo=(u,r)=>r0(u,"name",{value:r,configurable:!0}),So=!1;function np(){const[u,r]=g.useState(So);return g.useEffect(()=>{So||(So=!0,r(!0))},[]),u}Jo(np,"useIsHydrated");var ip=En[" useSyncExternalStore ".trim().toString()];function up(){return()=>{}}Jo(up,"subscribe");function cp(){return ip(up,()=>!0,()=>!1)}Jo(cp,"useIsHydratedModern");var f0=typeof ip=="function"?cp:np,d0=Object.defineProperty,Ua=(u,r)=>d0(u,"name",{value:r,configurable:!0}),_o="rovingFocusGroup.onEntryFocus",m0={bubbles:!1,cancelable:!0},Ju="RovingFocusGroup",[Do,sp,h0]=Ih(Ju),[p0,op]=ra(Ju,[h0]),[v0,g0]=p0(Ju),y0=g.forwardRef(Ua(function(r,f){return c.jsx(Do.Provider,{scope:r.__scopeRovingFocusGroup,children:c.jsx(Do.Slot,{scope:r.__scopeRovingFocusGroup,children:c.jsx(b0,{...r,ref:f})})})},"RovingFocusGroup")),b0=g.forwardRef(Ua(function(r,f){const{__scopeRovingFocusGroup:o,orientation:m,loop:h=!1,dir:S,currentTabStopId:E,defaultCurrentTabStopId:j,onCurrentTabStopIdChange:y,onEntryFocus:p,preventScrollOnEntryFocus:M=!1,...O}=r,Y=g.useRef(null),H=ll(f,Y),V=Ko(S),[X,k]=Ci({prop:E,defaultProp:j??null,onChange:y,caller:Ju}),[Z,w]=g.useState(!1),q=ap(p),$=sp(o),W=g.useRef(!1),[K,ne]=g.useState(0);return g.useEffect(()=>{const ee=Y.current;if(ee)return ee.addEventListener(_o,q),()=>ee.removeEventListener(_o,q)},[q]),c.jsx(v0,{scope:o,orientation:m,dir:V,loop:h,currentTabStopId:X,onItemFocus:g.useCallback(ee=>k(ee),[k]),onItemShiftTab:g.useCallback(()=>w(!0),[]),onFocusableItemAdd:g.useCallback(()=>ne(ee=>ee+1),[]),onFocusableItemRemove:g.useCallback(()=>ne(ee=>ee-1),[]),children:c.jsx(Et.div,{tabIndex:Z||K===0?-1:0,"data-orientation":m,...O,ref:H,style:{outline:"none",...r.style},onMouseDown:Bt(r.onMouseDown,()=>{W.current=!0}),onFocus:Bt(r.onFocus,ee=>{const Me=!W.current;if(ee.target===ee.currentTarget&&Me&&!Z){const Ce=new CustomEvent(_o,m0);if(ee.currentTarget.dispatchEvent(Ce),!Ce.defaultPrevented){const xe=$().filter(L=>L.focusable),ce=xe.find(L=>L.active),Ne=xe.find(L=>L.id===X),R=[ce,Ne,...xe].filter(Boolean).map(L=>L.ref.current);$o(R,M)}}W.current=!1}),onBlur:Bt(r.onBlur,()=>w(!1))})})},"RovingFocusGroupImpl")),S0="RovingFocusGroupItem",_0=g.forwardRef(Ua(function(r,f){const{__scopeRovingFocusGroup:o,focusable:m=!0,active:h=!1,tabStopId:S,children:E,...j}=r,y=Zu(),p=S||y,M=g0(S0,o),O=M.currentTabStopId===p,Y=sp(o),{onFocusableItemAdd:H,onFocusableItemRemove:V,currentTabStopId:X}=M,k=f0();return sa(()=>{if(!(!k||!m))return H(),()=>V()},[k,m,H,V]),g.useEffect(()=>{if(!(k||!m))return H(),()=>V()},[k,m,H,V]),c.jsx(Do.ItemSlot,{scope:o,id:p,focusable:m,active:h,children:c.jsx(Et.span,{tabIndex:O?0:-1,"data-orientation":M.orientation,...j,ref:f,onMouseDown:Bt(r.onMouseDown,Z=>{m?M.onItemFocus(p):Z.preventDefault()}),onFocus:Bt(r.onFocus,()=>M.onItemFocus(p)),onKeyDown:Bt(r.onKeyDown,Z=>{if(Z.key==="Tab"&&Z.shiftKey){M.onItemShiftTab();return}if(Z.target!==Z.currentTarget)return;const w=fp(Z,M.orientation,M.dir);if(w!==void 0){if(Z.metaKey||Z.ctrlKey||Z.altKey||Z.shiftKey)return;Z.preventDefault();let $=Y().filter(W=>W.focusable).map(W=>W.ref.current);if(w==="last")$.reverse();else if(w==="prev"||w==="next"){w==="prev"&&$.reverse();const W=$.indexOf(Z.currentTarget);$=M.loop?dp($,W+1):$.slice(W+1)}setTimeout(()=>$o($))}}),children:typeof E=="function"?E({isCurrentTabStop:O,hasTabStop:X!=null}):E})})},"RovingFocusGroupItem")),x0={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function rp(u,r){return r!=="rtl"?u:u==="ArrowLeft"?"ArrowRight":u==="ArrowRight"?"ArrowLeft":u}Ua(rp,"getDirectionAwareKey");function fp(u,r,f){const o=rp(u.key,f);if(!(r==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(r==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return x0[o]}Ua(fp,"getFocusIntent");function $o(u,r=!1){const f=document.activeElement;for(const o of u)if(o===f||(o.focus({preventScroll:r}),document.activeElement!==f))return}Ua($o,"focusFirst");function dp(u,r){return u.map((f,o)=>u[(r+o)%u.length])}Ua(dp,"wrapArray");var j0=y0,M0=_0,C0=Object.defineProperty,An=(u,r)=>C0(u,"name",{value:r,configurable:!0}),Fo="Tabs",[E0,C1]=ra(Fo,[op]),mp=op(),[T0,Wo]=E0(Fo),A0=g.forwardRef(An(function(r,f){const{__scopeTabs:o,value:m,onValueChange:h,defaultValue:S,orientation:E="horizontal",dir:j,activationMode:y="automatic",...p}=r,M=Ko(j),[O,Y]=Ci({prop:m,onChange:h,defaultProp:S??"",caller:Fo});return c.jsx(T0,{scope:o,baseId:Zu(),value:O,onValueChange:Y,orientation:E,dir:M,activationMode:y,children:c.jsx(Et.div,{dir:M,"data-orientation":E,...p,ref:f})})},"Tabs")),z0="TabsList",N0=g.forwardRef(An(function(r,f){const{__scopeTabs:o,loop:m=!0,...h}=r,S=Wo(z0,o),E=mp(o);return c.jsx(j0,{asChild:!0,...E,orientation:S.orientation,dir:S.dir,loop:m,children:c.jsx(Et.div,{role:"tablist","aria-orientation":S.orientation,...h,ref:f})})},"TabsList")),R0="TabsTrigger",O0=g.forwardRef(An(function(r,f){const{__scopeTabs:o,value:m,disabled:h=!1,...S}=r,E=Wo(R0,o),j=mp(o),y=Io(E.baseId,m),p=Po(E.baseId,m),M=m===E.value;return c.jsx(M0,{asChild:!0,...j,focusable:!h,active:M,children:c.jsx(Et.button,{type:"button",role:"tab","aria-selected":M,"aria-controls":p,"data-state":M?"active":"inactive","data-disabled":h?"":void 0,disabled:h,id:y,...S,ref:f,onMouseDown:Bt(r.onMouseDown,O=>{!h&&O.button===0&&O.ctrlKey===!1?E.onValueChange(m):O.preventDefault()}),onKeyDown:Bt(r.onKeyDown,O=>{h||O.target!==O.currentTarget||[" ","Enter"].includes(O.key)&&E.onValueChange(m)}),onFocus:Bt(r.onFocus,()=>{const O=E.activationMode!=="manual";!M&&!h&&O&&E.onValueChange(m)})})})},"TabsTrigger")),D0="TabsContent",w0=g.forwardRef(An(function(r,f){const{__scopeTabs:o,value:m,forceMount:h,children:S,...E}=r,j=Wo(D0,o),y=Io(j.baseId,m),p=Po(j.baseId,m),M=m===j.value,O=g.useRef(M);return g.useEffect(()=>{const Y=requestAnimationFrame(()=>O.current=!1);return()=>cancelAnimationFrame(Y)},[]),c.jsx(qh,{present:h||M,children:({present:Y})=>c.jsx(Et.div,{"data-state":M?"active":"inactive","data-orientation":j.orientation,role:"tabpanel","aria-labelledby":y,hidden:!Y,id:p,tabIndex:0,...E,ref:f,style:{...r.style,animationDuration:O.current?"0s":void 0},children:Y&&S})})},"TabsContent"));function Io(u,r){return`${u}-trigger-${r}`}An(Io,"makeTriggerId");function Po(u,r){return`${u}-content-${r}`}An(Po,"makeContentId");var U0=A0,G0=N0,xo=O0,jo=w0;const B0=u=>u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),hp=(...u)=>u.filter((r,f,o)=>!!r&&r.trim()!==""&&o.indexOf(r)===f).join(" ").trim();var H0={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"};const k0=g.forwardRef(({color:u="currentColor",size:r=24,strokeWidth:f=2,absoluteStrokeWidth:o,className:m="",children:h,iconNode:S,...E},j)=>g.createElement("svg",{ref:j,...H0,width:r,height:r,stroke:u,strokeWidth:o?Number(f)*24/Number(r):f,className:hp("lucide",m),...E},[...S.map(([y,p])=>g.createElement(y,p)),...Array.isArray(h)?h:[h]]));const ke=(u,r)=>{const f=g.forwardRef(({className:o,...m},h)=>g.createElement(k0,{ref:h,iconNode:r,className:hp(`lucide-${B0(u)}`,o),...m}));return f.displayName=`${u}`,f};const pp=ke("Activity",[["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"}]]);const q0=ke("Box",[["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"}]]);const al=ke("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const vp=ke("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const gp=ke("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);const yp=ke("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const L0=ke("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Ti=ke("CircleAlert",[["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"}]]);const Y0=ke("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const bp=ke("Copy",[["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"}]]);const V0=ke("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);const vh=ke("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);const Sp=ke("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);const _p=ke("FolderUp",[["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"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);const X0=ke("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);const gh=ke("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);const wo=ke("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const Q0=ke("MonitorCog",[["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m15.2 4.9-.9-.4",key:"12wd2u"}],["path",{d:"m15.2 7.1-.9.4",key:"1r2vl7"}],["path",{d:"m16.9 3.2-.4-.9",key:"3zbo91"}],["path",{d:"m16.9 8.8-.4.9",key:"1qr2dn"}],["path",{d:"m19.5 2.3-.4.9",key:"1rjrkq"}],["path",{d:"m19.5 9.7-.4-.9",key:"heryx5"}],["path",{d:"m21.7 4.5-.9.4",key:"17fqt1"}],["path",{d:"m21.7 7.5-.9-.4",key:"14zyni"}],["path",{d:"M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7",key:"1tnzv8"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}]]);const xp=ke("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const tl=ke("RefreshCw",[["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"}]]);const Qu=ke("Server",[["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"}]]);const Z0=ke("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);const $u=ke("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const er=ke("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);const K0=ke("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);const Da=ke("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);async function jp(u){try{return await navigator.clipboard.writeText(u),!0}catch{const r=document.createElement("textarea");r.value=u,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.focus(),r.select();try{return document.execCommand("copy")}catch{return!1}finally{r.remove()}}}function J0({deployment:u,onCancel:r,onClose:f}){const o=g.useRef(null),m=g.useRef(null),[h,S]=g.useState(!1),E=u.log_tail.join(` -`)||"Waiting for Modal build output…";g.useEffect(()=>{const y=p=>{p.key==="Escape"&&f()};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[f]),g.useEffect(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},[u.log_tail.length]),g.useEffect(()=>()=>{m.current!==null&&window.clearTimeout(m.current)},[]);const j=async()=>{await jp(E)&&(S(!0),m.current!==null&&window.clearTimeout(m.current),m.current=window.setTimeout(()=>S(!1),1e3))};return Bo.createPortal(c.jsx("div",{className:"modal-log-backdrop",onMouseDown:y=>{y.target===y.currentTarget&&f()},children:c.jsxs("section",{className:"modal-log-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"modal-log-title",children:[c.jsxs("header",{children:[c.jsxs("div",{children:[c.jsx("span",{children:"MODAL SETUP & DEPLOYMENT"}),c.jsx("strong",{id:"modal-log-title",children:u.stage})]}),c.jsxs("small",{children:[u.gpu,u.cpu?` · ${u.cpu} CPU`:"",u.memory_mb?` · ${ji(u.memory_mb*1024*1024)}`:""," · ",u.status]}),["queued","running"].includes(u.status)&&u.phase!=="verifying"&&c.jsxs("button",{className:"modal-dialog-stop",type:"button",onClick:r,title:"Stop Modal setup",children:[c.jsx($u,{size:11,fill:"currentColor"})," Stop"]}),c.jsxs("button",{type:"button",onClick:j,title:"Copy deployment logs",children:[h?c.jsx(al,{size:13}):c.jsx(bp,{size:13})," ",h?"Copied!":"Copy"]}),c.jsx("button",{type:"button",onClick:f,title:"Close deployment logs","aria-label":"Close deployment logs",children:c.jsx(Da,{size:15})})]}),c.jsx("pre",{ref:o,children:E})]})}),document.body)}const yh=[{id:"building",label:"Prepare CUDA image",detail:"Install and cache the GTSFM environment"},{id:"deploying",label:"Deploy workspace",detail:"Publish the FastAPI workspace on Modal"},{id:"verifying",label:"Start & verify workspace",detail:"Cold-start the GPU and confirm the workspace API is healthy"}];function $0({deployment:u,onCancel:r,onExpand:f}){const o=u.phase==="ready",m=u.phase==="verifying",h=o?"verifying":u.phase??"building",S=Math.max(0,yh.findIndex(j=>j.id===h)),E=u.image_source==="prebuilt"?"Pull the versioned GTSFM runtime; no package installation":"Install and cache the GTSFM environment";return c.jsxs("section",{className:`modal-deployment ${u.status}`,"aria-label":"Modal workspace progress",children:[c.jsxs("div",{className:"modal-deployment-heading",children:[c.jsxs("span",{children:[o?c.jsx(al,{size:12}):u.status==="failed"?c.jsx(Ti,{size:12}):u.status==="cancelled"?c.jsx(wo,{size:12}):c.jsx(tl,{size:12}),c.jsx("strong",{children:u.stage})]}),c.jsxs("span",{className:"modal-deployment-actions",children:[c.jsxs("small",{children:[u.image_source==="prebuilt"?"PREBUILT":"SOURCE"," · ",u.gpu]}),["queued","running"].includes(u.status)&&!m&&c.jsxs("button",{className:"modal-stop-action",type:"button",onClick:r,title:"Stop Modal setup",children:[c.jsx($u,{size:9,fill:"currentColor"})," Stop"]}),c.jsx("button",{type:"button",onClick:f,title:"View all setup logs","aria-label":"View all setup logs",children:c.jsx(gh,{size:12})})]})]}),c.jsx("ol",{className:"modal-deployment-steps",children:yh.map((j,y)=>{const p=o||y{const h=m.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),S=u.match(new RegExp(`(?:^|\\s)${h}(?:=|\\s+)(?:"([^"]+)"|'([^']+)'|([^\\s]+))`));return(S?.[1]??S?.[2]??S?.[3]??"").trim()},f=r("--token-id"),o=r("--token-secret");return f&&o?{tokenId:f,tokenSecret:o}:null}const Mo=u=>u.modal_api_key,Cn=u=>String(u??"").split("_").map(r=>["api","ba","colmap","gpu","gs","mvs","sift","vggt"].includes(r)?r.toUpperCase():r==="anysplat"?"AnySplat":r==="megaloc"?"MegaLoc":r.charAt(0).toUpperCase()+r.slice(1)).join(" "),wl=u=>u instanceof Error?u.message:String(u);async function Gt(u,r){const f=await fetch(u,r),o=await f.json();if(!f.ok)throw new Error(o.error||`Request failed (${f.status})`);return o}const bh=u=>`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}${u}`;function e1({collapsed:u,onToggle:r}){return c.jsxs("header",{className:"studio-header","aria-label":"SfM Studio",children:[c.jsx("div",{className:"brand-primary",children:c.jsx("img",{className:"brand-logo",src:"/static/brand/sfm-logo.png",alt:"SfM"})}),c.jsx("img",{className:"brand-mark",src:"/static/brand/bee-favicon.png",alt:"","aria-hidden":"true"}),c.jsx("button",{className:"sidebar-toggle",type:"button",onClick:r,title:u?"Expand side panel":"Collapse side panel","aria-label":u?"Expand side panel":"Collapse side panel",children:u?c.jsx(yp,{size:16}):c.jsx(gp,{size:16})})]})}function tr({label:u,optional:r=!1,children:f}){return c.jsxs("label",{children:[u,r&&c.jsx("span",{className:"optional",children:"optional"}),f]})}function it({label:u,value:r,options:f,onChange:o,disabled:m=!1,empty:h=null,id:S}){return c.jsx(tr,{label:u,children:c.jsxs("select",{id:S,value:r??"",onChange:E=>o(E.target.value),disabled:m,children:[h!==null&&c.jsx("option",{value:"",children:h}),f.map(E=>{const j=typeof E=="string"?{id:E,label:Cn(E)}:E;return c.jsx("option",{value:j.id,disabled:!!(j.status&&j.status!=="available"),children:j.label},j.id)})]})})}function Qe({label:u,optional:r=!1,value:f,onChange:o,...m}){return c.jsx(tr,{label:u,optional:r,children:c.jsx("input",{value:f??"",onChange:h=>o(h.target.value),...m})})}const ji=u=>{const r=["B","KB","MB","GB","TB"];let f=u,o=0;for(;f>=1024&&o0?f.toFixed(1):Math.round(f)} ${r[o]}`},wa=[{id:"T4",label:"NVIDIA T4 · 16 GB · $0.59/hr",pricePerSecond:164e-6,relativeSpeed:.3,memoryGiB:16},{id:"L4",label:"NVIDIA L4 · 24 GB · $0.80/hr",pricePerSecond:222e-6,relativeSpeed:.5,memoryGiB:24},{id:"A10",label:"NVIDIA A10 · 24 GB · $1.10/hr",pricePerSecond:306e-6,relativeSpeed:.58,memoryGiB:24},{id:"L40S",label:"NVIDIA L40S · 48 GB · $1.95/hr",pricePerSecond:542e-6,relativeSpeed:1,memoryGiB:48},{id:"A100-40GB",label:"NVIDIA A100 · 40 GB · $2.10/hr",pricePerSecond:583e-6,relativeSpeed:1.18,memoryGiB:40},{id:"A100-80GB",label:"NVIDIA A100 · 80 GB · $2.50/hr",pricePerSecond:694e-6,relativeSpeed:1.3,memoryGiB:80},{id:"RTX-PRO-6000",label:"NVIDIA RTX PRO 6000 · 96 GB · $3.03/hr",pricePerSecond:842e-6,relativeSpeed:1.45,memoryGiB:96},{id:"H100",label:"NVIDIA H100 · 80 GB · $3.95/hr",pricePerSecond:.001097,relativeSpeed:1.8,memoryGiB:80},{id:"H200",label:"NVIDIA H200 · 141 GB · $4.54/hr",pricePerSecond:.001261,relativeSpeed:1.95,memoryGiB:141},{id:"B200",label:"NVIDIA B200 · 180 GB · $6.25/hr",pricePerSecond:.001736,relativeSpeed:2.35,memoryGiB:180},{id:"B300",label:"NVIDIA B300 · 288 GB · Coming Soon!",status:"coming-soon",pricePerSecond:.001972,relativeSpeed:2.65,memoryGiB:288}];function t1(u,r,f=0){const o=r?.image_count||f;if(!o)return null;const m=r?.average_megapixels&&r.average_megapixels>0?r.average_megapixels:8,h=Number(u.max_resolution),S=Number.isFinite(h)&&h>0?h**2*.75/1e6:m,E=Math.max(.25,Math.min(m,S)),j=o*Math.sqrt(E/8),y=u.config_name==="vggt"?5:u.config_name.includes("fast")?3:7,p=u.splat_implementation==="gsplat"?3:u.splat_implementation==="anysplat"?6:0,M=Math.ceil(5+j*.1+y+p+(u.run_mvs?4:0));let O="L4";M<=14&&u.splat_implementation==="none"?O="T4":M<=22?O="L4":M<=44?O="L40S":M<=72&&j<350?O="A100-80GB":M<=72?O="H100":M<=125?O="H200":O="B200";const Y=wa.find(V=>V.id===O)??wa[3],H=o<40?"small":o<140?"medium":o<350?"large":"very large";return{gpu:Y,imageCount:o,effectiveMegapixels:E,estimatedMemoryGiB:M,reason:`${H} ${o}-image workload at about ${E.toFixed(E<10?1:0)} MP per image`}}function l1({recommendation:u,selectedGpu:r,onApply:f}){if(!u)return c.jsxs("div",{className:"modal-gpu-recommendation empty",children:[c.jsx("strong",{children:"VM recommendation"}),c.jsx("p",{children:"Choose a sample or upload images to size the Modal GPU automatically."})]});const o=r===u.gpu.id;return c.jsxs("section",{className:`modal-gpu-recommendation ${o?"selected":"overridden"}`,"aria-label":"Recommended Modal VM size",children:[c.jsxs("div",{children:[c.jsx("span",{children:"RECOMMENDED VM"}),c.jsxs("strong",{children:[u.gpu.id," · ",u.gpu.memoryGiB," GB"]})]}),c.jsxs("p",{children:[u.reason,". Estimated peak GPU memory is approximately ",u.estimatedMemoryGiB," GiB, including working headroom."]}),o?c.jsxs("small",{children:[c.jsx(al,{size:11})," Selected automatically"]}):c.jsx("button",{type:"button",onClick:f,children:"Use recommended"})]})}const Sh=u=>u<60?`${Math.max(1,Math.round(u))} min`:`${(u/60).toFixed(u<120?1:0)} hr`,_h=u=>`$${u<10?u.toFixed(2):u.toFixed(1)}`;function lr(u){const r=u.trim().match(/^([\d.]+)\s*(gb|gib|mb|mib)?$/i);if(!r)return 32;const f=Number(r[1]);return/m/i.test(r[2]||"")?f/1024:f}const xh={T4:{cpu:4,memoryGiB:32},L4:{cpu:4,memoryGiB:32},A10:{cpu:6,memoryGiB:48},L40S:{cpu:8,memoryGiB:64},"A100-40GB":{cpu:8,memoryGiB:64},"A100-80GB":{cpu:12,memoryGiB:96},"RTX-PRO-6000":{cpu:16,memoryGiB:128},H100:{cpu:16,memoryGiB:128},H200:{cpu:20,memoryGiB:192},B200:{cpu:24,memoryGiB:256}};function a1(u,r,f){if(u.execution_target==="remote"){if(u.remote_connection==="api"&&u.remote_provider==="modal"){const p=xh[u.modal_gpu]??xh.L40S,M=wa.find(O=>O.id===u.modal_gpu);return{key:`modal:${u.modal_gpu}`,label:`Modal ${u.modal_gpu}`,description:`${M?.memoryGiB??48} GB GPU · CPU and RAM are provisioned when this workspace is deployed. One worker is fixed to the single GPU.`,workers:1,threadsPerWorker:p.cpu,memoryPerWorkerGiB:p.memoryGiB,allowWorkers:!1,allowThreads:!0,allowMemory:!0,allowLocalRuntime:!1}}return{key:`remote:${u.remote_connection}:${u.remote_provider}`,label:u.remote_connection==="ssh"?"Direct VM (coming soon)":`${Cn(u.remote_provider)} VM`,description:"Machine-level tuning is unavailable until this remote provider is connected.",workers:1,threadsPerWorker:1,memoryPerWorkerGiB:32,allowWorkers:!1,allowThreads:!1,allowMemory:!1,allowLocalRuntime:!1}}const o=r?.devices.find(p=>p.kind==="cpu"),m=Math.max(1,Number(o?.details.match(/(\d+)\s+logical cores/i)?.[1])||1),h=Math.max(4,lr(o?.memory||"32GB")),S=!!(f&&f.kind!=="cpu"),E=S?1:Math.min(4,Math.max(1,Math.floor(m/4))),j=S?Math.min(8,m):Math.max(1,Math.floor(m/E)),y=Math.max(4,Math.floor(h*.75/E));return{key:`local:${f?.id??"detecting"}:${m}:${Math.round(h)}`,label:f?.label??"Detecting this machine",description:S?"One worker is assigned to the selected accelerator. CPU threads and host-memory limits remain adjustable.":"Worker count, CPU threads, and memory are tuned from the detected local resources.",workers:E,threadsPerWorker:j,memoryPerWorkerGiB:y,allowWorkers:!S,allowThreads:!!f,allowMemory:!!f,allowLocalRuntime:!0}}function n1({form:u,analysis:r,fallbackImageCount:f}){const o=r?.image_count||f;if(!o)return c.jsxs("div",{className:"modal-estimate empty",children:[c.jsx("strong",{children:"Cost estimate"}),c.jsx("p",{children:"Choose a GTSFM sample or upload an image dataset to calculate an estimate."})]});const m=wa.find(ee=>ee.id===u.modal_gpu)??wa[3],h=r?.average_megapixels||8,S=Number(u.max_resolution),E=Number.isFinite(S)&&S>0?S**2*.75/1e6:h,j=Math.min(h,E),y=Math.max(.65,Math.min(2.5,Math.sqrt(j/2))),p=u.config_name.includes("fast")?.75:u.config_name==="vggt"?1:1.35,M=(2+o*.09*y+Math.pow(o,1.35)*.025)*p,O=Math.max(1,Number(u.gs_max_steps)||7e3),Y=u.splat_implementation==="gsplat"?O/1e3*(.45+Math.sqrt(o)*.08)*y:u.splat_implementation==="anysplat"?1.5+o*.04*y:0,H=u.run_mvs?1+o*.12*y:0,X=(M+Y+H)/m.relativeSpeed,k=Math.max(1,X*.7),Z=Math.max(k+1,X*1.8+2),w=Math.max(1,Number(u.num_workers)*Number(u.threads_per_worker)||1),q=Math.max(1,lr(u.worker_memory_limit)*Math.max(1,Number(u.num_workers)||1)),$=m.pricePerSecond+w*131e-7+q*222e-8,W=k*60*$,K=Z*60*$,ne=r?.image_count?`${r.image_count} images · ${r.total_megapixels.toLocaleString()} source MP · ${ji(r.image_bytes)}`:`${o} catalog images · resolution assumed`;return c.jsxs("section",{className:"modal-estimate","aria-label":"Estimated Modal compute cost",children:[c.jsxs("div",{className:"modal-estimate-heading",children:[c.jsxs("div",{children:[c.jsx("span",{children:"ESTIMATED MODAL COMPUTE"}),c.jsxs("strong",{children:[_h(W),"–",_h(K)]})]}),c.jsxs("em",{children:[Sh(k),"–",Sh(Z)]})]}),c.jsx("div",{className:"modal-estimate-bar",children:c.jsx("span",{style:{width:`${Math.min(100,Math.max(12,k/Z*100))}%`}})}),c.jsx("p",{children:ne}),c.jsxs("small",{children:[Cn(u.config_name)," · ",Cn(u.splat_implementation),u.splat_implementation==="gsplat"?` · ${O.toLocaleString()} steps`:""," · ",m.id]}),c.jsxs("small",{children:["Estimate includes GPU plus approximately ",w," CPU core",w===1?"":"s"," and ",q.toFixed(0)," GiB memory. Actual runtime and billing vary with scene complexity, caching, and utilization."]}),c.jsx("a",{href:"https://modal.com/pricing",target:"_blank",rel:"noreferrer",children:"Modal pricing · rates checked Aug 13, 2026 ↗"})]})}async function Mp(u,r=""){const f=r?`${r}/${u.name}`:u.name;if(u.isFile)return[{file:await new Promise((S,E)=>u.file(S,E)),relativePath:f}];if(!u.isDirectory)return[];const o=u.createReader(),m=[];for(;;){const h=await new Promise((S,E)=>o.readEntries(S,E));if(!h.length)break;m.push(...h)}return(await Promise.all(m.map(h=>Mp(h,f)))).flat()}async function i1(u){const r=Array.from(u.items).map(f=>f.webkitGetAsEntry?.()).filter(f=>!!f);return r.length?(await Promise.all(r.map(f=>Mp(f)))).flat():Array.from(u.files).map(f=>({file:f,relativePath:f.name}))}function jh({label:u,optional:r=!1,value:f,onUploaded:o,onError:m}){const h=g.useRef(null),[S,E]=g.useState(!1),[j,y]=g.useState(!1),p=async M=>{if(!M.length){m("Choose a folder containing at least one file.");return}y(!0),m("");try{const O=new FormData;O.append("manifest",JSON.stringify(M.map(H=>H.relativePath))),M.forEach(H=>O.append("files",H.file,H.file.name));const Y=await Gt("/api/uploads",{method:"POST",body:O});o(Y)}catch(O){m(wl(O))}finally{y(!1)}};return c.jsxs("div",{className:"folder-field",children:[c.jsxs("div",{className:"folder-label",children:[u,r&&c.jsx("span",{className:"optional",children:"optional"})]}),c.jsxs("button",{type:"button",className:`folder-drop ${S?"dragging":""} ${f?"has-folder":""}`,onClick:()=>h.current?.click(),onDragEnter:M=>{M.preventDefault(),E(!0)},onDragOver:M=>{M.preventDefault(),M.dataTransfer.dropEffect="copy"},onDragLeave:M=>{M.currentTarget.contains(M.relatedTarget)||E(!1)},onDrop:async M=>{M.preventDefault(),E(!1),await p(await i1(M.dataTransfer))},disabled:j,children:[c.jsx("span",{className:"folder-icon",children:f?c.jsx(al,{size:17}):c.jsx(_p,{size:18})}),c.jsx("span",{className:"folder-copy",children:j?c.jsxs(c.Fragment,{children:[c.jsx("strong",{children:"Importing folder…"}),c.jsx("small",{children:"Keeping the directory structure intact"})]}):f?c.jsxs(c.Fragment,{children:[c.jsx("strong",{children:f.name}),c.jsxs("small",{children:[f.file_count," file",f.file_count===1?"":"s"," · ",ji(f.bytes)," · Click to replace"]})]}):c.jsxs(c.Fragment,{children:[c.jsx("strong",{children:"Drop a folder here"}),c.jsx("small",{children:"or click to choose one"})]})})]}),c.jsx("input",{ref:h,className:"folder-input",type:"file",multiple:!0,webkitdirectory:"",directory:"",onChange:async M=>{const O=Array.from(M.target.files??[]);await p(O.map(Y=>({file:Y,relativePath:Y.webkitRelativePath||Y.name}))),M.target.value=""}}),f&&c.jsx("button",{type:"button",className:"folder-remove",onClick:()=>o(null),children:"Remove selection"})]})}function Mh({id:u,checked:r,onCheckedChange:f,disabled:o=!1,children:m}){return c.jsxs("div",{className:`toggle-row ${o?"disabled":""}`,children:[c.jsx(Iy,{id:u,className:"switch-root",checked:r,onCheckedChange:f,disabled:o,children:c.jsx(e0,{className:"switch-thumb"})}),c.jsx("label",{htmlFor:u,children:m})]})}function Co({number:u,title:r,subtitle:f,children:o}){return c.jsxs("section",{className:"form-section",children:[c.jsxs("div",{className:"section-heading",children:[c.jsx("span",{className:"step-number",children:u}),c.jsxs("div",{children:[c.jsx("strong",{children:r}),c.jsx("small",{children:f})]})]}),o]})}function u1({descriptors:u,values:r,setValues:f}){return u.length?c.jsxs("div",{className:"loader-options",children:[c.jsx("p",{className:"mini-heading",children:"Format-specific options"}),u.map(o=>o.type==="boolean"?c.jsx(it,{label:o.label,value:String(r[o.name]??o.default??!1),options:[{id:"true",label:"True"},{id:"false",label:"False"}],onChange:m=>f(h=>({...h,[o.name]:m==="true"}))},o.name):c.jsx(Qe,{label:o.label,optional:!o.required,required:o.required,type:["integer","number"].includes(o.type)?"number":"text",step:o.type==="number"?"any":void 0,value:r[o.name]??o.default??"",onChange:m=>f(h=>({...h,[o.name]:m}))},o.name))]}):null}function c1({device:u}){return u?c.jsxs("div",{className:"hardware-card",children:[c.jsx("strong",{children:u.label}),c.jsxs("small",{children:[u.details,u.memory?` · ${u.memory}`:""]}),c.jsx("span",{className:`capability ${u.supports_gaussian_splatting?"yes":"no"}`,children:u.supports_gaussian_splatting?"Splat ready":"Reconstruction"})]}):c.jsx("div",{className:"hardware-card",children:c.jsx("strong",{children:"Detecting hardware…"})})}function s1({schema:u,hardware:r,samples:f,samplesLoading:o,onStarted:m,onTabChange:h,remotePromptKey:S,schemaLoading:E,schemaError:j,onRetrySchema:y}){const[p,M]=g.useState(W0),[O,Y]=g.useState("upload"),[H,V]=g.useState({}),[X,k]=g.useState(null),[Z,w]=g.useState(""),[q,$]=g.useState(""),[W,K]=g.useState(!1),[ne,ee]=g.useState(!1),[Me,Ce]=g.useState(!1),[xe,ce]=g.useState(!1),[Ne,Ye]=g.useState(null),[R,L]=g.useState(!1),[le,Ee]=g.useState(!1),[je,_]=g.useState(!1),[G,Q]=g.useState(""),[J,ue]=g.useState(null),[se,Se]=g.useState(null),[Be,He]=g.useState(null),[Tt,Wt]=g.useState(!1),[ml,il]=g.useState(""),ct=g.useRef(0),ul=g.useRef(""),P=(x,fe)=>M(pe=>({...pe,[x]:fe}));g.useEffect(()=>{if(!r)return;const x=r.devices.find(fe=>fe.supports_gaussian_splatting);M(fe=>({...fe,hardware:x?.id??r.devices[0]?.id??"cpu",splat_implementation:fe.execution_target==="local"&&!x?"none":fe.splat_implementation}))},[r]),g.useEffect(()=>{S<1||(M(x=>({...x,execution_target:"remote",remote_connection:"api",remote_provider:"modal",splat_implementation:x.splat_implementation==="none"?u.defaults.splat_implementation:x.splat_implementation})),window.setTimeout(()=>document.getElementById("computeTarget")?.scrollIntoView({behavior:"smooth",block:"start"}),0))},[S,u]);const fa=X?.configuration?.models??u.models,hl=fa.find(x=>x.id===p.config_name),Ht=hl?.capabilities??{iterative_splat:!1,mvs:!1,share_intrinsics:!1},da=g.useMemo(()=>u.splat_implementations.map(x=>({...x,status:x.id==="gsplat"&&!Ht.iterative_splat?"disabled":"available"})),[u,Ht.iterative_splat]),ma=u.splat_implementations.find(x=>x.id===p.splat_implementation),F=r?.devices.find(x=>x.id===p.hardware),oe=a1(p,r,F),me=f.find(x=>x.id===p.sample_id),mt=O==="sample"?Be?.analysis:se?.analysis?.image_count?se.analysis:J?.analysis,Je=t1(p,mt,me?.image_count??0),cl=[O,p.sample_id,mt?.image_count??0,mt?.average_megapixels??0,mt?.total_megapixels??0,p.max_resolution,p.config_name,p.splat_implementation,p.run_mvs].join(":"),kt=wa.map(x=>({...x,label:x.id===Je?.gpu.id?`${x.label} · Recommended`:x.label})),pl=[{id:"modal",label:"Modal"},{id:"lambda",label:"Lambda Cloud — Coming Soon!",status:"coming-soon"},{id:"runpod",label:"RunPod — Coming Soon!",status:"coming-soon"},{id:"vast",label:"Vast.ai — Coming Soon!",status:"coming-soon"},{id:"aws",label:"AWS EC2 — Coming Soon!",status:"coming-soon"}],ha=x=>{const fe=wa.find(Ve=>Ve.id===x),pe={configuration:u,verified:!1,hardware:{summary:`Modal ${x} workspace`,devices:[{id:"cuda:0",kind:"cuda",label:`Modal ${x}`,details:"NVIDIA CUDA GPU · starts with the first reconstruction",memory:fe?`${fe.memoryGiB} GB`:void 0,supports_gaussian_splatting:!0}]}};return k(pe),P("remote_hardware","cuda:0"),pe};g.useEffect(()=>{Je&&p.modal_gpu!==Je.gpu.id&&(P("modal_gpu",Je.gpu.id),p.remote_endpoint&&(k(null),ce(!0),w("The dataset changed the recommended VM. Update the Modal workspace to apply it, then verify readiness.")))},[Je?.gpu.id,cl,p.modal_gpu,p.remote_endpoint]),g.useEffect(()=>{M(x=>({...x,num_workers:oe.workers,threads_per_worker:oe.threadsPerWorker,worker_memory_limit:`${oe.memoryPerWorkerGiB}GB`}))},[oe.key]),g.useEffect(()=>{!me||Be?.path!==""||il(p.execution_target==="remote"?"Will download directly on Modal":me.prepared?"Cached and ready":"Will download when the run starts")},[p.execution_target,me,Be?.path]);const Ai=(x,fe)=>{ct.current+=1,K(!1),ee(!1);const pe=P0(fe);if(k(null),ce(!1),w(""),pe){M(Ve=>({...Ve,modal_token_id:pe.tokenId,modal_token_secret:pe.tokenSecret,modal_api_key:""})),$("Token command parsed. Both fields are filled.");return}M(Ve=>({...Ve,[x]:fe,modal_api_key:""})),$("")},zi=x=>{P("modal_gpu",x),k(null),ce(!!p.remote_endpoint),w("VM selection changed. Update the Modal workspace to apply it, then verify readiness.")};g.useEffect(()=>{if(p.execution_target!=="remote"||p.remote_connection!=="api"||p.remote_provider!=="modal"||!p.modal_token_id.startsWith("ak-")||!p.modal_token_secret.startsWith("as-"))return;const x=++ct.current,fe=window.setTimeout(async()=>{K(!0),w("Finding your deployed GTSFM app on Modal…");try{const pe=await Gt("/api/modal/discover",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token_id:p.modal_token_id,token_secret:p.modal_token_secret})});if(x!==ct.current)return;M(Ve=>Ve.remote_endpoint&&Ve.remote_endpoint!==ul.current?{...Ve,modal_api_key:pe.api_key}:{...Ve,remote_endpoint:pe.endpoint,modal_api_key:pe.api_key}),ul.current=pe.endpoint,ha(p.modal_gpu),ce(!1),w(`Found ${pe.app_name} · ${pe.function_name}. Update it to this GTSFM version, or verify the existing workspace.`)}catch(pe){x===ct.current&&(ce(!0),w(wl(pe)))}finally{x===ct.current&&K(!1)}},450);return()=>window.clearTimeout(fe)},[p.execution_target,p.remote_connection,p.remote_provider,p.modal_token_id,p.modal_token_secret]),g.useEffect(()=>{p.splat_implementation==="gsplat"&&hl&&!Ht.iterative_splat&&P("splat_implementation","none")},[p.splat_implementation,hl,Ht.iterative_splat]);async function Bl(x,fe){const pe=await Gt("/api/remote/inspect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint:x,api_key:fe,remote_provider:p.remote_provider})});k({...pe,verified:!0});const Ve=pe.hardware.devices.find(Ni=>Ni.supports_gaussian_splatting);return P("remote_hardware",Ve?.id??pe.hardware.devices[0]?.id??""),pe}const gt=async()=>{if(p.remote_connection!=="api"){w("SSH connection testing is coming soon. You can finish the VM details now.");return}if(!p.remote_endpoint||!Mo(p)){w("Deploy the GTSFM Modal workspace first, or wait for an existing deployment to be discovered.");return}ee(!0),ce(!1),k(x=>x?{...x,verified:!1}:null),w("Checking the lightweight Modal control service…");try{const x=await Bl(p.remote_endpoint,Mo(p));ce(!1),w(`${x.hardware.summary}. The control service is ready; the GPU stays off until you run a reconstruction.`)}catch(x){ce(!0),w(`Workspace check failed. Update the Modal workspace before running. ${wl(x)}`)}finally{ee(!1)}},sl=async()=>{if(!p.modal_token_id.startsWith("ak-")||!p.modal_token_secret.startsWith("as-")){w("Enter both Modal token fields before deploying.");return}ct.current+=1,Ce(!0),ce(!1),k(null),w("");try{let x=await Gt("/api/modal/deploy",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token_id:p.modal_token_id,token_secret:p.modal_token_secret,gpu:p.modal_gpu,cpu:Math.max(1,Number(p.num_workers)*Number(p.threads_per_worker)||1),memory_mb:Math.max(4096,Math.round(lr(p.worker_memory_limit)*Math.max(1,Number(p.num_workers)||1)*1024))})});for(Ye(x);["queued","running","cancelling"].includes(x.status);)await new Promise(fe=>window.setTimeout(fe,1e3)),x=await Gt(`/api/modal/deploy/${encodeURIComponent(x.id)}`),Ye(x);if(x.status==="cancelled"){w("Modal workspace setup stopped.");return}if(x.status==="failed")throw new Error(x.error||"Modal deployment failed");ul.current=x.endpoint,M(fe=>({...fe,remote_endpoint:x.endpoint,modal_api_key:x.api_key})),ha(x.gpu),Ye({...x,status:"running",phase:"verifying",stage:"Starting and verifying the Modal workspace",log_tail:[...x.log_tail,`Registered endpoint ${x.endpoint}`,"Checking the CPU control service; the GPU remains off until a run starts…"]}),ee(!0);try{await Bl(x.endpoint,x.api_key)}catch(fe){const pe=`Deployment finished, but the workspace health check failed: ${wl(fe)}`;throw k(Ve=>Ve?{...Ve,verified:!1}:null),ce(!0),Ye({...x,status:"failed",phase:"verifying",stage:"Modal workspace needs an update",error:pe,log_tail:[...x.log_tail,`Registered endpoint ${x.endpoint}`,pe]}),new Error(pe)}finally{ee(!1)}Ye({...x,phase:"ready",stage:"Modal workspace ready",log_tail:[...x.log_tail,`Registered endpoint ${x.endpoint}`,"Workspace health check passed. The Modal GPU is ready."]}),ce(!1),w(`Modal ${x.gpu} workspace passed its health check and is ready to run.`)}catch(x){const fe=wl(x);ce(!0),w(/Request failed \(404\)/.test(fe)?"This GTSFM server was started before Modal deployment support was installed. Stop it with Ctrl-C, run `gtsfm run` again, then click Deploy.":fe)}finally{Ce(!1)}},ht=async()=>{if(!(!Ne||!["queued","running"].includes(Ne.status)))try{const x=await Gt(`/api/modal/deploy/${encodeURIComponent(Ne.id)}/cancel`,{method:"POST"});Ye(x),w("Stopping Modal workspace setup…")}catch(x){w(wl(x))}},Fu=x=>{const fe=f.find(Ve=>Ve.id===x);if(He(null),il(""),!fe){M(Ve=>({...Ve,sample_id:"",dataset_dir:""}));return}const pe=fe.recommendations;V(pe.loader_options??{}),M(Ve=>({...Ve,sample_id:fe.id,dataset_dir:"",images_dir:"",name:fe.id,loader:pe.loader,config_name:pe.config_name,max_resolution:pe.max_resolution??Ve.max_resolution})),He({path:"",sample:fe,analysis:{image_count:fe.image_count,image_bytes:0,total_megapixels:0,average_megapixels:0,max_width:0,max_height:0}}),il(fe.prepared?"Cached and ready":"Will download where the run executes")},Wu=async x=>{x.preventDefault(),_(!0),Q("");try{if(p.execution_target==="remote"&&p.remote_connection==="ssh")throw new Error("SSH execution is not available yet. Choose API to run on Modal.");if(p.execution_target==="remote"&&p.remote_provider==="modal"&&!X?.verified)throw new Error("The Modal workspace must pass its health check before a reconstruction can start.");const fe={...p,api_key:p.execution_target==="remote"?Mo(p):"",loader_options:H,hardware:p.execution_target==="remote"?p.remote_hardware:p.hardware,max_resolution:p.max_resolution?Number(p.max_resolution):null,num_workers:Number(p.num_workers),threads_per_worker:Number(p.threads_per_worker),gs_max_steps:Number(p.gs_max_steps),live_preview_interval:Number(p.live_preview_interval),max_frame_lookahead:p.max_frame_lookahead?Number(p.max_frame_lookahead):null,num_matched:p.num_matched?Number(p.num_matched):null,num_retry_cluster_connection:p.num_retry_cluster_connection?Number(p.num_retry_cluster_connection):null},pe=await Gt("/api/jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(fe)});m(pe),h("activity")}catch(fe){Q(wl(fe))}finally{_(!1)}},Iu=p.execution_target==="remote"&&p.remote_connection==="api"&&p.remote_provider==="modal",pa=X?.verified?"ready":Me||W||ne?"working":xe?"attention":p.remote_endpoint?"found":"idle",Ga=Z||{idle:"Enter Modal credentials, then deploy or discover a workspace.",found:"Choose Update to apply this GTSFM version, or verify the existing deployment.",working:"Preparing the lightweight control service. The GPU starts only when a reconstruction runs.",ready:"Health checks passed. Reconstruction can start.",attention:"Update or verify this workspace before starting a run."}[pa],Ba=Me?Ne?.phase==="verifying"?"Starting & verifying Modal workspace…":"Setting up Modal workspace…":W?"Finding Modal workspace…":ne?"Starting & verifying Modal workspace…":Iu&&!X?.verified?"Prepare Modal workspace first":"Run reconstruction";return c.jsxs("form",{id:"runForm",onSubmit:Wu,children:[c.jsxs("div",{className:"panel-intro",children:[c.jsx("span",{children:"NEW RECONSTRUCTION"}),E?c.jsxs("small",{className:"catalog-sync",children:[c.jsx(tl,{className:"spin",size:10})," Syncing workspace options…"]}):j?c.jsxs("button",{className:"catalog-sync failed",type:"button",onClick:y,children:[c.jsx(Ti,{size:10})," Options offline · Retry"]}):null,c.jsx("p",{children:"Configure the source, pipeline, and compute target."})]}),c.jsxs(Co,{number:"01",title:"Input",subtitle:"Choose the images to reconstruct",children:[c.jsx(Qe,{label:"Run name",value:p.name,onChange:x=>P("name",x),autoComplete:"off"}),c.jsxs("div",{className:"segmented input-source",role:"group","aria-label":"Input source",children:[c.jsxs("button",{type:"button",className:`target-choice ${O==="upload"?"active":""}`,onClick:()=>{Y("upload"),M(x=>({...x,sample_id:"",dataset_dir:J?.path??"",images_dir:se?.path??""}))},children:[c.jsx(_p,{size:13})," Upload your own"]}),c.jsxs("button",{type:"button",className:`target-choice ${O==="sample"?"active":""}`,onClick:()=>{Y("sample"),M(x=>({...x,sample_id:Be?.sample.id??"",dataset_dir:Be?.path??"",images_dir:""}))},children:[c.jsx(vh,{size:13})," GTSFM samples"]})]}),O==="upload"?c.jsxs(c.Fragment,{children:[c.jsx(jh,{label:"Dataset folder",value:J,onError:Q,onUploaded:x=>{ue(x),P("dataset_dir",x?.path??""),x&&p.name==="my-scene"&&P("name",x.name.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||"my-scene")}}),c.jsx(jh,{label:"Separate images folder",optional:!0,value:se,onError:Q,onUploaded:x=>{Se(x),P("images_dir",x?.path??"")}})]}):c.jsxs("div",{className:"sample-picker",children:[c.jsx(it,{label:"Sample scene",value:p.sample_id,options:f,empty:o?"Loading GTSFM samples…":"Choose a GTSFM sample…",onChange:Fu,disabled:Tt||o}),p.sample_id&&c.jsxs("div",{className:`sample-card ${Be?"ready":""}`,children:[c.jsx("span",{className:"sample-state",children:Tt?c.jsx(tl,{className:"spin",size:14}):Be?c.jsx(al,{size:14}):c.jsx(vh,{size:14})}),c.jsxs("div",{children:[c.jsx("strong",{children:f.find(x=>x.id===p.sample_id)?.label}),c.jsx("small",{children:f.find(x=>x.id===p.sample_id)?.description}),c.jsxs("span",{children:[ml," · ",f.find(x=>x.id===p.sample_id)?.image_count," images · ",c.jsx("a",{href:f.find(x=>x.id===p.sample_id)?.source_url,target:"_blank",rel:"noreferrer",children:"View on GitHub ↗"})]})]})]}),c.jsx("p",{className:"field-help sample-help",children:"Dataset format, VGGT model, resolution, and available loader settings are applied automatically."})]}),c.jsx(it,{label:"Dataset format",value:p.loader,options:u.loaders,onChange:x=>{P("loader",x),V({})}}),c.jsx(u1,{descriptors:u.loader_options[p.loader]??[],values:H,setValues:V})]}),c.jsxs(Co,{number:"02",title:"Models",subtitle:"VGGT is the default reconstruction model",children:[c.jsx(it,{label:"Reconstruction model",value:p.config_name,options:fa,onChange:x=>P("config_name",x)}),c.jsx(it,{label:"Splat implementation",value:p.splat_implementation,options:da,onChange:x=>P("splat_implementation",x)}),c.jsx("p",{className:"field-help",children:ma?.description}),p.splat_implementation==="gsplat"&&c.jsxs("div",{className:"nested-options",children:[c.jsx(it,{label:"Optimizer preset",value:p.gaussian_splatting_config_name,options:X?.configuration?.gaussian_splatting_models??u.gaussian_splatting_models,onChange:x=>P("gaussian_splatting_config_name",x)}),c.jsxs("div",{className:"form-grid",children:[c.jsx(Qe,{label:"Training steps",type:"number",min:"1",step:"1",value:p.gs_max_steps,onChange:x=>P("gs_max_steps",x)}),c.jsx(Qe,{label:"Preview every",type:"number",min:"10",step:"10",value:p.live_preview_interval,onChange:x=>P("live_preview_interval",x)})]})]}),c.jsx(Mh,{id:"runMvs",checked:p.run_mvs,disabled:!Ht.mvs,onCheckedChange:x=>P("run_mvs",x),children:"Also run dense MVS"})]}),c.jsxs(Co,{number:"03",title:"Compute",subtitle:"Run here or on a remote VM",children:[c.jsxs("div",{className:"segmented",id:"computeTarget",role:"group","aria-label":"Execution target",children:[c.jsxs("button",{type:"button",className:`target-choice ${p.execution_target==="local"?"active":""}`,onClick:()=>P("execution_target","local"),children:[c.jsx(V0,{size:13})," This machine"]}),c.jsxs("button",{type:"button",className:`target-choice ${p.execution_target==="remote"?"active":""}`,onClick:()=>M(x=>({...x,execution_target:"remote",splat_implementation:x.splat_implementation==="none"?u.defaults.splat_implementation:x.splat_implementation})),children:[c.jsx(Qu,{size:13})," Remote VM"]})]}),p.execution_target==="local"?c.jsx(c.Fragment,{children:r?c.jsxs(c.Fragment,{children:[c.jsx(it,{label:"Hardware",value:p.hardware,options:r.devices,onChange:x=>P("hardware",x)}),c.jsx(c1,{device:F})]}):c.jsxs("div",{className:"hardware-card detecting",children:[c.jsx(tl,{className:"spin",size:13}),c.jsxs("div",{children:[c.jsx("strong",{children:"Detecting compute devices…"}),c.jsx("small",{children:"You can configure the rest of the run while this finishes."})]})]})}):c.jsxs("div",{className:"nested-options remote-vm-options",children:[c.jsx(it,{label:"Connection method",value:p.remote_connection,options:[{id:"api",label:"API"},{id:"ssh",label:"SSH"}],onChange:x=>{P("remote_connection",x),k(null),w("")}}),p.remote_connection==="api"?c.jsxs(c.Fragment,{children:[c.jsx(it,{label:"Service",value:p.remote_provider,options:pl,onChange:x=>{P("remote_provider",x),k(null)}}),p.remote_provider==="modal"&&c.jsxs("div",{className:"provider-panel",children:[c.jsxs("div",{className:"provider-heading",children:[c.jsx("span",{className:"provider-mark",children:"M"}),c.jsxs("div",{children:[c.jsx("strong",{children:"Modal"}),c.jsx("small",{children:"Connect with your Modal account token"})]}),c.jsx("span",{className:"provider-status",children:"AVAILABLE"})]}),c.jsx(it,{label:"Modal VM GPU",value:p.modal_gpu,options:kt,onChange:zi}),c.jsx(l1,{recommendation:Je,selectedGpu:p.modal_gpu,onApply:()=>{Je&&zi(Je.gpu.id)}}),c.jsx(n1,{form:p,analysis:mt,fallbackImageCount:me?.image_count??0}),c.jsxs("p",{className:"field-help modal-command-help",children:["Enter the two values separately, or paste the complete ",c.jsx("code",{children:"modal token set --token-id … --token-secret …"})," command into either field."]}),c.jsxs("div",{className:"form-grid",children:[c.jsx(Qe,{label:"Token ID",value:p.modal_token_id,onChange:x=>Ai("modal_token_id",x),autoComplete:"off",spellCheck:!1,placeholder:"ak-…"}),c.jsx(Qe,{label:"Token secret",type:"password",value:p.modal_token_secret,onChange:x=>Ai("modal_token_secret",x),autoComplete:"new-password",spellCheck:!1,placeholder:"as-…"})]}),q&&c.jsxs("div",{className:"credential-success",children:[c.jsx(al,{size:12})," ",q]}),c.jsx(Qe,{label:"GTSFM endpoint",type:"url",value:p.remote_endpoint,onChange:x=>{P("remote_endpoint",x),k(null),ce(!1),w("Endpoint changed. Start and verify this workspace before running.")},placeholder:W?"Discovering your Modal endpoint…":"Filled after credentials are verified"}),c.jsxs("button",{className:"modal-deploy-action full-width",type:"button",onClick:sl,disabled:W||Me||!p.modal_token_id||!p.modal_token_secret,children:[c.jsx(Qu,{size:13})," ",Me?"Setup in progress…":p.remote_endpoint?"Update Modal workspace":"Set up & deploy Modal workspace"]}),Ne&&c.jsx($0,{deployment:Ne,onCancel:ht,onExpand:()=>L(!0)}),Ne&&R&&c.jsx(J0,{deployment:Ne,onCancel:ht,onClose:()=>L(!1)}),p.remote_endpoint&&p.modal_api_key&&c.jsxs("button",{className:"secondary-action full-width",type:"button",onClick:()=>gt(),disabled:W||Me||ne,children:[ne?c.jsx(tl,{className:"spin",size:13}):X?.verified?c.jsx(al,{size:13}):c.jsx(Q0,{size:13})," ",ne?"Starting & checking workspace…":X?.verified?"Modal workspace ready":"Start & verify workspace"]}),c.jsx(F0,{state:pa,detail:Ga}),X&&c.jsx(it,{label:"Remote hardware",value:p.remote_hardware,options:X.hardware.devices,onChange:x=>P("remote_hardware",x)})]})]}):c.jsxs("div",{className:"provider-panel",children:[c.jsxs("div",{className:"provider-heading",children:[c.jsx("span",{className:"provider-mark ssh",children:c.jsx(er,{size:14})}),c.jsxs("div",{children:[c.jsx("strong",{children:"Direct VM"}),c.jsx("small",{children:"Connect to a machine you control"})]}),c.jsx("span",{className:"provider-status soon",children:"COMING SOON!"})]}),c.jsxs("div",{className:"form-grid",children:[c.jsx(Qe,{label:"Host",value:p.ssh_host,onChange:x=>P("ssh_host",x),placeholder:"gpu-box.example.com"}),c.jsx(Qe,{label:"Port",type:"number",min:"1",max:"65535",value:p.ssh_port,onChange:x=>P("ssh_port",x)}),c.jsx(Qe,{label:"Username",value:p.ssh_username,onChange:x=>P("ssh_username",x),autoComplete:"username",placeholder:"ubuntu"}),c.jsx(it,{label:"Authentication",value:p.ssh_authentication,options:[{id:"agent",label:"SSH agent"},{id:"key",label:"Private key"}],onChange:x=>P("ssh_authentication",x)})]}),p.ssh_authentication==="key"&&c.jsx(Qe,{label:"Private key path",value:p.ssh_private_key,onChange:x=>P("ssh_private_key",x),placeholder:"/Users/you/.ssh/id_ed25519"}),c.jsx(Qe,{label:"Remote workspace",value:p.ssh_workspace,onChange:x=>P("ssh_workspace",x),placeholder:"~/gtsfm-workspace"}),c.jsx("p",{className:"field-help",children:"SSH setup is visible now; remote execution and file transfer are the next connector step."})]})]})]}),c.jsxs(Dy,{className:"advanced-options",open:le,onOpenChange:Ee,children:[c.jsxs(wy,{className:"advanced-trigger",children:[c.jsxs("span",{children:[c.jsx(Z0,{size:13}),c.jsxs("span",{className:"advanced-trigger-copy",children:["Advanced settings",c.jsx("small",{children:oe.label})]})]}),c.jsx(vp,{size:14})]}),c.jsxs(Uy,{className:"advanced-content",children:[c.jsxs("div",{className:"machine-profile-summary",children:[c.jsxs("div",{children:[c.jsx("span",{children:"MACHINE PROFILE"}),c.jsx("strong",{children:oe.label})]}),c.jsx("p",{children:oe.description}),c.jsxs("div",{className:"machine-profile-specs",children:[c.jsxs("span",{children:[oe.workers," worker",oe.workers===1?"":"s"]}),c.jsxs("span",{children:[oe.threadsPerWorker," thread",oe.threadsPerWorker===1?"":"s"," / worker"]}),c.jsxs("span",{children:[oe.memoryPerWorkerGiB," GB / worker"]})]})]}),c.jsxs("div",{className:"form-grid",children:[c.jsx(Qe,{label:"Max resolution",type:"number",min:"1",value:p.max_resolution,onChange:x=>P("max_resolution",x),placeholder:"Model default"}),c.jsx(Qe,{label:"Workers",type:"number",min:"1",value:p.num_workers,onChange:x=>P("num_workers",x),disabled:!oe.allowWorkers,title:oe.allowWorkers?void 0:"Fixed for the selected single-GPU machine"}),c.jsx(Qe,{label:"Threads / worker",type:"number",min:"1",value:p.threads_per_worker,onChange:x=>P("threads_per_worker",x),disabled:!oe.allowThreads}),c.jsx(Qe,{label:"Memory / worker",value:p.worker_memory_limit,onChange:x=>P("worker_memory_limit",x),disabled:!oe.allowMemory})]}),!oe.allowWorkers&&c.jsx("p",{className:"advanced-machine-note",children:"Worker count is locked because the selected machine exposes one GPU. Choose a CPU machine to distribute work across multiple workers."}),c.jsx(it,{label:"Graph partitioner",value:p.graph_partitioner,options:u.graph_partitioners,empty:"Model default",onChange:x=>P("graph_partitioner",x)}),c.jsxs("div",{className:"form-grid",children:[c.jsx(it,{label:"Global descriptor",value:p.global_descriptor_config_name,options:u.global_descriptors,empty:"Model default",onChange:x=>P("global_descriptor_config_name",x)}),c.jsx(it,{label:"Image retriever",value:p.retriever_config_name,options:u.retrievers,empty:"Model default",onChange:x=>P("retriever_config_name",x)}),c.jsx(it,{label:"Correspondence",value:p.correspondence_generator_config_name,options:u.correspondence_generators,empty:"Model default",onChange:x=>P("correspondence_generator_config_name",x)}),c.jsx(it,{label:"Verifier",value:p.verifier_config_name,options:u.verifiers,empty:"Model default",onChange:x=>P("verifier_config_name",x)}),c.jsx(Qe,{label:"Frame lookahead",type:"number",min:"0",value:p.max_frame_lookahead,onChange:x=>P("max_frame_lookahead",x),placeholder:"Model default"}),c.jsx(Qe,{label:"Matches / image",type:"number",min:"0",value:p.num_matched,onChange:x=>P("num_matched",x),placeholder:"Model default"})]}),c.jsx(Mh,{id:"shareIntrinsics",checked:p.share_intrinsics,disabled:!Ht.share_intrinsics,onCheckedChange:x=>P("share_intrinsics",x),children:"Share camera intrinsics"}),c.jsxs("div",{className:"form-grid",children:[c.jsx(it,{label:"Log level",value:p.log,options:u.log_levels,onChange:x=>P("log",x)}),c.jsx(Qe,{label:"Dashboard port",value:p.dashboard_port,onChange:x=>P("dashboard_port",x),placeholder:":8787",disabled:!oe.allowLocalRuntime}),c.jsx(Qe,{label:"Input worker",value:p.input_worker,onChange:x=>P("input_worker",x),placeholder:"Optional worker address",disabled:!oe.allowLocalRuntime}),c.jsx(Qe,{label:"Dask temp folder",value:p.dask_tmpdir,onChange:x=>P("dask_tmpdir",x),placeholder:"System default",disabled:!oe.allowLocalRuntime}),c.jsx(Qe,{label:"Cluster config",value:p.cluster_config,onChange:x=>P("cluster_config",x),placeholder:"Optional YAML path",disabled:!oe.allowLocalRuntime}),c.jsx(Qe,{label:"Cluster retries",type:"number",min:"0",value:p.num_retry_cluster_connection,onChange:x=>P("num_retry_cluster_connection",x),placeholder:"3",disabled:!oe.allowLocalRuntime})]}),c.jsx(tr,{label:"Hydra overrides",children:c.jsx("textarea",{rows:4,value:p.advanced_overrides,onChange:x=>P("advanced_overrides",x.target.value)})})]})]}),c.jsx("div",{className:"form-error",role:"alert",children:G}),c.jsxs("button",{className:"primary-action",type:"submit",disabled:je||Tt||Me||W||ne||O==="sample"&&!Be||p.execution_target==="remote"&&(!p.remote_endpoint||!p.modal_api_key||!X?.verified),children:[c.jsx("span",{children:je?"Starting…":Tt?"Preparing sample…":Ba}),je||Tt||Me||W||ne?c.jsx(tl,{className:"spin",size:14}):c.jsx(xp,{size:14,fill:"currentColor"})]})]})}const Cp=u=>({queued:"Queued",running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled"})[u];function Ep({jobId:u,compact:r=!1}){const f=`/api/jobs/${encodeURIComponent(u)}/splat?format=ply`;return c.jsxs("div",{className:`splat-download ${r?"compact":""}`,children:[c.jsx("span",{className:"splat-format-label",children:".PLY"}),c.jsxs("a",{href:f,download:!0,title:"Download PLY splat",children:[c.jsx(Sp,{size:12}),!r&&c.jsx("span",{children:"Download"})]})]})}function o1({jobs:u,activeId:r,onSelect:f,onCancel:o,onRefresh:m}){return c.jsxs("div",{children:[c.jsxs("div",{className:"panel-title",children:[c.jsxs("div",{children:[c.jsx("h3",{children:"Activity"}),c.jsx("p",{children:"Running and recent jobs"})]}),c.jsx("button",{className:"icon-button",title:"Refresh",onClick:m,children:c.jsx(tl,{size:14})})]}),c.jsx("div",{className:"job-list",children:u.length?u.map(h=>c.jsxs("article",{className:`job-card ${h.id===r?"selected":""}`,children:[c.jsxs("div",{className:"job-card-top",children:[c.jsx("strong",{children:h.name}),c.jsx("span",{className:`job-status ${h.status}`,children:Cp(h.status)})]}),c.jsxs("small",{children:[Cn(h.spec.config_name||"GTSFM")," · ",Cn(h.spec.splat_implementation||"no_splats")]}),h.error&&c.jsx("p",{className:"job-error",children:h.error}),c.jsxs("div",{className:"job-actions",children:[c.jsx("button",{className:"text-button",onClick:()=>f(h.id),children:h.has_final_splat?"View splat":["queued","running"].includes(h.status)?"View progress":"View details"}),["queued","running"].includes(h.status)&&c.jsxs("button",{className:"text-button danger",onClick:()=>o(h.id),children:[c.jsx($u,{size:9,fill:"currentColor"})," Stop"]}),h.status==="completed"&&!h.remote&&c.jsx("a",{className:"text-button",href:"/?view=results",children:"View results"}),h.remote?.workspace_url&&c.jsx("a",{className:"text-button",href:h.remote.workspace_url,target:"_blank",rel:"noreferrer",children:"Remote results ↗"})]}),h.has_final_splat&&c.jsx(Ep,{jobId:h.id,compact:!0})]},h.id)):c.jsxs("div",{className:"empty-state",children:[c.jsx(pp,{size:20}),c.jsx("strong",{children:"No runs yet"}),c.jsx("span",{children:"Configure your first reconstruction in New run."})]})})]})}function r1(){return c.jsxs("div",{children:[c.jsx("div",{className:"panel-title",children:c.jsxs("div",{children:[c.jsx("h3",{children:"Reconstructions"}),c.jsx("p",{children:"Open a scene in the 3D viewer"})]})}),c.jsxs("div",{id:"info",className:"info-summary",role:"status",children:[c.jsx("div",{className:"info-pill","data-role":"count",children:"—"}),c.jsxs("div",{className:"info-details",children:[c.jsx("div",{className:"info-title","data-role":"title",children:"Loading reconstructions…"}),c.jsx("div",{className:"info-path","data-role":"path",children:"Checking workspace…"})]})]}),c.jsx("input",{type:"text",id:"filter",placeholder:"Filter scenes…","aria-label":"Filter scenes"}),c.jsx("div",{id:"sceneList"})]})}function f1({job:u,live:r,logsOpen:f,setLogsOpen:o,visible:m,onCancel:h,onClose:S}){const E=g.useRef(null),j=g.useRef(null),[y,p]=g.useState(null),[M,O]=g.useState(!1);g.useEffect(()=>{const q=E.current,$=q?.parentElement;if(!q||!$||typeof ResizeObserver>"u")return;const W=()=>p(ne=>{if(!ne)return null;const ee=$.getBoundingClientRect(),Me=Math.min(ne.width,ee.width),Ce=q.getBoundingClientRect().height;return{left:Math.max(0,Math.min(ee.width-Me,ne.left)),top:Math.max(0,Math.min(ee.height-Ce,ne.top)),width:Me}}),K=new ResizeObserver(W);return K.observe($),()=>K.disconnect()},[]);const Y=q=>{if(q.target.closest("button, a, input, select"))return;const $=E.current,W=$?.parentElement;if(!$||!W||q.button!==0)return;q.preventDefault(),q.currentTarget.setPointerCapture(q.pointerId);const K=$.getBoundingClientRect(),ne=W.getBoundingClientRect(),ee={pointerX:q.clientX,pointerY:q.clientY,left:K.left-ne.left,top:K.top-ne.top,width:K.width,maxLeft:Math.max(0,ne.width-K.width),maxTop:Math.max(0,ne.height-K.height)};j.current=ee,p({left:ee.left,top:ee.top,width:ee.width}),O(!0)},H=q=>{const $=j.current;$&&p({left:Math.max(0,Math.min($.maxLeft,$.left+q.clientX-$.pointerX)),top:Math.max(0,Math.min($.maxTop,$.top+q.clientY-$.pointerY)),width:$.width})},V=q=>{j.current&&(j.current=null,O(!1),q.currentTarget.hasPointerCapture(q.pointerId)&&q.currentTarget.releasePointerCapture(q.pointerId))};if(!u||!m)return null;const X=typeof r?.progress=="number"&&Number.isFinite(r.progress)?r.progress:u.status==="completed"?1:0,k=typeof r?.loss=="number"&&Number.isFinite(r.loss)?`loss ${r.loss.toFixed(4)}`:"",Z=typeof r?.splat_count=="number"&&Number.isFinite(r.splat_count)?`${r.splat_count.toLocaleString()} splats`:"",w=y?{left:y.left,top:y.top,width:y.width,right:"auto",bottom:"auto"}:void 0;return c.jsxs("div",{ref:E,className:`run-status-bar ${M?"is-dragging":""}`,"data-status":u.status,style:w,title:"Drag to move run status",onPointerDown:Y,onPointerMove:H,onPointerUp:V,onPointerCancel:V,children:[c.jsxs("div",{className:"status-copy status-drag-handle",onDoubleClick:()=>p(null),children:[c.jsx("span",{className:"status-dot"}),c.jsxs("div",{children:[c.jsxs("strong",{children:[u.name," · ",Cp(u.status)]}),c.jsx("small",{children:u.error||(r?.stage==="gaussian_splatting"?"Optimizing Gaussian splats":"Running reconstruction pipeline")})]})]}),c.jsxs("div",{className:"status-metrics",children:[c.jsx("span",{children:r?.max_steps?`${Number(r.step).toLocaleString()} / ${Number(r.max_steps).toLocaleString()} steps`:""}),c.jsx("span",{children:k}),c.jsx("span",{children:Z})]}),c.jsxs("div",{className:"status-actions",children:[u.has_final_splat&&c.jsx(Ep,{jobId:u.id}),["queued","running"].includes(u.status)&&c.jsxs("button",{className:"secondary-action stop-process",type:"button",onClick:()=>h(u.id),children:[c.jsx($u,{size:10,fill:"currentColor"})," Stop"]}),c.jsxs("button",{className:"secondary-action",onClick:()=>o(!f),children:[c.jsx(er,{size:13})," Logs"]}),c.jsx("button",{className:"status-close",type:"button",title:"Close run status","aria-label":"Close run status",onClick:S,children:c.jsx(Da,{size:15})})]}),c.jsx(Vy,{className:"run-progress-track",value:X*100,children:c.jsx(Xy,{className:"run-progress-fill",style:{transform:`translateX(-${100-X*100}%)`}})})]})}function d1({open:u,lines:r,onClose:f}){const o=g.useRef(null),m=g.useRef(null),[h,S]=g.useState(null),[E,j]=g.useState(!1),y=async()=>{await jp(r.join(` -`))&&(j(!0),m.current!==null&&window.clearTimeout(m.current),m.current=window.setTimeout(()=>j(!1),1e3))};g.useEffect(()=>()=>{m.current!==null&&window.clearTimeout(m.current)},[]);const p=H=>{if(H.target.closest("button"))return;const V=o.current,X=V?.parentElement;if(!V||!X)return;H.preventDefault(),H.currentTarget.setPointerCapture(H.pointerId);const k=V.getBoundingClientRect(),Z=X.getBoundingClientRect(),w={pointerX:H.clientX,pointerY:H.clientY,left:k.left-Z.left,top:k.top-Z.top,width:k.width,height:k.height,maxLeft:Z.width-k.width,maxTop:Z.height-k.height};S({left:w.left,top:w.top,width:w.width,height:w.height});const q=W=>S({left:Math.max(0,Math.min(w.maxLeft,w.left+W.clientX-w.pointerX)),top:Math.max(0,Math.min(w.maxTop,w.top+W.clientY-w.pointerY)),width:w.width,height:w.height}),$=()=>{window.removeEventListener("pointermove",q),window.removeEventListener("pointerup",$),window.removeEventListener("pointercancel",$)};window.addEventListener("pointermove",q),window.addEventListener("pointerup",$,{once:!0}),window.addEventListener("pointercancel",$,{once:!0})},M=H=>V=>{const X=o.current,k=X?.parentElement;if(!X||!k)return;V.preventDefault(),V.stopPropagation(),V.currentTarget.setPointerCapture(V.pointerId);const Z=X.getBoundingClientRect(),w=k.getBoundingClientRect(),q={pointerX:V.clientX,pointerY:V.clientY,left:Z.left-w.left,top:Z.top-w.top,right:Z.right-w.left,bottom:Z.bottom-w.top,containerWidth:w.width,containerHeight:w.height};S({left:q.left,top:q.top,width:Z.width,height:Z.height});const $=K=>{const ne=K.clientX-q.pointerX,ee=K.clientY-q.pointerY,Me=H.includes("w")?Math.max(0,Math.min(q.right-300,q.left+ne)):q.left,Ce=H.includes("e")?Math.min(q.containerWidth,Math.max(q.left+300,q.right+ne)):q.right,xe=H.includes("n")?Math.max(0,Math.min(q.bottom-150,q.top+ee)):q.top,ce=H.includes("s")?Math.min(q.containerHeight,Math.max(q.top+150,q.bottom+ee)):q.bottom;S({left:Me,top:xe,width:Ce-Me,height:ce-xe})},W=()=>{window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",W),window.removeEventListener("pointercancel",W)};window.addEventListener("pointermove",$),window.addEventListener("pointerup",W,{once:!0}),window.addEventListener("pointercancel",W,{once:!0})};if(!u)return null;const O=h?Math.max(8,Math.min(16,9+(h.width-420)/140+(h.height-240)/120)):9,Y=h?{left:h.left,top:h.top,width:h.width,height:h.height,right:"auto",bottom:"auto","--log-font-size":`${O}px`}:void 0;return c.jsxs("div",{ref:o,className:"log-drawer",role:"dialog","aria-label":"Run logs",style:Y,children:[["nw","ne","sw","se"].map(H=>c.jsx("button",{className:`log-resize-handle ${H}`,type:"button",title:"Resize logs","aria-label":`Resize logs from ${H}`,onPointerDown:M(H)},H)),c.jsxs("div",{className:"log-header",onPointerDown:p,children:[c.jsxs("strong",{children:[c.jsx(er,{size:12})," Run logs"]}),c.jsxs("div",{className:"log-header-actions",children:[c.jsxs("button",{className:"log-copy",type:"button",title:"Copy all logs","aria-label":"Copy all logs",onClick:y,children:[E?c.jsx(al,{size:12}):c.jsx(bp,{size:12}),c.jsx("span",{children:E?"Copied!":"Copy"})]}),c.jsx("button",{type:"button",title:"Minimize logs","aria-label":"Minimize logs",onClick:f,children:c.jsx(wo,{size:15})}),c.jsx("button",{type:"button",title:"Close logs","aria-label":"Close logs",onClick:f,children:c.jsx(Da,{size:14})})]})]}),c.jsx("pre",{id:"runLogs",children:r.join(` -`)})]})}function m1({setup:u,refreshing:r,onRefresh:f,onSetupChange:o,hasActiveJob:m}){const[h,S]=g.useState(!1),[E,j]=g.useState(!1),[y,p]=g.useState(null),[M,O]=g.useState({}),Y=m?"with-active-job":"",H=async k=>{if(!(!k.action?.enabled||y)){p(k.id),O(Z=>({...Z,[k.id]:""}));try{const Z=await Gt(`/api/setup/${encodeURIComponent(k.id)}/install`,{method:"POST"});o(Z.setup)}catch(Z){O(w=>({...w,[k.id]:wl(Z)}))}finally{p(null)}}};if(E)return c.jsx("button",{className:`setup-reopen ${Y}`,type:"button",title:"Show setup checks","aria-label":"Show setup checks",onClick:()=>j(!1),children:c.jsx(K0,{size:15})});const V=u?.status??"warning",X=u?.counts.optional??0;return c.jsxs("section",{className:`setup-panel ${h?"collapsed":""} ${Y}`,"aria-label":"Setup checks","aria-live":"polite",children:[c.jsxs("header",{className:"setup-panel-header",children:[c.jsx("span",{className:`setup-overall-icon ${V}`,"aria-hidden":"true",children:V==="ready"?c.jsx(Y0,{size:16}):c.jsx(Ti,{size:16})}),c.jsxs("div",{className:"setup-panel-copy",children:[c.jsx("span",{children:"SETUP CHECKS"}),c.jsx("strong",{children:u?.summary??"Checking environment…"})]}),c.jsxs("div",{className:"setup-panel-actions",children:[c.jsx("button",{type:"button",title:"Refresh checks","aria-label":"Refresh setup checks",onClick:f,disabled:r,children:c.jsx(tl,{className:r?"spin":"",size:13})}),c.jsx("button",{type:"button",title:h?"Expand checks":"Collapse checks","aria-label":h?"Expand setup checks":"Collapse setup checks",onClick:()=>S(k=>!k),children:h?c.jsx(vp,{size:14}):c.jsx(L0,{size:14})}),c.jsx("button",{type:"button",title:"Close checks","aria-label":"Close setup checks",onClick:()=>j(!0),children:c.jsx(Da,{size:14})})]})]}),!h&&c.jsx("div",{className:"setup-panel-body",children:u?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"setup-summary-line",children:[c.jsxs("span",{children:[u.counts.ready," passed"]}),X>0&&c.jsxs("span",{children:[X," optional unavailable"]})]}),c.jsx("ul",{children:u.items.map(k=>c.jsxs("li",{"data-state":k.state,children:[c.jsx("span",{className:"setup-check-mark","aria-hidden":"true",children:k.state==="ready"?c.jsx(al,{size:12}):k.state==="error"?c.jsx(Da,{size:12}):c.jsx("span",{})}),c.jsxs("div",{className:"setup-check-content",children:[c.jsxs("div",{className:"setup-check-title",children:[c.jsx("strong",{children:k.label}),c.jsxs("span",{className:"setup-check-tools",children:[!k.required&&c.jsx("em",{children:"optional"}),k.action&&c.jsxs("button",{className:"setup-install",type:"button",disabled:!k.action.enabled||!!y,title:k.action.reason||k.action.label,onClick:()=>H(k),children:[y===k.id?c.jsx(tl,{className:"spin",size:9}):k.action.enabled?c.jsx(Sp,{size:9}):null,c.jsx("span",{children:y===k.id?"Working…":k.action.label})]})]})]}),c.jsx("small",{className:M[k.id]?"setup-action-error":void 0,children:M[k.id]||k.detail})]})]},k.id))})]}):c.jsxs("div",{className:"setup-loading",children:[c.jsx(tl,{className:"spin",size:13})," Inspecting this machine…"]})})]})}function h1({job:u,live:r}){const f=r?.dask,o=f?.memory_limit_bytes?Math.min(1,f.memory_bytes/f.memory_limit_bytes):0,m=r?.stage==="gaussian_splatting"?"Optimizing splats":u.status==="queued"?"Waiting to start":"Reconstructing scene";return c.jsxs("section",{className:"dask-stats","aria-label":"Live Dask status",children:[c.jsxs("div",{className:"dask-stats-heading",children:[c.jsxs("div",{children:[c.jsx("span",{children:"DASK LIVE"}),c.jsx("strong",{children:m})]}),f?.dashboard_url&&c.jsx("a",{href:f.dashboard_url,target:"_blank",rel:"noreferrer",children:"Open dashboard ↗"})]}),f?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"dask-stat-grid",children:[c.jsxs("div",{children:[c.jsx("span",{children:"Workers"}),c.jsx("strong",{children:f.workers}),c.jsxs("small",{children:[f.threads," threads"]})]}),c.jsxs("div",{children:[c.jsx("span",{children:"Running"}),c.jsx("strong",{children:f.running_tasks}),c.jsxs("small",{children:[f.pending_tasks," pending"]})]}),c.jsxs("div",{children:[c.jsx("span",{children:"Finished"}),c.jsx("strong",{children:f.completed_tasks}),c.jsx("small",{children:f.failed_tasks?`${f.failed_tasks} failed`:"no errors"})]}),c.jsxs("div",{children:[c.jsx("span",{children:"CPU"}),c.jsxs("strong",{children:[Math.round(f.cpu_percent),"%"]}),c.jsx("small",{children:"across workers"})]})]}),c.jsxs("div",{className:"dask-memory",children:[c.jsxs("div",{children:[c.jsx("span",{children:"Memory"}),c.jsxs("strong",{children:[ji(f.memory_bytes)," / ",ji(f.memory_limit_bytes)]})]}),c.jsx("div",{className:"dask-memory-track",children:c.jsx("span",{style:{width:`${o*100}%`}})})]})]}):c.jsxs("div",{className:"dask-stats-waiting",children:[c.jsx("span",{className:"dask-pulse"})," Starting workers…"]})]})}function p1(u,r){if(r?.stage==="gaussian_splatting"){const o=Number(r.step||0),m=Number(r.max_steps||0);return m>0?`GTSFM: Optimizing Gaussian splats · ${o.toLocaleString()} / ${m.toLocaleString()} steps`:"GTSFM: Initializing Gaussian optimization…"}return r?.message?r.message:u.status==="queued"?u.remote?"Waiting for the Modal GPU worker…":"Waiting for the reconstruction worker…":[...u.log_tail||[]].reverse().find(o=>/GTSFM|partition|VGGT|Gaussian|splat/i.test(o))?.replace(/^.*?\b(?:DEBUG|INFO|WARNING|ERROR|CRITICAL):\s*/,"")||"GTSFM: Preparing the reconstruction pipeline…"}function v1({activeJob:u,live:r,logsOpen:f,setLogsOpen:o,statusBarOpen:m,setStatusBarOpen:h,onCancelJob:S,setup:E,setupRefreshing:j,onRefreshSetup:y,onSetupChange:p}){const M=()=>{h(!1),o(!1)},O=!!(u&&["queued","running"].includes(u.status)),Y=!!(u&&(u.spec.splat_implementation||"none")!=="none"),H=!!(r?.preview_url||r?.final_url||u?.has_final_splat),V=!!(u&&Y&&["queued","running"].includes(u.status)&&!H);return c.jsxs("main",{id:"main-content",children:[c.jsx(f1,{job:u,live:r,logsOpen:f,setLogsOpen:o,visible:m,onCancel:S,onClose:M}),c.jsx(m1,{setup:E,refreshing:j,onRefresh:y,onSetupChange:p,hasActiveJob:!!(u&&m)}),c.jsxs("div",{id:"sceneStats",className:O?"dask-active":void 0,children:[c.jsxs("div",{className:"stat-group","data-mode":"scene",children:[c.jsxs("div",{className:"stat-pair",children:[c.jsx("span",{className:"label",children:"Cameras"}),c.jsx("span",{className:"value",id:"statCameras",children:"0"})]}),c.jsxs("div",{className:"stat-pair",children:[c.jsx("span",{className:"label",children:"Points"}),c.jsx("span",{className:"value",id:"statPoints",children:"0"})]}),c.jsxs("div",{className:"stat-wide",children:[c.jsx("span",{className:"label",children:"Image"}),c.jsx("span",{className:"value",id:"statImageName",children:"—"})]})]}),c.jsx("div",{className:"stat-group","data-mode":"splat",children:c.jsxs("div",{className:"stat-pair",children:[c.jsx("span",{className:"label",children:"Splats"}),c.jsx("span",{className:"value",id:"statSplats",children:"0"})]})}),O&&u&&c.jsx(h1,{job:u,live:r})]}),c.jsx("canvas",{id:"renderCanvas"}),c.jsxs("div",{id:"hud",children:[c.jsxs("label",{className:"background-control",children:["BG ",c.jsxs("select",{id:"backgroundSelect",defaultValue:"dark","aria-label":"Viewer background",children:[c.jsx("option",{value:"dark",children:"Dark"}),c.jsx("option",{value:"graphite",children:"Graphite"}),c.jsx("option",{value:"light-gray",children:"Light gray"}),c.jsx("option",{value:"white",children:"White"})]})]}),c.jsx("button",{id:"prevCamBtn",className:"hud-scene-only",title:"Previous camera",children:c.jsx(gp,{size:14})}),c.jsx("button",{id:"nextCamBtn",className:"hud-scene-only",title:"Next camera",children:c.jsx(yp,{size:14})}),c.jsx("button",{id:"toggleStats",children:"Hide stats"}),c.jsxs("label",{className:"hud-scene-only",children:[c.jsx("input",{type:"checkbox",id:"toggleCams",defaultChecked:!0})," Cameras"]}),c.jsxs("label",{className:"hud-scene-only",children:["Point size ",c.jsx("input",{type:"range",id:"ptSize",min:"1",max:"10",defaultValue:"2"})]}),c.jsx("button",{id:"toggleGround",type:"button","aria-pressed":"true",children:"Hide plane"}),c.jsxs("label",{className:"plane-height-control",children:["Plane Y ",c.jsx("input",{type:"range",id:"groundY",min:"-5",max:"5",step:"0.1",defaultValue:"0","aria-label":"Plane vertical position"}),c.jsx("output",{id:"groundYValue",htmlFor:"groundY",children:"0.0"})]})]}),c.jsx("a",{className:"viewport-github",href:"https://github.com/borglab/gtsfm",target:"_blank",rel:"noreferrer",title:"Open GTSFM on GitHub","aria-label":"Open GTSFM GitHub repository",children:c.jsx(X0,{size:16})}),c.jsx(d1,{open:f,lines:u?.log_tail||[],onClose:()=>o(!1)}),V&&u&&c.jsx("div",{className:"pipeline-wait-overlay",role:"status","aria-live":"polite",children:c.jsxs("div",{className:"pipeline-wait-content",children:[c.jsx("span",{children:"RECONSTRUCTION IN PROGRESS"}),c.jsx("strong",{children:p1(u,r)}),c.jsxs("div",{className:"pipeline-wait-dots","aria-hidden":"true",children:[c.jsx("i",{}),c.jsx("i",{}),c.jsx("i",{})]}),c.jsx("small",{children:"The first live Gaussian preview will appear here automatically."})]})}),c.jsx("div",{id:"loadingOverlay",className:"loading-overlay",role:"status",children:c.jsxs("div",{className:"loading-box",children:[c.jsx("span",{id:"loadingMessage",children:"Loading…"}),c.jsx("div",{className:"loading-progress-track",children:c.jsx("div",{className:"loading-progress-fill",id:"loadingProgress"})})]})})]})}function g1(u){const r=u.devices.filter(S=>!S.status||S.status==="available");if(u.devices.find(S=>S.kind==="mps"))return{title:"Apple Metal (MPS) is not supported",description:"Apple Silicon and MPS can run reconstruction, but GTSFM Gaussian splatting does not currently support this backend. Use a Remote VM with an NVIDIA GPU to generate splats."};const o=u.devices.find(S=>S.kind==="rocm"||/\b(amd|radeon|rocm)\b/i.test(`${S.label} ${S.details}`));if(o)return{title:"AMD ROCm is not supported",description:`${o.label} was detected. AMD ROCm can run reconstruction, but GTSFM Gaussian splatting currently requires NVIDIA CUDA. Use a Remote VM with an NVIDIA GPU to generate splats.`};const m=u.devices.find(S=>S.kind==="nvidia"||S.kind==="cuda"||/\bnvidia\b/i.test(S.label));if(m)return{title:"NVIDIA GPU found, but CUDA is not ready",description:`${m.label} was detected, but this PyTorch environment cannot currently use it for Gaussian splatting. Install a CUDA-enabled PyTorch setup, or use a Remote VM with NVIDIA CUDA.`};const h=r.find(S=>S.kind!=="cpu");return h?{title:`${h.label} is not supported for splats`,description:"This accelerator can still be used where supported for reconstruction, but GTSFM Gaussian splatting currently requires NVIDIA CUDA. Use a compatible Remote VM to generate splats."}:{title:"No supported GPU was detected",description:"This machine can run CPU reconstruction, but GTSFM Gaussian splatting currently requires an NVIDIA CUDA GPU. Use a Remote VM to generate splats."}}function y1({hardware:u,onClose:r,onUseRemote:f}){const o=g1(u);return c.jsxs("section",{className:"hardware-warning",role:"alertdialog","aria-labelledby":"hardware-warning-title","aria-describedby":"hardware-warning-description",children:[c.jsx("div",{className:"hardware-warning-icon","aria-hidden":"true",children:c.jsx(Ti,{size:18})}),c.jsxs("div",{className:"hardware-warning-copy",children:[c.jsx("span",{children:"HARDWARE NOTICE"}),c.jsx("strong",{id:"hardware-warning-title",children:o.title}),c.jsx("p",{id:"hardware-warning-description",children:o.description}),c.jsxs("div",{className:"hardware-warning-actions",children:[c.jsxs("button",{type:"button",className:"warning-primary",onClick:f,children:[c.jsx(Qu,{size:12})," Use Remote VM"]}),c.jsx("button",{type:"button",onClick:r,children:"Continue without splats"})]})]}),c.jsx("button",{className:"hardware-warning-close",type:"button",title:"Dismiss hardware warning","aria-label":"Dismiss hardware warning",onClick:r,children:c.jsx(Da,{size:14})})]})}const Tp="gtsfm-studio-sidebar-width",Uo=320,Ap=760;function _i(u){const r=Math.max(Uo,window.innerWidth-360);return Math.round(Math.min(Ap,r,Math.max(Uo,u)))}function b1(){try{const u=Number(window.localStorage.getItem(Tp));return _i(Number.isFinite(u)&&u>0?u:420)}catch{return 420}}function S1(){const[u,r]=g.useState(!1),[f,o]=g.useState(b1),[m,h]=g.useState(!1),S=g.useRef(null),[E,j]=g.useState(new URLSearchParams(location.search).get("view")==="results"?"results":"run"),[y,p]=g.useState(I0),[M,O]=g.useState(!0),[Y,H]=g.useState(""),[V,X]=g.useState(null),[k,Z]=g.useState(null),[w,q]=g.useState(!1),[$,W]=g.useState([]),[K,ne]=g.useState(!0),[ee,Me]=g.useState([]),[Ce,xe]=g.useState(null),[ce,Ne]=g.useState(null),[Ye,R]=g.useState(!1),[L,le]=g.useState(!0),[Ee,je]=g.useState(!1),[_,G]=g.useState(0),[Q,J]=g.useState(0),ue=g.useRef(null),se=g.useRef(null),Se=g.useCallback(()=>{S.current=null,h(!1),document.body.classList.remove("sidebar-is-resizing")},[]),Be=F=>{u||F.button!==0||(F.preventDefault(),S.current={pointerX:F.clientX,width:f},F.currentTarget.setPointerCapture(F.pointerId),h(!0),document.body.classList.add("sidebar-is-resizing"))},He=F=>{const oe=S.current;oe&&o(_i(oe.width+F.clientX-oe.pointerX))},Tt=F=>{if(F.key==="ArrowLeft"||F.key==="ArrowRight"){F.preventDefault();const oe=F.key==="ArrowRight"?1:-1;o(me=>_i(me+oe*(F.shiftKey?40:10)))}else F.key==="Home"&&(F.preventDefault(),o(420))};g.useEffect(()=>()=>document.body.classList.remove("sidebar-is-resizing"),[]),g.useEffect(()=>{try{window.localStorage.setItem(Tp,String(f))}catch{}},[f]),g.useEffect(()=>{const F=()=>o(oe=>_i(oe));return window.addEventListener("resize",F),()=>window.removeEventListener("resize",F)},[]);const Wt=g.useCallback(async()=>{try{const F=await Gt("/api/jobs");Me(F.items||[]),xe(oe=>oe||F.items?.find(me=>["queued","running"].includes(me.status))?.id||null)}catch(F){console.warn("Unable to refresh jobs",F)}},[]),ml=g.useCallback(async()=>{q(!0);try{Z(await Gt("/api/setup"))}catch(F){console.warn("Unable to inspect setup",F)}finally{q(!1)}},[]),il=g.useCallback(async()=>{O(!0),H("");try{p(await Gt("/api/configuration"))}catch(F){H(wl(F))}finally{O(!1)}},[]),ct=g.useCallback(async()=>{try{X(await Gt("/api/hardware"))}catch(F){console.warn("Unable to inspect hardware",F)}finally{ml()}},[ml]),ul=g.useCallback(async()=>{try{const F=await Gt("/api/samples");W(F.items)}catch(F){console.warn("Unable to load sample catalog",F)}finally{ne(!1)}},[]);g.useEffect(()=>{il(),ct(),ul(),Wt()},[il,ct,ul,Wt]);const P=ee.find(F=>F.id===Ce)??null;g.useEffect(()=>{Ce&&le(!0)},[Ce]),g.useEffect(()=>{let F=null,oe=null,me=!1;const mt=()=>{F=new WebSocket(bh("/api/events/jobs")),F.onmessage=Je=>{const cl=JSON.parse(Je.data);Me(cl.items||[]),xe(kt=>kt||cl.items?.find(pl=>["queued","running"].includes(pl.status))?.id||null)},F.onclose=()=>{me||(oe=window.setTimeout(mt,1e3))}};return mt(),()=>{me=!0,oe!==null&&clearTimeout(oe),F?.close()}},[]),g.useEffect(()=>{if(!P){Ne(null);return}Ne(null);const F=new WebSocket(bh(`/api/events/jobs/${encodeURIComponent(P.id)}`));return F.onmessage=oe=>{const me=JSON.parse(oe.data);Me(mt=>mt.map(Je=>Je.id===me.job.id?me.job:Je)),Ne(me.live)},()=>F.close()},[P?.id]),g.useEffect(()=>{if(!P||!ce)return;const F=P.status==="completed"&&ce.final_url?`${P.id}:${ce.final_url}`:null,oe=ce.preview_url?`${P.id}:${String(ce.preview_version??ce.preview_url)}`:null,me=F?{kind:"final",key:F,url:ce.final_url,label:`${P.name} · final`}:oe?{kind:"preview",key:oe,url:ce.preview_url,label:`${P.name} · live`}:null;if(!me||me.kind==="final"&&se.current===me.key||me.kind==="preview"&&ue.current===me.key)return;let mt=!1,Je=null,cl=0;const kt=async()=>{if(mt)return;const pl=window.gtsfmViewer;if(!pl||pl.isBusy()){Je=window.setTimeout(()=>{kt()},250);return}const ha=await pl.loadSplatsFile({splatsUrl:me.url,label:me.label});if(!mt){if(ha===!1){cl+=1,cl<3&&(Je=window.setTimeout(()=>{kt()},1200));return}me.kind==="final"?se.current=me.key:ue.current=me.key}};return kt(),()=>{mt=!0,Je!==null&&window.clearTimeout(Je)}},[P?.id,P?.status,ce?.final_url,ce?.preview_url,ce?.preview_version,Q]);const fa=async F=>{await fetch(`/api/jobs/${encodeURIComponent(F)}/cancel`,{method:"POST"}),await Wt()},hl=ee.filter(F=>["queued","running"].includes(F.status)).length,Ht=V?.devices.some(F=>F.supports_gaussian_splatting&&(!F.status||F.status==="available"))??!1,da=!!(V&&!Ht&&!Ee),ma=()=>{je(!0),j("run"),G(F=>F+1)};return c.jsxs("div",{className:"app-shell",children:[da&&V&&c.jsx(y1,{hardware:V,onClose:()=>je(!0),onUseRemote:ma}),c.jsxs("aside",{id:"sidebar",className:`${u?"sidebar-collapsed":""} ${m?"sidebar-resizing":""}`,style:{"--sidebar-width":`${f}px`},children:[c.jsx(e1,{collapsed:u,onToggle:()=>r(F=>!F)}),c.jsxs(U0,{className:"workspace-tabs",value:E,onValueChange:j,children:[c.jsxs(G0,{className:"studio-tabs","aria-label":"Workspace sections",children:[c.jsxs(xo,{className:"studio-tab",value:"run",children:[c.jsx(xp,{size:12})," New run"]}),c.jsxs(xo,{className:"studio-tab",value:"activity",children:[c.jsx(pp,{size:12})," Activity ",hl>0&&c.jsx("span",{id:"activeJobCount",children:hl})]}),c.jsxs(xo,{className:"studio-tab",value:"results",children:[c.jsx(q0,{size:12})," Results"]})]}),c.jsx(jo,{className:"studio-panel",value:"run",forceMount:!0,children:c.jsx(s1,{schema:y,hardware:V,samples:$,samplesLoading:K,onStarted:F=>{le(!0),xe(F.id),Wt()},onTabChange:j,remotePromptKey:_,schemaLoading:M,schemaError:Y,onRetrySchema:il})}),c.jsx(jo,{className:"studio-panel",value:"activity",forceMount:!0,children:c.jsx(o1,{jobs:ee,activeId:Ce,onSelect:F=>{le(!0),xe(F),ue.current=null,se.current=null,J(oe=>oe+1)},onCancel:fa,onRefresh:Wt})}),c.jsx(jo,{className:"studio-panel",value:"results",forceMount:!0,children:c.jsx(r1,{})})]}),c.jsx("div",{className:"sidebar-resize-handle",role:"separator","aria-label":"Resize side panel","aria-orientation":"vertical","aria-valuemin":Uo,"aria-valuemax":Ap,"aria-valuenow":f,tabIndex:u?-1:0,title:"Drag to resize side panel",onPointerDown:Be,onPointerMove:He,onPointerUp:Se,onPointerCancel:Se,onDoubleClick:()=>o(_i(420)),onKeyDown:Tt})]}),c.jsx(v1,{activeJob:P,live:ce,logsOpen:Ye,setLogsOpen:R,statusBarOpen:L,setStatusBarOpen:le,onCancelJob:fa,setup:k,setupRefreshing:w,onRefreshSetup:ml,onSetupChange:Z})]})}const zp=document.getElementById("root");if(!zp)throw new Error("GTSFM Studio root element is missing");Bo.flushSync(()=>Pg.createRoot(zp).render(c.jsx(S1,{}))); +Defaulting to \`null\`.`}kl($h,"getInvalidValueError");var Vy=qy,Xy=Yy,Qy=Object.defineProperty,Zy=(u,r)=>Qy(u,"name",{value:r,configurable:!0});function Fh(u){const[r,f]=g.useState(void 0);return ma(()=>{if(u){f({width:u.offsetWidth,height:u.offsetHeight});const o=new ResizeObserver(m=>{if(!Array.isArray(m)||!m.length)return;const h=m[0];let _,E;if("borderBoxSize"in h){const j=h.borderBoxSize,y=Array.isArray(j)?j[0]:j;_=y.inlineSize,E=y.blockSize}else _=u.offsetWidth,E=u.offsetHeight;f({width:_,height:E})});return o.observe(u,{box:"border-box"}),()=>o.unobserve(u)}else f(void 0)},[u]),r}Zy(Fh,"useSize");var Ky=Object.defineProperty,ha=(u,r)=>Ky(u,"name",{value:r,configurable:!0}),Zo="Switch",[Jy,M1]=va(Zo),[$y,Ko]=Jy(Zo);function Wh(u){const{__scopeSwitch:r,checked:f,children:o,defaultChecked:m,disabled:h,form:_,name:E,onCheckedChange:j,required:y,value:p="on",internal_do_not_use_render:M}=u,[O,Y]=Ai({prop:f,defaultProp:m??!1,onChange:j,caller:Zo}),[B,X]=g.useState(null),[Z,L]=g.useState(null),Q=g.useRef(!1),[k,H]=g.useReducer(V=>V+1,0),J=B?!!_||!!B.closest("form"):!0,ee={checked:O,setChecked:Y,disabled:h,control:B,setControl:X,name:E,form:_,value:p,hasConsumerStoppedPropagationRef:Q,userInteractionCount:k,onUserInteraction:H,required:y,defaultChecked:m,isFormControl:J,bubbleInput:Z,setBubbleInput:L};return c.jsx($y,{scope:r,...ee,children:Ih(M)?M(ee):o})}ha(Wh,"SwitchProvider");var Fy="SwitchTrigger",Wy=g.forwardRef(ha(function({__scopeSwitch:r,onClick:f,...o},m){const{control:h,form:_,value:E,disabled:j,checked:y,required:p,setControl:M,setChecked:O,hasConsumerStoppedPropagationRef:Y,onUserInteraction:B,isFormControl:X,bubbleInput:Z}=Ko(Fy,r),L=ul(m,M),Q=g.useRef(y);return g.useEffect(()=>{const k=_?h?.ownerDocument.getElementById(_):h?.form;if(k instanceof HTMLFormElement){const H=ha(()=>O(Q.current),"reset");return k.addEventListener("reset",H),()=>k.removeEventListener("reset",H)}},[h,_,O]),c.jsx(zt.button,{type:"button",role:"switch","aria-checked":y,"aria-required":p,"data-state":Jo(y),"data-disabled":j?"":void 0,disabled:j,value:E,...o,ref:L,onClick:kt(f,k=>{B(),O(H=>!H),Z&&X&&(Y.current=k.isPropagationStopped(),Y.current||k.stopPropagation())})})},"SwitchTrigger")),Iy=g.forwardRef(ha(function(r,f){const{__scopeSwitch:o,name:m,checked:h,defaultChecked:_,required:E,disabled:j,value:y,onCheckedChange:p,form:M,...O}=r;return c.jsx(Wh,{__scopeSwitch:o,checked:h,defaultChecked:_,disabled:j,required:E,onCheckedChange:p,name:m,form:M,value:y,internal_do_not_use_render:({isFormControl:Y})=>c.jsxs(c.Fragment,{children:[c.jsx(Wy,{...O,ref:f,__scopeSwitch:o}),Y&&c.jsx(l0,{__scopeSwitch:o})]})})},"Switch")),Py="SwitchThumb",e0=g.forwardRef(ha(function(r,f){const{__scopeSwitch:o,...m}=r,h=Ko(Py,o);return c.jsx(zt.span,{"data-state":Jo(h.checked),"data-disabled":h.disabled?"":void 0,...m,ref:f})},"SwitchThumb")),t0="SwitchBubbleInput",l0=g.forwardRef(ha(function({__scopeSwitch:r,onClick:f,...o},m){const{control:h,hasConsumerStoppedPropagationRef:_,userInteractionCount:E,checked:j,defaultChecked:y,required:p,disabled:M,name:O,value:Y,form:B,bubbleInput:X,setBubbleInput:Z}=Ko(t0,r),L=ul(m,Z),Q=Fh(h),k=g.useRef(!1),H=g.useRef(j),J=g.useRef(E);g.useEffect(()=>{const V=X;if(!V)return;const ue=window.HTMLInputElement.prototype,je=Object.getOwnPropertyDescriptor(ue,"checked").set,Me=E!==J.current;J.current=E;const de=H.current!==j;H.current=j;const me=!(Me&&_.current);if(de&&je){k.current=!Me;const Ne=new Event("click",{bubbles:me});je.call(V,j),V.dispatchEvent(Ne),k.current=!1}},[X,j,_,E]);const ee=g.useRef(j);return c.jsx(zt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:y??ee.current,required:p,disabled:M,name:O,value:Y,form:B,...o,tabIndex:-1,ref:L,onClick:kt(f,V=>{k.current&&V.stopPropagation()}),style:{...o.style,...Q,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function Ih(u){return typeof u=="function"}ha(Ih,"isFunction");function Jo(u){return u?"checked":"unchecked"}ha(Jo,"getState");var a0=Object.defineProperty,ct=(u,r)=>a0(u,"name",{value:r,configurable:!0});function Ph(u){const r=u+"CollectionProvider",[f,o]=va(r),[m,h]=f(r,{collectionRef:{current:null},itemMap:new Map}),_=ct(X=>{const{scope:Z,children:L}=X,Q=g.useRef(null),k=g.useRef(new Map).current;return c.jsx(m,{scope:Z,itemMap:k,collectionRef:Q,children:L})},"CollectionProvider");_.displayName=r;const E=u+"CollectionSlot",j=zn(E),y=g.forwardRef((X,Z)=>{const{scope:L,children:Q}=X,k=h(E,L),H=ul(Z,k.collectionRef);return c.jsx(j,{ref:H,children:Q})});y.displayName=E;const p=u+"CollectionItemSlot",M="data-radix-collection-item",O=zn(p),Y=g.forwardRef((X,Z)=>{const{scope:L,children:Q,...k}=X,H=g.useRef(null),J=ul(Z,H),ee=h(p,L);return g.useEffect(()=>(ee.itemMap.set(H,{ref:H,...k}),()=>{ee.itemMap.delete(H)})),c.jsx(O,{[M]:"",ref:J,children:Q})});Y.displayName=p;function B(X){const Z=h(u+"CollectionConsumer",X);return g.useCallback(()=>{const Q=Z.collectionRef.current;if(!Q)return[];const k=Array.from(Q.querySelectorAll(`[${M}]`));return Array.from(Z.itemMap.values()).sort((ee,V)=>k.indexOf(ee.ref.current)-k.indexOf(V.ref.current))},[Z.collectionRef,Z.itemMap])}return ct(B,"useCollection"),[{Provider:_,Slot:y,ItemSlot:Y},B,o]}ct(Ph,"createCollection");var vh=new WeakMap,tt,Bt,xo=(Bt=class extends Map{constructor(f){super(f);lh(this,tt);po(this,tt,[...super.keys()]),vh.set(this,!0)}set(f,o){return vh.get(this)&&(this.has(f)?gt(this,tt)[gt(this,tt).indexOf(f)]=f:gt(this,tt).push(f)),super.set(f,o),this}insert(f,o,m){const h=this.has(o),_=gt(this,tt).length,E=$o(f);let j=E>=0?E:_+E;const y=j<0||j>=_?-1:j;if(y===this.size||h&&y===this.size-1||y===-1)return this.set(o,m),this;const p=this.size+(h?0:1);E<0&&j++;const M=[...gt(this,tt)];let O,Y=!1;for(let B=j;B=this.size&&(h=this.size-1),this.at(h)}keyFrom(f,o){const m=this.indexOf(f);if(m===-1)return;let h=m+o;return h<0&&(h=0),h>=this.size&&(h=this.size-1),this.keyAt(h)}find(f,o){let m=0;for(const h of this){if(Reflect.apply(f,o,[h,m,this]))return h;m++}}findIndex(f,o){let m=0;for(const h of this){if(Reflect.apply(f,o,[h,m,this]))return m;m++}return-1}filter(f,o){const m=[];let h=0;for(const _ of this)Reflect.apply(f,o,[_,h,this])&&m.push(_),h++;return new Bt(m)}map(f,o){const m=[];let h=0;for(const _ of this)m.push([_[0],Reflect.apply(f,o,[_,h,this])]),h++;return new Bt(m)}reduce(...f){const[o,m]=f;let h=0,_=m??this.at(0);for(const E of this)h===0&&f.length===1?_=E:_=Reflect.apply(o,this,[_,E,h,this]),h++;return _}reduceRight(...f){const[o,m]=f;let h=m??this.at(-1);for(let _=this.size-1;_>=0;_--){const E=this.at(_);_===this.size-1&&f.length===1?h=E:h=Reflect.apply(o,this,[h,E,_,this])}return h}toSorted(f){const o=[...this.entries()].sort(f);return new Bt(o)}toReversed(){const f=new Bt;for(let o=this.size-1;o>=0;o--){const m=this.keyAt(o),h=this.get(m);f.set(m,h)}return f}toSpliced(...f){const o=[...this.entries()];return o.splice(...f),new Bt(o)}slice(f,o){const m=new Bt;let h=this.size-1;if(f===void 0)return m;f<0&&(f=f+this.size),o!==void 0&&o>0&&(h=o-1);for(let _=f;_<=h;_++){const E=this.keyAt(_),j=this.get(E);m.set(E,j)}return m}every(f,o){let m=0;for(const h of this){if(!Reflect.apply(f,o,[h,m,this]))return!1;m++}return!0}some(f,o){let m=0;for(const h of this){if(Reflect.apply(f,o,[h,m,this]))return!0;m++}return!1}},tt=new WeakMap,ct(Bt,"OrderedDict"),Bt);function Ju(u,r){if("at"in Array.prototype)return Array.prototype.at.call(u,r);const f=ep(u,r);return f===-1?void 0:u[f]}ct(Ju,"at");function ep(u,r){const f=u.length,o=$o(r),m=o>=0?o:f+o;return m<0||m>=f?-1:m}ct(ep,"toSafeIndex");function $o(u){return u!==u||u===0?0:Math.trunc(u)}ct($o,"toSafeInteger");function n0(u){const r=u+"CollectionProvider",[f,o]=va(r),[m,h]=f(r,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new xo,setItemMap:ct(()=>{},"setItemMap")}),_=ct(({state:k,...H})=>k?c.jsx(j,{...H,state:k}):c.jsx(E,{...H}),"CollectionProvider");_.displayName=r;const E=ct(k=>{const H=Z();return c.jsx(j,{...k,state:H})},"CollectionInit");E.displayName=r+"Init";const j=ct(k=>{const{scope:H,children:J,state:ee}=k,V=g.useRef(null),[ue,te]=g.useState(null),je=ul(V,te),[Me,de]=ee;return g.useEffect(()=>{if(!ue)return;const me=ap(()=>{});return me.observe(ue,{childList:!0,subtree:!0}),()=>{me.disconnect()}},[ue]),c.jsx(m,{scope:H,itemMap:Me,setItemMap:de,collectionRef:je,collectionRefObject:V,collectionElement:ue,children:J})},"CollectionProviderImpl");j.displayName=r+"Impl";const y=u+"CollectionSlot",p=zn(y),M=g.forwardRef((k,H)=>{const{scope:J,children:ee}=k,V=h(y,J),ue=ul(H,V.collectionRef);return c.jsx(p,{ref:ue,children:ee})});M.displayName=y;const O=u+"CollectionItemSlot",Y="data-radix-collection-item",B=zn(O),X=g.forwardRef((k,H)=>{const{scope:J,children:ee,...V}=k,ue=g.useRef(null),[te,je]=g.useState(null),Me=ul(H,ue,je),de=h(O,J),{setItemMap:me}=de,Ne=g.useRef(V);tp(Ne.current,V)||(Ne.current=V);const Fe=Ne.current;return g.useEffect(()=>{const R=Fe;return me(q=>te?q.has(te)?q.set(te,{...R,element:te}).toSorted(Uo):(q.set(te,{...R,element:te}),q.toSorted(Uo)):q),()=>{me(q=>!te||!q.has(te)?q:(q.delete(te),new xo(q)))}},[te,Fe,me]),c.jsx(B,{[Y]:"",ref:Me,children:ee})});X.displayName=O;function Z(){return g.useState(new xo)}ct(Z,"useInitCollection");function L(k){const{itemMap:H}=h(u+"CollectionConsumer",k);return H}return ct(L,"useCollection"),[{Provider:_,Slot:M,ItemSlot:X},{createCollectionScope:o,useCollection:L,useInitCollection:Z}]}ct(n0,"createCollection");function tp(u,r){if(u===r)return!0;if(typeof u!="object"||typeof r!="object"||u==null||r==null)return!1;const f=Object.keys(u),o=Object.keys(r);if(f.length!==o.length)return!1;for(const m of f)if(!Object.prototype.hasOwnProperty.call(r,m)||u[m]!==r[m])return!1;return!0}ct(tp,"shallowEqual");function lp(u,r){return!!(r.compareDocumentPosition(u)&Node.DOCUMENT_POSITION_PRECEDING)}ct(lp,"isElementPreceding");function Uo(u,r){return!u[1].element||!r[1].element?0:lp(u[1].element,r[1].element)?-1:1}ct(Uo,"sortByDocumentPosition");function ap(u){return new MutationObserver(f=>{for(const o of f)if(o.type==="childList"){u();return}})}ct(ap,"getChildListObserver");var i0=Object.defineProperty,u0=(u,r)=>i0(u,"name",{value:r,configurable:!0});function np(u){const r=g.useRef(u);return g.useEffect(()=>{r.current=u}),g.useMemo(()=>((...f)=>r.current?.(...f)),[])}u0(np,"useCallbackRef");var c0=Object.defineProperty,s0=(u,r)=>c0(u,"name",{value:r,configurable:!0}),o0=g.createContext(void 0);function Fo(u){const r=g.useContext(o0);return u||r||"ltr"}s0(Fo,"useDirection");var r0=Object.defineProperty,Wo=(u,r)=>r0(u,"name",{value:r,configurable:!0}),jo=!1;function ip(){const[u,r]=g.useState(jo);return g.useEffect(()=>{jo||(jo=!0,r(!0))},[]),u}Wo(ip,"useIsHydrated");var up=Nn[" useSyncExternalStore ".trim().toString()];function cp(){return()=>{}}Wo(cp,"subscribe");function sp(){return up(cp,()=>!0,()=>!1)}Wo(sp,"useIsHydratedModern");var f0=typeof up=="function"?sp:ip,d0=Object.defineProperty,ka=(u,r)=>d0(u,"name",{value:r,configurable:!0}),Mo="rovingFocusGroup.onEntryFocus",m0={bubbles:!1,cancelable:!0},Iu="RovingFocusGroup",[Go,op,h0]=Ph(Iu),[p0,rp]=va(Iu,[h0]),[v0,g0]=p0(Iu),y0=g.forwardRef(ka(function(r,f){return c.jsx(Go.Provider,{scope:r.__scopeRovingFocusGroup,children:c.jsx(Go.Slot,{scope:r.__scopeRovingFocusGroup,children:c.jsx(b0,{...r,ref:f})})})},"RovingFocusGroup")),b0=g.forwardRef(ka(function(r,f){const{__scopeRovingFocusGroup:o,orientation:m,loop:h=!1,dir:_,currentTabStopId:E,defaultCurrentTabStopId:j,onCurrentTabStopIdChange:y,onEntryFocus:p,preventScrollOnEntryFocus:M=!1,...O}=r,Y=g.useRef(null),B=ul(f,Y),X=Fo(_),[Z,L]=Ai({prop:E,defaultProp:j??null,onChange:y,caller:Iu}),[Q,k]=g.useState(!1),H=np(p),J=op(o),ee=g.useRef(!1),[V,ue]=g.useState(0);return g.useEffect(()=>{const te=Y.current;if(te)return te.addEventListener(Mo,H),()=>te.removeEventListener(Mo,H)},[H]),c.jsx(v0,{scope:o,orientation:m,dir:X,loop:h,currentTabStopId:Z,onItemFocus:g.useCallback(te=>L(te),[L]),onItemShiftTab:g.useCallback(()=>k(!0),[]),onFocusableItemAdd:g.useCallback(()=>ue(te=>te+1),[]),onFocusableItemRemove:g.useCallback(()=>ue(te=>te-1),[]),children:c.jsx(zt.div,{tabIndex:Q||V===0?-1:0,"data-orientation":m,...O,ref:B,style:{outline:"none",...r.style},onMouseDown:kt(r.onMouseDown,()=>{ee.current=!0}),onFocus:kt(r.onFocus,te=>{const je=!ee.current;if(te.target===te.currentTarget&&je&&!Q){const Me=new CustomEvent(Mo,m0);if(te.currentTarget.dispatchEvent(Me),!Me.defaultPrevented){const de=J().filter(q=>q.focusable),me=de.find(q=>q.active),Ne=de.find(q=>q.id===Z),R=[me,Ne,...de].filter(Boolean).map(q=>q.ref.current);Io(R,M)}}ee.current=!1}),onBlur:kt(r.onBlur,()=>k(!1))})})},"RovingFocusGroupImpl")),S0="RovingFocusGroupItem",_0=g.forwardRef(ka(function(r,f){const{__scopeRovingFocusGroup:o,focusable:m=!0,active:h=!1,tabStopId:_,children:E,...j}=r,y=Fu(),p=_||y,M=g0(S0,o),O=M.currentTabStopId===p,Y=op(o),{onFocusableItemAdd:B,onFocusableItemRemove:X,currentTabStopId:Z}=M,L=f0();return ma(()=>{if(!(!L||!m))return B(),()=>X()},[L,m,B,X]),g.useEffect(()=>{if(!(L||!m))return B(),()=>X()},[L,m,B,X]),c.jsx(Go.ItemSlot,{scope:o,id:p,focusable:m,active:h,children:c.jsx(zt.span,{tabIndex:O?0:-1,"data-orientation":M.orientation,...j,ref:f,onMouseDown:kt(r.onMouseDown,Q=>{m?M.onItemFocus(p):Q.preventDefault()}),onFocus:kt(r.onFocus,()=>M.onItemFocus(p)),onKeyDown:kt(r.onKeyDown,Q=>{if(Q.key==="Tab"&&Q.shiftKey){M.onItemShiftTab();return}if(Q.target!==Q.currentTarget)return;const k=dp(Q,M.orientation,M.dir);if(k!==void 0){if(Q.metaKey||Q.ctrlKey||Q.altKey||Q.shiftKey)return;Q.preventDefault();let J=Y().filter(ee=>ee.focusable).map(ee=>ee.ref.current);if(k==="last")J.reverse();else if(k==="prev"||k==="next"){k==="prev"&&J.reverse();const ee=J.indexOf(Q.currentTarget);J=M.loop?mp(J,ee+1):J.slice(ee+1)}setTimeout(()=>Io(J))}}),children:typeof E=="function"?E({isCurrentTabStop:O,hasTabStop:Z!=null}):E})})},"RovingFocusGroupItem")),x0={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function fp(u,r){return r!=="rtl"?u:u==="ArrowLeft"?"ArrowRight":u==="ArrowRight"?"ArrowLeft":u}ka(fp,"getDirectionAwareKey");function dp(u,r,f){const o=fp(u.key,f);if(!(r==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(r==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return x0[o]}ka(dp,"getFocusIntent");function Io(u,r=!1){const f=document.activeElement;for(const o of u)if(o===f||(o.focus({preventScroll:r}),document.activeElement!==f))return}ka(Io,"focusFirst");function mp(u,r){return u.map((f,o)=>u[(r+o)%u.length])}ka(mp,"wrapArray");var j0=y0,M0=_0,C0=Object.defineProperty,On=(u,r)=>C0(u,"name",{value:r,configurable:!0}),Po="Tabs",[E0,C1]=va(Po,[rp]),hp=rp(),[T0,er]=E0(Po),A0=g.forwardRef(On(function(r,f){const{__scopeTabs:o,value:m,onValueChange:h,defaultValue:_,orientation:E="horizontal",dir:j,activationMode:y="automatic",...p}=r,M=Fo(j),[O,Y]=Ai({prop:m,onChange:h,defaultProp:_??"",caller:Po});return c.jsx(T0,{scope:o,baseId:Fu(),value:O,onValueChange:Y,orientation:E,dir:M,activationMode:y,children:c.jsx(zt.div,{dir:M,"data-orientation":E,...p,ref:f})})},"Tabs")),z0="TabsList",N0=g.forwardRef(On(function(r,f){const{__scopeTabs:o,loop:m=!0,...h}=r,_=er(z0,o),E=hp(o);return c.jsx(j0,{asChild:!0,...E,orientation:_.orientation,dir:_.dir,loop:m,children:c.jsx(zt.div,{role:"tablist","aria-orientation":_.orientation,...h,ref:f})})},"TabsList")),R0="TabsTrigger",O0=g.forwardRef(On(function(r,f){const{__scopeTabs:o,value:m,disabled:h=!1,..._}=r,E=er(R0,o),j=hp(o),y=tr(E.baseId,m),p=lr(E.baseId,m),M=m===E.value;return c.jsx(M0,{asChild:!0,...j,focusable:!h,active:M,children:c.jsx(zt.button,{type:"button",role:"tab","aria-selected":M,"aria-controls":p,"data-state":M?"active":"inactive","data-disabled":h?"":void 0,disabled:h,id:y,..._,ref:f,onMouseDown:kt(r.onMouseDown,O=>{!h&&O.button===0&&O.ctrlKey===!1?E.onValueChange(m):O.preventDefault()}),onKeyDown:kt(r.onKeyDown,O=>{h||O.target!==O.currentTarget||[" ","Enter"].includes(O.key)&&E.onValueChange(m)}),onFocus:kt(r.onFocus,()=>{const O=E.activationMode!=="manual";!M&&!h&&O&&E.onValueChange(m)})})})},"TabsTrigger")),D0="TabsContent",w0=g.forwardRef(On(function(r,f){const{__scopeTabs:o,value:m,forceMount:h,children:_,...E}=r,j=er(D0,o),y=tr(j.baseId,m),p=lr(j.baseId,m),M=m===j.value,O=g.useRef(M);return g.useEffect(()=>{const Y=requestAnimationFrame(()=>O.current=!1);return()=>cancelAnimationFrame(Y)},[]),c.jsx(Lh,{present:h||M,children:({present:Y})=>c.jsx(zt.div,{"data-state":M?"active":"inactive","data-orientation":j.orientation,role:"tabpanel","aria-labelledby":y,hidden:!Y,id:p,tabIndex:0,...E,ref:f,style:{...r.style,animationDuration:O.current?"0s":void 0},children:Y&&_})})},"TabsContent"));function tr(u,r){return`${u}-trigger-${r}`}On(tr,"makeTriggerId");function lr(u,r){return`${u}-content-${r}`}On(lr,"makeContentId");var U0=A0,G0=N0,Co=O0,Eo=w0;const B0=u=>u.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),pp=(...u)=>u.filter((r,f,o)=>!!r&&r.trim()!==""&&o.indexOf(r)===f).join(" ").trim();var H0={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"};const k0=g.forwardRef(({color:u="currentColor",size:r=24,strokeWidth:f=2,absoluteStrokeWidth:o,className:m="",children:h,iconNode:_,...E},j)=>g.createElement("svg",{ref:j,...H0,width:r,height:r,stroke:u,strokeWidth:o?Number(f)*24/Number(r):f,className:pp("lucide",m),...E},[..._.map(([y,p])=>g.createElement(y,p)),...Array.isArray(h)?h:[h]]));const He=(u,r)=>{const f=g.forwardRef(({className:o,...m},h)=>g.createElement(k0,{ref:h,iconNode:r,className:pp(`lucide-${B0(u)}`,o),...m}));return f.displayName=`${u}`,f};const vp=He("Activity",[["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"}]]);const q0=He("Box",[["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"}]]);const cl=He("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const gp=He("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const yp=He("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);const bp=He("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const L0=He("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Ni=He("CircleAlert",[["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"}]]);const Y0=He("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const Sp=He("Copy",[["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"}]]);const V0=He("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);const gh=He("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);const _p=He("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);const xp=He("FolderUp",[["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"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);const X0=He("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);const yh=He("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);const Bo=He("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const Q0=He("MonitorCog",[["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m15.2 4.9-.9-.4",key:"12wd2u"}],["path",{d:"m15.2 7.1-.9.4",key:"1r2vl7"}],["path",{d:"m16.9 3.2-.4-.9",key:"3zbo91"}],["path",{d:"m16.9 8.8-.4.9",key:"1qr2dn"}],["path",{d:"m19.5 2.3-.4.9",key:"1rjrkq"}],["path",{d:"m19.5 9.7-.4-.9",key:"heryx5"}],["path",{d:"m21.7 4.5-.9.4",key:"17fqt1"}],["path",{d:"m21.7 7.5-.9-.4",key:"14zyni"}],["path",{d:"M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7",key:"1tnzv8"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}]]);const jp=He("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const il=He("RefreshCw",[["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"}]]);const $u=He("Server",[["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"}]]);const Z0=He("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);const Pu=He("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const ar=He("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);const K0=He("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);const Ba=He("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);async function Mp(u){try{return await navigator.clipboard.writeText(u),!0}catch{const r=document.createElement("textarea");r.value=u,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.focus(),r.select();try{return document.execCommand("copy")}catch{return!1}finally{r.remove()}}}function J0({deployment:u,onCancel:r,onClose:f}){const o=g.useRef(null),m=g.useRef(null),[h,_]=g.useState(!1),E=u.log_tail.join(` +`)||"Waiting for Modal build output…";g.useEffect(()=>{const y=p=>{p.key==="Escape"&&f()};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[f]),g.useEffect(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},[u.log_tail.length]),g.useEffect(()=>()=>{m.current!==null&&window.clearTimeout(m.current)},[]);const j=async()=>{await Mp(E)&&(_(!0),m.current!==null&&window.clearTimeout(m.current),m.current=window.setTimeout(()=>_(!1),1e3))};return qo.createPortal(c.jsx("div",{className:"modal-log-backdrop",onMouseDown:y=>{y.target===y.currentTarget&&f()},children:c.jsxs("section",{className:"modal-log-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"modal-log-title",children:[c.jsxs("header",{children:[c.jsxs("div",{children:[c.jsx("span",{children:"MODAL SETUP & DEPLOYMENT"}),c.jsx("strong",{id:"modal-log-title",children:u.stage})]}),c.jsxs("small",{children:[u.gpu,u.cpu?` · ${u.cpu} CPU`:"",u.memory_mb?` · ${Ei(u.memory_mb*1024*1024)}`:""," · ",u.status]}),["queued","running"].includes(u.status)&&u.phase!=="verifying"&&c.jsxs("button",{className:"modal-dialog-stop",type:"button",onClick:r,title:"Stop Modal setup",children:[c.jsx(Pu,{size:11,fill:"currentColor"})," Stop"]}),c.jsxs("button",{type:"button",onClick:j,title:"Copy deployment logs",children:[h?c.jsx(cl,{size:13}):c.jsx(Sp,{size:13})," ",h?"Copied!":"Copy"]}),c.jsx("button",{type:"button",onClick:f,title:"Close deployment logs","aria-label":"Close deployment logs",children:c.jsx(Ba,{size:15})})]}),c.jsx("pre",{ref:o,children:E})]})}),document.body)}const bh=[{id:"building",label:"Prepare CUDA image",detail:"Install and cache the GTSFM environment"},{id:"deploying",label:"Deploy workspace",detail:"Publish the FastAPI workspace on Modal"},{id:"verifying",label:"Start & verify workspace",detail:"Cold-start the GPU and confirm the workspace API is healthy"}];function $0({deployment:u,onCancel:r,onExpand:f}){const o=u.phase==="ready",m=u.phase==="verifying",h=o?"verifying":u.phase??"building",_=Math.max(0,bh.findIndex(j=>j.id===h)),E=u.image_source==="prebuilt"?"Pull the versioned GTSFM runtime; no package installation":"Install and cache the GTSFM environment";return c.jsxs("section",{className:`modal-deployment ${u.status}`,"aria-label":"Modal workspace progress",children:[c.jsxs("div",{className:"modal-deployment-heading",children:[c.jsxs("span",{children:[o?c.jsx(cl,{size:12}):u.status==="failed"?c.jsx(Ni,{size:12}):u.status==="cancelled"?c.jsx(Bo,{size:12}):c.jsx(il,{size:12}),c.jsx("strong",{children:u.stage})]}),c.jsxs("span",{className:"modal-deployment-actions",children:[c.jsxs("small",{children:[u.image_source==="prebuilt"?"PREBUILT":"SOURCE"," · ",u.gpu]}),["queued","running"].includes(u.status)&&!m&&c.jsxs("button",{className:"modal-stop-action",type:"button",onClick:r,title:"Stop Modal setup",children:[c.jsx(Pu,{size:9,fill:"currentColor"})," Stop"]}),c.jsx("button",{type:"button",onClick:f,title:"View all setup logs","aria-label":"View all setup logs",children:c.jsx(yh,{size:12})})]})]}),c.jsx("ol",{className:"modal-deployment-steps",children:bh.map((j,y)=>{const p=o||y<_,M=!o&&y===_,O=M&&u.status==="failed",Y=M&&u.status==="cancelled";return c.jsxs("li",{"data-state":O?"failed":Y?"cancelled":p?"complete":M?"active":"pending",children:[c.jsx("span",{className:"modal-step-mark",children:p?c.jsx(cl,{size:10}):O?c.jsx(Ba,{size:10}):Y?c.jsx(Bo,{size:10}):y+1}),c.jsxs("div",{children:[c.jsx("strong",{children:j.label}),c.jsx("small",{children:j.id==="building"?E:j.detail})]})]},j.id)})}),c.jsxs("div",{className:"modal-log-preview-heading",children:[c.jsx("span",{children:"LIVE SETUP LOGS"}),c.jsxs("button",{type:"button",onClick:f,children:[c.jsx(yh,{size:10})," View all logs"]})]}),c.jsx("pre",{children:u.log_tail.slice(-6).join(` +`)||"Waiting for Modal setup output…"})]})}function F0({state:u,detail:r}){const f={idle:"Workspace setup required",found:"Modal workspace found",working:"Preparing Modal workspace",ready:"Modal workspace ready",attention:"Workspace needs attention"}[u];return c.jsxs("div",{className:`modal-workspace-status ${u}`,role:"status","aria-live":"polite",children:[c.jsx("span",{"aria-hidden":"true",children:u==="working"?c.jsx(il,{className:"spin",size:13}):u==="ready"?c.jsx(cl,{size:13}):u==="attention"?c.jsx(Ni,{size:13}):c.jsx($u,{size:13})}),c.jsxs("div",{children:[c.jsx("strong",{children:f}),c.jsx("small",{children:r})]})]})}const W0={name:"my-scene",sample_id:"",dataset_dir:"",images_dir:"",loader:"olsson",config_name:"vggt",splat_implementation:"gsplat",gaussian_splatting_config_name:"base_gs",gs_max_steps:7e3,live_preview_interval:250,run_mvs:!1,execution_target:"local",hardware:"cpu",remote_connection:"api",remote_provider:"modal",remote_endpoint:"",modal_api_key:"",modal_token_id:"",modal_token_secret:"",modal_gpu:"L40S",ssh_host:"",ssh_port:22,ssh_username:"",ssh_authentication:"agent",ssh_private_key:"",ssh_workspace:"",remote_hardware:"",max_resolution:"",num_workers:1,threads_per_worker:1,worker_memory_limit:"32GB",graph_partitioner:"",global_descriptor_config_name:"",retriever_config_name:"",correspondence_generator_config_name:"",verifier_config_name:"",max_frame_lookahead:"",num_matched:"",share_intrinsics:!1,log:"INFO",dashboard_port:"",input_worker:"",dask_tmpdir:"",cluster_config:"",num_retry_cluster_connection:"",advanced_overrides:""},I0={defaults:{config_name:"vggt",loader:"olsson",splat_implementation:"gsplat",num_workers:1,threads_per_worker:1,worker_memory_limit:"32GB",run_mvs:!1,gs_max_steps:7e3,live_preview_interval:250,hardware:"cpu"},models:[{id:"vggt",label:"VGGT",capabilities:{iterative_splat:!0,mvs:!1,share_intrinsics:!1}}],loaders:["olsson"],loader_options:{olsson:[]},graph_partitioners:[],global_descriptors:[],retrievers:[],correspondence_generators:[],verifiers:[],log_levels:["DEBUG","INFO","WARNING","ERROR","CRITICAL"],gaussian_splatting_models:["base_gs"],splat_implementations:[{id:"none",label:"No splats",description:"Run reconstruction only.",live:!1},{id:"gsplat",label:"Optimized Gaussian splats",description:"Iteratively optimize gsplat Gaussians and show live previews.",live:!0},{id:"anysplat",label:"AnySplat",description:"Generate splats with the feed-forward AnySplat model.",live:!1}]};function P0(u){const r=m=>{const h=m.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),_=u.match(new RegExp(`(?:^|\\s)${h}(?:=|\\s+)(?:"([^"]+)"|'([^']+)'|([^\\s]+))`));return(_?.[1]??_?.[2]??_?.[3]??"").trim()},f=r("--token-id"),o=r("--token-secret");return f&&o?{tokenId:f,tokenSecret:o}:null}const To=u=>u.modal_api_key,pa=u=>String(u??"").split("_").map(r=>["api","ba","colmap","gpu","gs","mvs","sift","vggt"].includes(r)?r.toUpperCase():r==="anysplat"?"AnySplat":r==="megaloc"?"MegaLoc":r.charAt(0).toUpperCase()+r.slice(1)).join(" "),Bl=u=>u instanceof Error?u.message:String(u);async function Ht(u,r){const f=await fetch(u,r),o=await f.json();if(!f.ok)throw new Error(o.error||`Request failed (${f.status})`);return o}const Sh=u=>`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}${u}`;function e1({collapsed:u,onToggle:r}){return c.jsxs("header",{className:"studio-header","aria-label":"SfM Studio",children:[c.jsx("div",{className:"brand-primary",children:c.jsx("img",{className:"brand-logo",src:"/static/brand/sfm-logo.png",alt:"SfM"})}),c.jsx("img",{className:"brand-mark",src:"/static/brand/bee-favicon.png",alt:"","aria-hidden":"true"}),c.jsx("button",{className:"sidebar-toggle",type:"button",onClick:r,title:u?"Expand side panel":"Collapse side panel","aria-label":u?"Expand side panel":"Collapse side panel",children:u?c.jsx(bp,{size:16}):c.jsx(yp,{size:16})})]})}function nr({label:u,optional:r=!1,children:f}){return c.jsxs("label",{children:[u,r&&c.jsx("span",{className:"optional",children:"optional"}),f]})}function ut({label:u,value:r,options:f,onChange:o,disabled:m=!1,empty:h=null,id:_}){return c.jsx(nr,{label:u,children:c.jsxs("select",{id:_,value:r??"",onChange:E=>o(E.target.value),disabled:m,children:[h!==null&&c.jsx("option",{value:"",children:h}),f.map(E=>{const j=typeof E=="string"?{id:E,label:pa(E)}:E;return c.jsx("option",{value:j.id,disabled:!!(j.status&&j.status!=="available"),children:j.label},j.id)})]})})}function Qe({label:u,optional:r=!1,value:f,onChange:o,...m}){return c.jsx(nr,{label:u,optional:r,children:c.jsx("input",{value:f??"",onChange:h=>o(h.target.value),...m})})}const Ei=u=>{const r=["B","KB","MB","GB","TB"];let f=u,o=0;for(;f>=1024&&o0?f.toFixed(1):Math.round(f)} ${r[o]}`},Ha=[{id:"T4",label:"NVIDIA T4 · 16 GB · $0.59/hr",pricePerSecond:164e-6,relativeSpeed:.3,memoryGiB:16},{id:"L4",label:"NVIDIA L4 · 24 GB · $0.80/hr",pricePerSecond:222e-6,relativeSpeed:.5,memoryGiB:24},{id:"A10",label:"NVIDIA A10 · 24 GB · $1.10/hr",pricePerSecond:306e-6,relativeSpeed:.58,memoryGiB:24},{id:"L40S",label:"NVIDIA L40S · 48 GB · $1.95/hr",pricePerSecond:542e-6,relativeSpeed:1,memoryGiB:48},{id:"A100-40GB",label:"NVIDIA A100 · 40 GB · $2.10/hr",pricePerSecond:583e-6,relativeSpeed:1.18,memoryGiB:40},{id:"A100-80GB",label:"NVIDIA A100 · 80 GB · $2.50/hr",pricePerSecond:694e-6,relativeSpeed:1.3,memoryGiB:80},{id:"RTX-PRO-6000",label:"NVIDIA RTX PRO 6000 · 96 GB · $3.03/hr",pricePerSecond:842e-6,relativeSpeed:1.45,memoryGiB:96},{id:"H100",label:"NVIDIA H100 · 80 GB · $3.95/hr",pricePerSecond:.001097,relativeSpeed:1.8,memoryGiB:80},{id:"H200",label:"NVIDIA H200 · 141 GB · $4.54/hr",pricePerSecond:.001261,relativeSpeed:1.95,memoryGiB:141},{id:"B200",label:"NVIDIA B200 · 180 GB · $6.25/hr",pricePerSecond:.001736,relativeSpeed:2.35,memoryGiB:180},{id:"B300",label:"NVIDIA B300 · 288 GB · Coming Soon!",status:"coming-soon",pricePerSecond:.001972,relativeSpeed:2.65,memoryGiB:288}];function t1(u,r,f=0){const o=r?.image_count||f;if(!o)return null;const m=r?.average_megapixels&&r.average_megapixels>0?r.average_megapixels:8,h=Number(u.max_resolution),_=Number.isFinite(h)&&h>0?h**2*.75/1e6:m,E=Math.max(.25,Math.min(m,_)),j=o*Math.sqrt(E/8),y=u.config_name==="vggt"?5:u.config_name.includes("fast")?3:7,p=u.splat_implementation==="gsplat"?3:u.splat_implementation==="anysplat"?6:0,M=Math.ceil(5+j*.1+y+p+(u.run_mvs?4:0));let O="L4";M<=14&&u.splat_implementation==="none"?O="T4":M<=22?O="L4":M<=44?O="L40S":M<=72&&j<350?O="A100-80GB":M<=72?O="H100":M<=125?O="H200":O="B200";const Y=Ha.find(X=>X.id===O)??Ha[3],B=o<40?"small":o<140?"medium":o<350?"large":"very large";return{gpu:Y,imageCount:o,effectiveMegapixels:E,estimatedMemoryGiB:M,reason:`${B} ${o}-image workload at about ${E.toFixed(E<10?1:0)} MP per image`}}function l1({recommendation:u,selectedGpu:r,onApply:f}){if(!u)return c.jsxs("div",{className:"modal-gpu-recommendation empty",children:[c.jsx("strong",{children:"VM recommendation"}),c.jsx("p",{children:"Choose a sample or upload images to size the Modal GPU automatically."})]});const o=r===u.gpu.id;return c.jsxs("section",{className:`modal-gpu-recommendation ${o?"selected":"overridden"}`,"aria-label":"Recommended Modal VM size",children:[c.jsxs("div",{children:[c.jsx("span",{children:"RECOMMENDED VM"}),c.jsxs("strong",{children:[u.gpu.id," · ",u.gpu.memoryGiB," GB"]})]}),c.jsxs("p",{children:[u.reason,". Estimated peak GPU memory is approximately ",u.estimatedMemoryGiB," GiB, including working headroom."]}),o?c.jsxs("small",{children:[c.jsx(cl,{size:11})," Selected automatically"]}):c.jsx("button",{type:"button",onClick:f,children:"Use recommended"})]})}const _h=u=>u<60?`${Math.max(1,Math.round(u))} min`:`${(u/60).toFixed(u<120?1:0)} hr`,xh=u=>`$${u<10?u.toFixed(2):u.toFixed(1)}`;function ir(u){const r=u.trim().match(/^([\d.]+)\s*(gb|gib|mb|mib)?$/i);if(!r)return 32;const f=Number(r[1]);return/m/i.test(r[2]||"")?f/1024:f}const jh={T4:{cpu:4,memoryGiB:32},L4:{cpu:4,memoryGiB:32},A10:{cpu:6,memoryGiB:48},L40S:{cpu:8,memoryGiB:64},"A100-40GB":{cpu:8,memoryGiB:64},"A100-80GB":{cpu:12,memoryGiB:96},"RTX-PRO-6000":{cpu:16,memoryGiB:128},H100:{cpu:16,memoryGiB:128},H200:{cpu:20,memoryGiB:192},B200:{cpu:24,memoryGiB:256}};function a1(u,r,f){if(u.execution_target==="remote"){if(u.remote_connection==="api"&&u.remote_provider==="modal"){const p=jh[u.modal_gpu]??jh.L40S,M=Ha.find(O=>O.id===u.modal_gpu);return{key:`modal:${u.modal_gpu}`,label:`Modal ${u.modal_gpu}`,description:`${M?.memoryGiB??48} GB GPU · CPU and RAM are provisioned when this workspace is deployed. One worker is fixed to the single GPU.`,workers:1,threadsPerWorker:p.cpu,memoryPerWorkerGiB:p.memoryGiB,allowWorkers:!1,allowThreads:!0,allowMemory:!0,allowLocalRuntime:!1}}return{key:`remote:${u.remote_connection}:${u.remote_provider}`,label:u.remote_connection==="ssh"?"Direct VM (coming soon)":`${pa(u.remote_provider)} VM`,description:"Machine-level tuning is unavailable until this remote provider is connected.",workers:1,threadsPerWorker:1,memoryPerWorkerGiB:32,allowWorkers:!1,allowThreads:!1,allowMemory:!1,allowLocalRuntime:!1}}const o=r?.devices.find(p=>p.kind==="cpu"),m=Math.max(1,Number(o?.details.match(/(\d+)\s+logical cores/i)?.[1])||1),h=Math.max(4,ir(o?.memory||"32GB")),_=!!(f&&f.kind!=="cpu"),E=_?1:Math.min(4,Math.max(1,Math.floor(m/4))),j=_?Math.min(8,m):Math.max(1,Math.floor(m/E)),y=Math.max(4,Math.floor(h*.75/E));return{key:`local:${f?.id??"detecting"}:${m}:${Math.round(h)}`,label:f?.label??"Detecting this machine",description:_?"One worker is assigned to the selected accelerator. CPU threads and host-memory limits remain adjustable.":"Worker count, CPU threads, and memory are tuned from the detected local resources.",workers:E,threadsPerWorker:j,memoryPerWorkerGiB:y,allowWorkers:!_,allowThreads:!!f,allowMemory:!!f,allowLocalRuntime:!0}}function n1({form:u,analysis:r,fallbackImageCount:f}){const o=r?.image_count||f;if(!o)return c.jsxs("div",{className:"modal-estimate empty",children:[c.jsx("strong",{children:"Cost estimate"}),c.jsx("p",{children:"Choose a GTSFM sample or upload an image dataset to calculate an estimate."})]});const m=Ha.find(te=>te.id===u.modal_gpu)??Ha[3],h=r?.average_megapixels||8,_=Number(u.max_resolution),E=Number.isFinite(_)&&_>0?_**2*.75/1e6:h,j=Math.min(h,E),y=Math.max(.65,Math.min(2.5,Math.sqrt(j/2))),p=u.config_name.includes("fast")?.75:u.config_name==="vggt"?1:1.35,M=(2+o*.09*y+Math.pow(o,1.35)*.025)*p,O=Math.max(1,Number(u.gs_max_steps)||7e3),Y=u.splat_implementation==="gsplat"?O/1e3*(.45+Math.sqrt(o)*.08)*y:u.splat_implementation==="anysplat"?1.5+o*.04*y:0,B=u.run_mvs?1+o*.12*y:0,Z=(M+Y+B)/m.relativeSpeed,L=Math.max(1,Z*.7),Q=Math.max(L+1,Z*1.8+2),k=Math.max(1,Number(u.num_workers)*Number(u.threads_per_worker)||1),H=Math.max(1,ir(u.worker_memory_limit)*Math.max(1,Number(u.num_workers)||1)),J=m.pricePerSecond+k*131e-7+H*222e-8,ee=L*60*J,V=Q*60*J,ue=r?.image_count?`${r.image_count} images · ${r.total_megapixels.toLocaleString()} source MP · ${Ei(r.image_bytes)}`:`${o} catalog images · resolution assumed`;return c.jsxs("section",{className:"modal-estimate","aria-label":"Estimated Modal compute cost",children:[c.jsxs("div",{className:"modal-estimate-heading",children:[c.jsxs("div",{children:[c.jsx("span",{children:"ESTIMATED MODAL COMPUTE"}),c.jsxs("strong",{children:[xh(ee),"–",xh(V)]})]}),c.jsxs("em",{children:[_h(L),"–",_h(Q)]})]}),c.jsx("div",{className:"modal-estimate-bar",children:c.jsx("span",{style:{width:`${Math.min(100,Math.max(12,L/Q*100))}%`}})}),c.jsx("p",{children:ue}),c.jsxs("small",{children:[pa(u.config_name)," · ",pa(u.splat_implementation),u.splat_implementation==="gsplat"?` · ${O.toLocaleString()} steps`:""," · ",m.id]}),c.jsxs("small",{children:["Estimate includes GPU plus approximately ",k," CPU core",k===1?"":"s"," and ",H.toFixed(0)," GiB memory. Actual runtime and billing vary with scene complexity, caching, and utilization."]}),c.jsx("a",{href:"https://modal.com/pricing",target:"_blank",rel:"noreferrer",children:"Modal pricing · rates checked Aug 13, 2026 ↗"})]})}async function Cp(u,r=""){const f=r?`${r}/${u.name}`:u.name;if(u.isFile)return[{file:await new Promise((_,E)=>u.file(_,E)),relativePath:f}];if(!u.isDirectory)return[];const o=u.createReader(),m=[];for(;;){const h=await new Promise((_,E)=>o.readEntries(_,E));if(!h.length)break;m.push(...h)}return(await Promise.all(m.map(h=>Cp(h,f)))).flat()}async function i1(u){const r=Array.from(u.items).map(f=>f.webkitGetAsEntry?.()).filter(f=>!!f);return r.length?(await Promise.all(r.map(f=>Cp(f)))).flat():Array.from(u.files).map(f=>({file:f,relativePath:f.name}))}function Mh({label:u,optional:r=!1,value:f,onUploaded:o,onError:m}){const h=g.useRef(null),[_,E]=g.useState(!1),[j,y]=g.useState(!1),p=async M=>{if(!M.length){m("Choose a folder containing at least one file.");return}y(!0),m("");try{const O=new FormData;O.append("manifest",JSON.stringify(M.map(B=>B.relativePath))),M.forEach(B=>O.append("files",B.file,B.file.name));const Y=await Ht("/api/uploads",{method:"POST",body:O});o(Y)}catch(O){m(Bl(O))}finally{y(!1)}};return c.jsxs("div",{className:"folder-field",children:[c.jsxs("div",{className:"folder-label",children:[u,r&&c.jsx("span",{className:"optional",children:"optional"})]}),c.jsxs("button",{type:"button",className:`folder-drop ${_?"dragging":""} ${f?"has-folder":""}`,onClick:()=>h.current?.click(),onDragEnter:M=>{M.preventDefault(),E(!0)},onDragOver:M=>{M.preventDefault(),M.dataTransfer.dropEffect="copy"},onDragLeave:M=>{M.currentTarget.contains(M.relatedTarget)||E(!1)},onDrop:async M=>{M.preventDefault(),E(!1),await p(await i1(M.dataTransfer))},disabled:j,children:[c.jsx("span",{className:"folder-icon",children:f?c.jsx(cl,{size:17}):c.jsx(xp,{size:18})}),c.jsx("span",{className:"folder-copy",children:j?c.jsxs(c.Fragment,{children:[c.jsx("strong",{children:"Importing folder…"}),c.jsx("small",{children:"Keeping the directory structure intact"})]}):f?c.jsxs(c.Fragment,{children:[c.jsx("strong",{children:f.name}),c.jsxs("small",{children:[f.file_count," file",f.file_count===1?"":"s"," · ",Ei(f.bytes)," · Click to replace"]})]}):c.jsxs(c.Fragment,{children:[c.jsx("strong",{children:"Drop a folder here"}),c.jsx("small",{children:"or click to choose one"})]})})]}),c.jsx("input",{ref:h,className:"folder-input",type:"file",multiple:!0,webkitdirectory:"",directory:"",onChange:async M=>{const O=Array.from(M.target.files??[]);await p(O.map(Y=>({file:Y,relativePath:Y.webkitRelativePath||Y.name}))),M.target.value=""}}),f&&c.jsx("button",{type:"button",className:"folder-remove",onClick:()=>o(null),children:"Remove selection"})]})}function Ch({id:u,checked:r,onCheckedChange:f,disabled:o=!1,children:m}){return c.jsxs("div",{className:`toggle-row ${o?"disabled":""}`,children:[c.jsx(Iy,{id:u,className:"switch-root",checked:r,onCheckedChange:f,disabled:o,children:c.jsx(e0,{className:"switch-thumb"})}),c.jsx("label",{htmlFor:u,children:m})]})}function Ao({number:u,title:r,subtitle:f,children:o}){return c.jsxs("section",{className:"form-section",children:[c.jsxs("div",{className:"section-heading",children:[c.jsx("span",{className:"step-number",children:u}),c.jsxs("div",{children:[c.jsx("strong",{children:r}),c.jsx("small",{children:f})]})]}),o]})}function u1({descriptors:u,values:r,setValues:f}){return u.length?c.jsxs("div",{className:"loader-options",children:[c.jsx("p",{className:"mini-heading",children:"Format-specific options"}),u.map(o=>o.type==="boolean"?c.jsx(ut,{label:o.label,value:String(r[o.name]??o.default??!1),options:[{id:"true",label:"True"},{id:"false",label:"False"}],onChange:m=>f(h=>({...h,[o.name]:m==="true"}))},o.name):c.jsx(Qe,{label:o.label,optional:!o.required,required:o.required,type:["integer","number"].includes(o.type)?"number":"text",step:o.type==="number"?"any":void 0,value:r[o.name]??o.default??"",onChange:m=>f(h=>({...h,[o.name]:m}))},o.name))]}):null}function c1({device:u}){return u?c.jsxs("div",{className:"hardware-card",children:[c.jsx("strong",{children:u.label}),c.jsxs("small",{children:[u.details,u.memory?` · ${u.memory}`:""]}),c.jsx("span",{className:`capability ${u.supports_gaussian_splatting?"yes":"no"}`,children:u.supports_gaussian_splatting?"Splat ready":"Reconstruction"})]}):c.jsx("div",{className:"hardware-card",children:c.jsx("strong",{children:"Detecting hardware…"})})}function s1({schema:u,hardware:r,samples:f,samplesLoading:o,onStarted:m,onTabChange:h,remotePromptKey:_,schemaLoading:E,schemaError:j,onRetrySchema:y}){const[p,M]=g.useState(W0),[O,Y]=g.useState("upload"),[B,X]=g.useState(!0),[Z,L]=g.useState(null),[Q,k]=g.useState({}),[H,J]=g.useState(null),[ee,V]=g.useState(""),[ue,te]=g.useState(""),[je,Me]=g.useState(!1),[de,me]=g.useState(!1),[Ne,Fe]=g.useState(!1),[R,q]=g.useState(!1),[I,pe]=g.useState(null),[Ce,x]=g.useState(!1),[U,K]=g.useState(!1),[$,ie]=g.useState(!1),[oe,he]=g.useState(""),[Ve,ke]=g.useState(null),[qt,Lt]=g.useState(null),[st,pl]=g.useState(null),[ht,ga]=g.useState(!1),[at,ql]=g.useState(""),Yt=g.useRef(0),vl=g.useRef(""),le=(b,ce)=>M(ge=>({...ge,[b]:ce}));g.useEffect(()=>{if(!r)return;const b=r.devices.find(ce=>ce.supports_gaussian_splatting);M(ce=>({...ce,hardware:b?.id??r.devices[0]?.id??"cpu",splat_implementation:ce.execution_target==="local"&&!b?"none":ce.splat_implementation}))},[r]),g.useEffect(()=>{_<1||(M(b=>({...b,execution_target:"remote",remote_connection:"api",remote_provider:"modal",splat_implementation:b.splat_implementation==="none"?u.defaults.splat_implementation:b.splat_implementation})),window.setTimeout(()=>document.getElementById("computeTarget")?.scrollIntoView({behavior:"smooth",block:"start"}),0))},[_,u]);const Ll=H?.configuration?.models??u.models,F=Ll.find(b=>b.id===p.config_name),Re=F?.capabilities??{iterative_splat:!1,mvs:!1,share_intrinsics:!1},ve=g.useMemo(()=>u.splat_implementations.map(b=>({...b,status:b.id==="gsplat"&&!Re.iterative_splat?"disabled":"available"})),[u,Re.iterative_splat]),Vt=u.splat_implementations.find(b=>b.id===p.splat_implementation),bt=r?.devices.find(b=>b.id===p.hardware),Ae=a1(p,r,bt),pt=f.find(b=>b.id===p.sample_id),gl=[{id:"auto",label:"Auto-detect · Recommended"},...u.loaders.map(b=>({id:b,label:pa(b)}))],ol=O==="sample"?st?.analysis:qt?.analysis?.image_count?qt.analysis:Ve?.analysis,rl=t1(p,ol,pt?.image_count??0),ec=[O,p.sample_id,ol?.image_count??0,ol?.average_megapixels??0,ol?.total_megapixels??0,p.max_resolution,p.config_name,p.splat_implementation,p.run_mvs].join(":"),ya=Ha.map(b=>({...b,label:b.id===rl?.gpu.id?`${b.label} · Recommended`:b.label})),St=[{id:"modal",label:"Modal"},{id:"lambda",label:"Lambda Cloud — Coming Soon!",status:"coming-soon"},{id:"runpod",label:"RunPod — Coming Soon!",status:"coming-soon"},{id:"vast",label:"Vast.ai — Coming Soon!",status:"coming-soon"},{id:"aws",label:"AWS EC2 — Coming Soon!",status:"coming-soon"}],tl=b=>{const ce=Ha.find(qe=>qe.id===b),ge={configuration:u,verified:!1,hardware:{summary:`Modal ${b} workspace`,devices:[{id:"cuda:0",kind:"cuda",label:`Modal ${b}`,details:"NVIDIA CUDA GPU · starts with the first reconstruction",memory:ce?`${ce.memoryGiB} GB`:void 0,supports_gaussian_splatting:!0}]}};return J(ge),le("remote_hardware","cuda:0"),ge};g.useEffect(()=>{rl&&p.modal_gpu!==rl.gpu.id&&(le("modal_gpu",rl.gpu.id),p.remote_endpoint&&(J(null),q(!0),V("The dataset changed the recommended VM. Update the Modal workspace to apply it, then verify readiness.")))},[rl?.gpu.id,ec,p.modal_gpu,p.remote_endpoint]),g.useEffect(()=>{M(b=>({...b,num_workers:Ae.workers,threads_per_worker:Ae.threadsPerWorker,worker_memory_limit:`${Ae.memoryPerWorkerGiB}GB`}))},[Ae.key]),g.useEffect(()=>{!pt||st?.path!==""||ql(p.execution_target==="remote"?"Will download directly on Modal":pt.prepared?"Cached and ready":"Will download when the run starts")},[p.execution_target,pt,st?.path]);const vt=(b,ce)=>{Yt.current+=1,Me(!1),me(!1);const ge=P0(ce);if(J(null),q(!1),V(""),ge){M(qe=>({...qe,modal_token_id:ge.tokenId,modal_token_secret:ge.tokenSecret,modal_api_key:""})),te("Token command parsed. Both fields are filled.");return}M(qe=>({...qe,[b]:ce,modal_api_key:""})),te("")},Ri=b=>{le("modal_gpu",b),J(null),q(!!p.remote_endpoint),V("VM selection changed. Update the Modal workspace to apply it, then verify readiness.")};g.useEffect(()=>{if(p.execution_target!=="remote"||p.remote_connection!=="api"||p.remote_provider!=="modal"||!p.modal_token_id.startsWith("ak-")||!p.modal_token_secret.startsWith("as-"))return;const b=++Yt.current,ce=window.setTimeout(async()=>{Me(!0),V("Finding your deployed GTSFM app on Modal…");try{const ge=await Ht("/api/modal/discover",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token_id:p.modal_token_id,token_secret:p.modal_token_secret})});if(b!==Yt.current)return;M(qe=>qe.remote_endpoint&&qe.remote_endpoint!==vl.current?{...qe,modal_api_key:ge.api_key}:{...qe,remote_endpoint:ge.endpoint,modal_api_key:ge.api_key}),vl.current=ge.endpoint,tl(p.modal_gpu),q(!1),V(`Found ${ge.app_name} · ${ge.function_name}. Update it to this GTSFM version, or verify the existing workspace.`)}catch(ge){b===Yt.current&&(q(!0),V(Bl(ge)))}finally{b===Yt.current&&Me(!1)}},450);return()=>window.clearTimeout(ce)},[p.execution_target,p.remote_connection,p.remote_provider,p.modal_token_id,p.modal_token_secret]),g.useEffect(()=>{p.splat_implementation==="gsplat"&&F&&!Re.iterative_splat&&le("splat_implementation","none")},[p.splat_implementation,F,Re.iterative_splat]);async function Oi(b,ce){const ge=await Ht("/api/remote/inspect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint:b,api_key:ce,remote_provider:p.remote_provider})});J({...ge,verified:!0});const qe=ge.hardware.devices.find(wi=>wi.supports_gaussian_splatting);return le("remote_hardware",qe?.id??ge.hardware.devices[0]?.id??""),ge}const tc=async()=>{if(p.remote_connection!=="api"){V("SSH connection testing is coming soon. You can finish the VM details now.");return}if(!p.remote_endpoint||!To(p)){V("Deploy the GTSFM Modal workspace first, or wait for an existing deployment to be discovered.");return}me(!0),q(!1),J(b=>b?{...b,verified:!1}:null),V("Checking the lightweight Modal control service…");try{const b=await Oi(p.remote_endpoint,To(p));q(!1),V(`${b.hardware.summary}. The control service is ready; the GPU stays off until you run a reconstruction.`)}catch(b){q(!0),V(`Workspace check failed. Update the Modal workspace before running. ${Bl(b)}`)}finally{me(!1)}},qa=async()=>{if(!p.modal_token_id.startsWith("ak-")||!p.modal_token_secret.startsWith("as-")){V("Enter both Modal token fields before deploying.");return}Yt.current+=1,Fe(!0),q(!1),J(null),V("");try{let b=await Ht("/api/modal/deploy",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token_id:p.modal_token_id,token_secret:p.modal_token_secret,gpu:p.modal_gpu,cpu:Math.max(1,Number(p.num_workers)*Number(p.threads_per_worker)||1),memory_mb:Math.max(4096,Math.round(ir(p.worker_memory_limit)*Math.max(1,Number(p.num_workers)||1)*1024))})});for(pe(b);["queued","running","cancelling"].includes(b.status);)await new Promise(ce=>window.setTimeout(ce,1e3)),b=await Ht(`/api/modal/deploy/${encodeURIComponent(b.id)}`),pe(b);if(b.status==="cancelled"){V("Modal workspace setup stopped.");return}if(b.status==="failed")throw new Error(b.error||"Modal deployment failed");vl.current=b.endpoint,M(ce=>({...ce,remote_endpoint:b.endpoint,modal_api_key:b.api_key})),tl(b.gpu),pe({...b,status:"running",phase:"verifying",stage:"Starting and verifying the Modal workspace",log_tail:[...b.log_tail,`Registered endpoint ${b.endpoint}`,"Checking the CPU control service; the GPU remains off until a run starts…"]}),me(!0);try{await Oi(b.endpoint,b.api_key)}catch(ce){const ge=`Deployment finished, but the workspace health check failed: ${Bl(ce)}`;throw J(qe=>qe?{...qe,verified:!1}:null),q(!0),pe({...b,status:"failed",phase:"verifying",stage:"Modal workspace needs an update",error:ge,log_tail:[...b.log_tail,`Registered endpoint ${b.endpoint}`,ge]}),new Error(ge)}finally{me(!1)}pe({...b,phase:"ready",stage:"Modal workspace ready",log_tail:[...b.log_tail,`Registered endpoint ${b.endpoint}`,"Workspace health check passed. The Modal GPU is ready."]}),q(!1),V(`Modal ${b.gpu} workspace passed its health check and is ready to run.`)}catch(b){const ce=Bl(b);q(!0),V(/Request failed \(404\)/.test(ce)?"This GTSFM server was started before Modal deployment support was installed. Stop it with Ctrl-C, run `gtsfm run` again, then click Deploy.":ce)}finally{Fe(!1)}},ba=async()=>{if(!(!I||!["queued","running"].includes(I.status)))try{const b=await Ht(`/api/modal/deploy/${encodeURIComponent(I.id)}/cancel`,{method:"POST"});pe(b),V("Stopping Modal workspace setup…")}catch(b){V(Bl(b))}},La=b=>{const ce=f.find(qe=>qe.id===b);if(pl(null),ql(""),!ce){L(null),M(qe=>({...qe,sample_id:"",dataset_dir:""}));return}const ge=ce.recommendations;X(!0),L({loader:ge.loader,confidence:1,reason:"Verified from the sample's upstream GitHub directory structure.",loader_options:ge.loader_options??{},alternatives:[]}),k(ge.loader_options??{}),M(qe=>({...qe,sample_id:ce.id,dataset_dir:"",images_dir:"",name:ce.id,loader:ge.loader,config_name:ge.config_name,max_resolution:ge.max_resolution??qe.max_resolution})),pl({path:"",sample:ce,analysis:{image_count:ce.image_count,image_bytes:0,total_megapixels:0,average_megapixels:0,max_width:0,max_height:0}}),ql(ce.prepared?"Cached and ready":"Will download where the run executes")},yl=async b=>{b.preventDefault(),ie(!0),he("");try{if(p.execution_target==="remote"&&p.remote_connection==="ssh")throw new Error("SSH execution is not available yet. Choose API to run on Modal.");if(p.execution_target==="remote"&&p.remote_provider==="modal"&&!H?.verified)throw new Error("The Modal workspace must pass its health check before a reconstruction can start.");const ce={...p,loader:B?"auto":p.loader,api_key:p.execution_target==="remote"?To(p):"",loader_options:Q,hardware:p.execution_target==="remote"?p.remote_hardware:p.hardware,max_resolution:p.max_resolution?Number(p.max_resolution):null,num_workers:Number(p.num_workers),threads_per_worker:Number(p.threads_per_worker),gs_max_steps:Number(p.gs_max_steps),live_preview_interval:Number(p.live_preview_interval),max_frame_lookahead:p.max_frame_lookahead?Number(p.max_frame_lookahead):null,num_matched:p.num_matched?Number(p.num_matched):null,num_retry_cluster_connection:p.num_retry_cluster_connection?Number(p.num_retry_cluster_connection):null},ge=await Ht("/api/jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ce)});m(ge),h("activity")}catch(ce){he(Bl(ce))}finally{ie(!1)}},Ya=p.execution_target==="remote"&&p.remote_connection==="api"&&p.remote_provider==="modal",Yl=H?.verified?"ready":Ne||je||de?"working":R?"attention":p.remote_endpoint?"found":"idle",lc=ee||{idle:"Enter Modal credentials, then deploy or discover a workspace.",found:"Choose Update to apply this GTSFM version, or verify the existing deployment.",working:"Preparing the lightweight control service. The GPU starts only when a reconstruction runs.",ready:"Health checks passed. Reconstruction can start.",attention:"Update or verify this workspace before starting a run."}[Yl],Di=Ne?I?.phase==="verifying"?"Starting & verifying Modal workspace…":"Setting up Modal workspace…":je?"Finding Modal workspace…":de?"Starting & verifying Modal workspace…":Ya&&!H?.verified?"Prepare Modal workspace first":"Run reconstruction";return c.jsxs("form",{id:"runForm",onSubmit:yl,children:[c.jsxs("div",{className:"panel-intro",children:[c.jsx("span",{children:"NEW RECONSTRUCTION"}),E?c.jsxs("small",{className:"catalog-sync",children:[c.jsx(il,{className:"spin",size:10})," Syncing workspace options…"]}):j?c.jsxs("button",{className:"catalog-sync failed",type:"button",onClick:y,children:[c.jsx(Ni,{size:10})," Options offline · Retry"]}):null,c.jsx("p",{children:"Configure the source, pipeline, and compute target."})]}),c.jsxs(Ao,{number:"01",title:"Input",subtitle:"Choose the images to reconstruct",children:[c.jsx(Qe,{label:"Run name",value:p.name,onChange:b=>le("name",b),autoComplete:"off"}),c.jsxs("div",{className:"segmented input-source",role:"group","aria-label":"Input source",children:[c.jsxs("button",{type:"button",className:`target-choice ${O==="upload"?"active":""}`,onClick:()=>{Y("upload"),X(!0),L(Ve?.format_detection??null),k(Ve?.format_detection.loader_options??{}),M(b=>({...b,sample_id:"",dataset_dir:Ve?.path??"",images_dir:qt?.path??"",loader:Ve?.format_detection.loader??b.loader}))},children:[c.jsx(xp,{size:13})," Upload your own"]}),c.jsxs("button",{type:"button",className:`target-choice ${O==="sample"?"active":""}`,onClick:()=>{Y("sample"),X(!0);const b=st?.sample.recommendations;L(b?{loader:b.loader,confidence:1,reason:"Verified from the sample's upstream GitHub directory structure.",loader_options:b.loader_options??{},alternatives:[]}:null),k(b?.loader_options??{}),M(ce=>({...ce,sample_id:st?.sample.id??"",dataset_dir:st?.path??"",images_dir:"",loader:b?.loader??ce.loader}))},children:[c.jsx(gh,{size:13})," GTSFM samples"]})]}),O==="upload"?c.jsxs(c.Fragment,{children:[c.jsx(Mh,{label:"Dataset folder",value:Ve,onError:he,onUploaded:b=>{ke(b),le("dataset_dir",b?.path??""),L(b?.format_detection??null),B&&b?.format_detection&&(le("loader",b.format_detection.loader),k(b.format_detection.loader_options??{})),b&&p.name==="my-scene"&&le("name",b.name.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||"my-scene")}}),c.jsx(Mh,{label:"Separate images folder",optional:!0,value:qt,onError:he,onUploaded:b=>{Lt(b),le("images_dir",b?.path??"")}})]}):c.jsxs("div",{className:"sample-picker",children:[c.jsx(ut,{label:"Sample scene",value:p.sample_id,options:f,empty:o?"Loading GTSFM samples…":"Choose a GTSFM sample…",onChange:La,disabled:ht||o}),p.sample_id&&c.jsxs("div",{className:`sample-card ${st?"ready":""}`,children:[c.jsx("span",{className:"sample-state",children:ht?c.jsx(il,{className:"spin",size:14}):st?c.jsx(cl,{size:14}):c.jsx(gh,{size:14})}),c.jsxs("div",{children:[c.jsx("strong",{children:f.find(b=>b.id===p.sample_id)?.label}),c.jsx("small",{children:f.find(b=>b.id===p.sample_id)?.description}),c.jsxs("span",{children:[at," · ",f.find(b=>b.id===p.sample_id)?.image_count," images · ",c.jsx("a",{href:f.find(b=>b.id===p.sample_id)?.source_url,target:"_blank",rel:"noreferrer",children:"View on GitHub ↗"})]})]})]}),c.jsx("p",{className:"field-help sample-help",children:"Dataset format, VGGT model, resolution, and available loader settings are applied automatically."})]}),c.jsx(ut,{label:"Dataset format",value:B?"auto":p.loader,options:gl,onChange:b=>{if(b==="auto"){X(!0),Z&&(le("loader",Z.loader),k(Z.loader_options??{}));return}X(!1),le("loader",b),k({})}}),B&&c.jsx("p",{className:`field-help format-detection ${Z?.confidence===0?"warning":""}`,children:Z?c.jsxs(c.Fragment,{children:[c.jsx("strong",{children:pa(Z.loader)})," · ",Z.reason]}):"Upload a dataset or choose a GitHub sample and the backend will inspect its directory structure."}),c.jsx(u1,{descriptors:u.loader_options[p.loader]??[],values:Q,setValues:k})]}),c.jsxs(Ao,{number:"02",title:"Models",subtitle:"VGGT is the default reconstruction model",children:[c.jsx(ut,{label:"Reconstruction model",value:p.config_name,options:Ll,onChange:b=>le("config_name",b)}),c.jsx(ut,{label:"Splat implementation",value:p.splat_implementation,options:ve,onChange:b=>le("splat_implementation",b)}),c.jsx("p",{className:"field-help",children:Vt?.description}),p.splat_implementation==="gsplat"&&c.jsxs("div",{className:"nested-options",children:[c.jsx(ut,{label:"Optimizer preset",value:p.gaussian_splatting_config_name,options:H?.configuration?.gaussian_splatting_models??u.gaussian_splatting_models,onChange:b=>le("gaussian_splatting_config_name",b)}),c.jsxs("div",{className:"form-grid",children:[c.jsx(Qe,{label:"Training steps",type:"number",min:"1",step:"1",value:p.gs_max_steps,onChange:b=>le("gs_max_steps",b)}),c.jsx(Qe,{label:"Preview every",type:"number",min:"10",step:"10",value:p.live_preview_interval,onChange:b=>le("live_preview_interval",b)})]})]}),c.jsx(Ch,{id:"runMvs",checked:p.run_mvs,disabled:!Re.mvs,onCheckedChange:b=>le("run_mvs",b),children:"Also run dense MVS"})]}),c.jsxs(Ao,{number:"03",title:"Compute",subtitle:"Run here or on a remote VM",children:[c.jsxs("div",{className:"segmented",id:"computeTarget",role:"group","aria-label":"Execution target",children:[c.jsxs("button",{type:"button",className:`target-choice ${p.execution_target==="local"?"active":""}`,onClick:()=>le("execution_target","local"),children:[c.jsx(V0,{size:13})," This machine"]}),c.jsxs("button",{type:"button",className:`target-choice ${p.execution_target==="remote"?"active":""}`,onClick:()=>M(b=>({...b,execution_target:"remote",splat_implementation:b.splat_implementation==="none"?u.defaults.splat_implementation:b.splat_implementation})),children:[c.jsx($u,{size:13})," Remote VM"]})]}),p.execution_target==="local"?c.jsx(c.Fragment,{children:r?c.jsxs(c.Fragment,{children:[c.jsx(ut,{label:"Hardware",value:p.hardware,options:r.devices,onChange:b=>le("hardware",b)}),c.jsx(c1,{device:bt})]}):c.jsxs("div",{className:"hardware-card detecting",children:[c.jsx(il,{className:"spin",size:13}),c.jsxs("div",{children:[c.jsx("strong",{children:"Detecting compute devices…"}),c.jsx("small",{children:"You can configure the rest of the run while this finishes."})]})]})}):c.jsxs("div",{className:"nested-options remote-vm-options",children:[c.jsx(ut,{label:"Connection method",value:p.remote_connection,options:[{id:"api",label:"API"},{id:"ssh",label:"SSH"}],onChange:b=>{le("remote_connection",b),J(null),V("")}}),p.remote_connection==="api"?c.jsxs(c.Fragment,{children:[c.jsx(ut,{label:"Service",value:p.remote_provider,options:St,onChange:b=>{le("remote_provider",b),J(null)}}),p.remote_provider==="modal"&&c.jsxs("div",{className:"provider-panel",children:[c.jsxs("div",{className:"provider-heading",children:[c.jsx("span",{className:"provider-mark",children:"M"}),c.jsxs("div",{children:[c.jsx("strong",{children:"Modal"}),c.jsx("small",{children:"Connect with your Modal account token"})]}),c.jsx("span",{className:"provider-status",children:"AVAILABLE"})]}),c.jsx(ut,{label:"Modal VM GPU",value:p.modal_gpu,options:ya,onChange:Ri}),c.jsx(l1,{recommendation:rl,selectedGpu:p.modal_gpu,onApply:()=>{rl&&Ri(rl.gpu.id)}}),c.jsx(n1,{form:p,analysis:ol,fallbackImageCount:pt?.image_count??0}),c.jsxs("p",{className:"field-help modal-command-help",children:["Enter the two values separately, or paste the complete ",c.jsx("code",{children:"modal token set --token-id … --token-secret …"})," command into either field."]}),c.jsxs("div",{className:"form-grid",children:[c.jsx(Qe,{label:"Token ID",value:p.modal_token_id,onChange:b=>vt("modal_token_id",b),autoComplete:"off",spellCheck:!1,placeholder:"ak-…"}),c.jsx(Qe,{label:"Token secret",type:"password",value:p.modal_token_secret,onChange:b=>vt("modal_token_secret",b),autoComplete:"new-password",spellCheck:!1,placeholder:"as-…"})]}),ue&&c.jsxs("div",{className:"credential-success",children:[c.jsx(cl,{size:12})," ",ue]}),c.jsx(Qe,{label:"GTSFM endpoint",type:"url",value:p.remote_endpoint,onChange:b=>{le("remote_endpoint",b),J(null),q(!1),V("Endpoint changed. Start and verify this workspace before running.")},placeholder:je?"Discovering your Modal endpoint…":"Filled after credentials are verified"}),c.jsxs("button",{className:"modal-deploy-action full-width",type:"button",onClick:qa,disabled:je||Ne||!p.modal_token_id||!p.modal_token_secret,children:[c.jsx($u,{size:13})," ",Ne?"Setup in progress…":p.remote_endpoint?"Update Modal workspace":"Set up & deploy Modal workspace"]}),I&&c.jsx($0,{deployment:I,onCancel:ba,onExpand:()=>x(!0)}),I&&Ce&&c.jsx(J0,{deployment:I,onCancel:ba,onClose:()=>x(!1)}),p.remote_endpoint&&p.modal_api_key&&c.jsxs("button",{className:"secondary-action full-width",type:"button",onClick:()=>tc(),disabled:je||Ne||de,children:[de?c.jsx(il,{className:"spin",size:13}):H?.verified?c.jsx(cl,{size:13}):c.jsx(Q0,{size:13})," ",de?"Starting & checking workspace…":H?.verified?"Modal workspace ready":"Start & verify workspace"]}),c.jsx(F0,{state:Yl,detail:lc}),H&&c.jsx(ut,{label:"Remote hardware",value:p.remote_hardware,options:H.hardware.devices,onChange:b=>le("remote_hardware",b)})]})]}):c.jsxs("div",{className:"provider-panel",children:[c.jsxs("div",{className:"provider-heading",children:[c.jsx("span",{className:"provider-mark ssh",children:c.jsx(ar,{size:14})}),c.jsxs("div",{children:[c.jsx("strong",{children:"Direct VM"}),c.jsx("small",{children:"Connect to a machine you control"})]}),c.jsx("span",{className:"provider-status soon",children:"COMING SOON!"})]}),c.jsxs("div",{className:"form-grid",children:[c.jsx(Qe,{label:"Host",value:p.ssh_host,onChange:b=>le("ssh_host",b),placeholder:"gpu-box.example.com"}),c.jsx(Qe,{label:"Port",type:"number",min:"1",max:"65535",value:p.ssh_port,onChange:b=>le("ssh_port",b)}),c.jsx(Qe,{label:"Username",value:p.ssh_username,onChange:b=>le("ssh_username",b),autoComplete:"username",placeholder:"ubuntu"}),c.jsx(ut,{label:"Authentication",value:p.ssh_authentication,options:[{id:"agent",label:"SSH agent"},{id:"key",label:"Private key"}],onChange:b=>le("ssh_authentication",b)})]}),p.ssh_authentication==="key"&&c.jsx(Qe,{label:"Private key path",value:p.ssh_private_key,onChange:b=>le("ssh_private_key",b),placeholder:"/Users/you/.ssh/id_ed25519"}),c.jsx(Qe,{label:"Remote workspace",value:p.ssh_workspace,onChange:b=>le("ssh_workspace",b),placeholder:"~/gtsfm-workspace"}),c.jsx("p",{className:"field-help",children:"SSH setup is visible now; remote execution and file transfer are the next connector step."})]})]})]}),c.jsxs(Dy,{className:"advanced-options",open:U,onOpenChange:K,children:[c.jsxs(wy,{className:"advanced-trigger",children:[c.jsxs("span",{children:[c.jsx(Z0,{size:13}),c.jsxs("span",{className:"advanced-trigger-copy",children:["Advanced settings",c.jsx("small",{children:Ae.label})]})]}),c.jsx(gp,{size:14})]}),c.jsxs(Uy,{className:"advanced-content",children:[c.jsxs("div",{className:"machine-profile-summary",children:[c.jsxs("div",{children:[c.jsx("span",{children:"MACHINE PROFILE"}),c.jsx("strong",{children:Ae.label})]}),c.jsx("p",{children:Ae.description}),c.jsxs("div",{className:"machine-profile-specs",children:[c.jsxs("span",{children:[Ae.workers," worker",Ae.workers===1?"":"s"]}),c.jsxs("span",{children:[Ae.threadsPerWorker," thread",Ae.threadsPerWorker===1?"":"s"," / worker"]}),c.jsxs("span",{children:[Ae.memoryPerWorkerGiB," GB / worker"]})]})]}),c.jsxs("div",{className:"form-grid",children:[c.jsx(Qe,{label:"Max resolution",type:"number",min:"1",value:p.max_resolution,onChange:b=>le("max_resolution",b),placeholder:"Model default"}),c.jsx(Qe,{label:"Workers",type:"number",min:"1",value:p.num_workers,onChange:b=>le("num_workers",b),disabled:!Ae.allowWorkers,title:Ae.allowWorkers?void 0:"Fixed for the selected single-GPU machine"}),c.jsx(Qe,{label:"Threads / worker",type:"number",min:"1",value:p.threads_per_worker,onChange:b=>le("threads_per_worker",b),disabled:!Ae.allowThreads}),c.jsx(Qe,{label:"Memory / worker",value:p.worker_memory_limit,onChange:b=>le("worker_memory_limit",b),disabled:!Ae.allowMemory})]}),!Ae.allowWorkers&&c.jsx("p",{className:"advanced-machine-note",children:"Worker count is locked because the selected machine exposes one GPU. Choose a CPU machine to distribute work across multiple workers."}),c.jsx(ut,{label:"Graph partitioner",value:p.graph_partitioner,options:u.graph_partitioners,empty:"Model default",onChange:b=>le("graph_partitioner",b)}),c.jsxs("div",{className:"form-grid",children:[c.jsx(ut,{label:"Global descriptor",value:p.global_descriptor_config_name,options:u.global_descriptors,empty:"Model default",onChange:b=>le("global_descriptor_config_name",b)}),c.jsx(ut,{label:"Image retriever",value:p.retriever_config_name,options:u.retrievers,empty:"Model default",onChange:b=>le("retriever_config_name",b)}),c.jsx(ut,{label:"Correspondence",value:p.correspondence_generator_config_name,options:u.correspondence_generators,empty:"Model default",onChange:b=>le("correspondence_generator_config_name",b)}),c.jsx(ut,{label:"Verifier",value:p.verifier_config_name,options:u.verifiers,empty:"Model default",onChange:b=>le("verifier_config_name",b)}),c.jsx(Qe,{label:"Frame lookahead",type:"number",min:"0",value:p.max_frame_lookahead,onChange:b=>le("max_frame_lookahead",b),placeholder:"Model default"}),c.jsx(Qe,{label:"Matches / image",type:"number",min:"0",value:p.num_matched,onChange:b=>le("num_matched",b),placeholder:"Model default"})]}),c.jsx(Ch,{id:"shareIntrinsics",checked:p.share_intrinsics,disabled:!Re.share_intrinsics,onCheckedChange:b=>le("share_intrinsics",b),children:"Share camera intrinsics"}),c.jsxs("div",{className:"form-grid",children:[c.jsx(ut,{label:"Log level",value:p.log,options:u.log_levels,onChange:b=>le("log",b)}),c.jsx(Qe,{label:"Dashboard port",value:p.dashboard_port,onChange:b=>le("dashboard_port",b),placeholder:":8787",disabled:!Ae.allowLocalRuntime}),c.jsx(Qe,{label:"Input worker",value:p.input_worker,onChange:b=>le("input_worker",b),placeholder:"Optional worker address",disabled:!Ae.allowLocalRuntime}),c.jsx(Qe,{label:"Dask temp folder",value:p.dask_tmpdir,onChange:b=>le("dask_tmpdir",b),placeholder:"System default",disabled:!Ae.allowLocalRuntime}),c.jsx(Qe,{label:"Cluster config",value:p.cluster_config,onChange:b=>le("cluster_config",b),placeholder:"Optional YAML path",disabled:!Ae.allowLocalRuntime}),c.jsx(Qe,{label:"Cluster retries",type:"number",min:"0",value:p.num_retry_cluster_connection,onChange:b=>le("num_retry_cluster_connection",b),placeholder:"3",disabled:!Ae.allowLocalRuntime})]}),c.jsx(nr,{label:"Hydra overrides",children:c.jsx("textarea",{rows:4,value:p.advanced_overrides,onChange:b=>le("advanced_overrides",b.target.value)})})]})]}),c.jsx("div",{className:"form-error",role:"alert",children:oe}),c.jsxs("button",{className:"primary-action",type:"submit",disabled:$||ht||Ne||je||de||O==="sample"&&!st||p.execution_target==="remote"&&(!p.remote_endpoint||!p.modal_api_key||!H?.verified),children:[c.jsx("span",{children:$?"Starting…":ht?"Preparing sample…":Di}),$||ht||Ne||je||de?c.jsx(il,{className:"spin",size:14}):c.jsx(jp,{size:14,fill:"currentColor"})]})]})}const Ep=u=>({queued:"Queued",running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled"})[u];function Tp({jobId:u,compact:r=!1}){const f=`/api/jobs/${encodeURIComponent(u)}/splat?format=ply`;return c.jsxs("div",{className:`splat-download ${r?"compact":""}`,children:[c.jsx("span",{className:"splat-format-label",children:".PLY"}),c.jsxs("a",{href:f,download:!0,title:"Download PLY splat",children:[c.jsx(_p,{size:12}),!r&&c.jsx("span",{children:"Download"})]})]})}function o1({jobs:u,activeId:r,onSelect:f,onCancel:o,onRefresh:m}){return c.jsxs("div",{children:[c.jsxs("div",{className:"panel-title",children:[c.jsxs("div",{children:[c.jsx("h3",{children:"Activity"}),c.jsx("p",{children:"Running and recent jobs"})]}),c.jsx("button",{className:"icon-button",title:"Refresh",onClick:m,children:c.jsx(il,{size:14})})]}),c.jsx("div",{className:"job-list",children:u.length?u.map(h=>c.jsxs("article",{className:`job-card ${h.id===r?"selected":""}`,children:[c.jsxs("div",{className:"job-card-top",children:[c.jsx("strong",{children:h.name}),c.jsx("span",{className:`job-status ${h.status}`,children:Ep(h.status)})]}),c.jsxs("small",{children:[pa(h.spec.config_name||"GTSFM")," · ",pa(h.spec.splat_implementation||"no_splats")]}),h.error&&c.jsx("p",{className:"job-error",children:h.error}),c.jsxs("div",{className:"job-actions",children:[c.jsx("button",{className:"text-button",onClick:()=>f(h.id),children:h.has_final_splat?"View splat":["queued","running"].includes(h.status)?"View progress":"View details"}),["queued","running"].includes(h.status)&&c.jsxs("button",{className:"text-button danger",onClick:()=>o(h.id),children:[c.jsx(Pu,{size:9,fill:"currentColor"})," Stop"]}),h.status==="completed"&&!h.remote&&c.jsx("a",{className:"text-button",href:"/?view=results",children:"View results"}),h.remote?.workspace_url&&c.jsx("a",{className:"text-button",href:h.remote.workspace_url,target:"_blank",rel:"noreferrer",children:"Remote results ↗"})]}),h.has_final_splat&&c.jsx(Tp,{jobId:h.id,compact:!0})]},h.id)):c.jsxs("div",{className:"empty-state",children:[c.jsx(vp,{size:20}),c.jsx("strong",{children:"No runs yet"}),c.jsx("span",{children:"Configure your first reconstruction in New run."})]})})]})}function r1(){return c.jsxs("div",{children:[c.jsx("div",{className:"panel-title",children:c.jsxs("div",{children:[c.jsx("h3",{children:"Reconstructions"}),c.jsx("p",{children:"Open a scene in the 3D viewer"})]})}),c.jsxs("div",{id:"info",className:"info-summary",role:"status",children:[c.jsx("div",{className:"info-pill","data-role":"count",children:"—"}),c.jsxs("div",{className:"info-details",children:[c.jsx("div",{className:"info-title","data-role":"title",children:"Loading reconstructions…"}),c.jsx("div",{className:"info-path","data-role":"path",children:"Checking workspace…"})]})]}),c.jsx("input",{type:"text",id:"filter",placeholder:"Filter scenes…","aria-label":"Filter scenes"}),c.jsx("div",{id:"sceneList"})]})}function f1({job:u,live:r,logsOpen:f,setLogsOpen:o,visible:m,onCancel:h,onClose:_}){const E=g.useRef(null),j=g.useRef(null),[y,p]=g.useState(null),[M,O]=g.useState(!1);g.useEffect(()=>{const H=E.current,J=H?.parentElement;if(!H||!J||typeof ResizeObserver>"u")return;const ee=()=>p(ue=>{if(!ue)return null;const te=J.getBoundingClientRect(),je=Math.min(ue.width,te.width),Me=H.getBoundingClientRect().height;return{left:Math.max(0,Math.min(te.width-je,ue.left)),top:Math.max(0,Math.min(te.height-Me,ue.top)),width:je}}),V=new ResizeObserver(ee);return V.observe(J),()=>V.disconnect()},[]);const Y=H=>{if(H.target.closest("button, a, input, select"))return;const J=E.current,ee=J?.parentElement;if(!J||!ee||H.button!==0)return;H.preventDefault(),H.currentTarget.setPointerCapture(H.pointerId);const V=J.getBoundingClientRect(),ue=ee.getBoundingClientRect(),te={pointerX:H.clientX,pointerY:H.clientY,left:V.left-ue.left,top:V.top-ue.top,width:V.width,maxLeft:Math.max(0,ue.width-V.width),maxTop:Math.max(0,ue.height-V.height)};j.current=te,p({left:te.left,top:te.top,width:te.width}),O(!0)},B=H=>{const J=j.current;J&&p({left:Math.max(0,Math.min(J.maxLeft,J.left+H.clientX-J.pointerX)),top:Math.max(0,Math.min(J.maxTop,J.top+H.clientY-J.pointerY)),width:J.width})},X=H=>{j.current&&(j.current=null,O(!1),H.currentTarget.hasPointerCapture(H.pointerId)&&H.currentTarget.releasePointerCapture(H.pointerId))};if(!u||!m)return null;const Z=typeof r?.progress=="number"&&Number.isFinite(r.progress)?r.progress:u.status==="completed"?1:0,L=typeof r?.loss=="number"&&Number.isFinite(r.loss)?`loss ${r.loss.toFixed(4)}`:"",Q=typeof r?.splat_count=="number"&&Number.isFinite(r.splat_count)?`${r.splat_count.toLocaleString()} splats`:"",k=y?{left:y.left,top:y.top,width:y.width,right:"auto",bottom:"auto"}:void 0;return c.jsxs("div",{ref:E,className:`run-status-bar ${M?"is-dragging":""}`,"data-status":u.status,style:k,title:"Drag to move run status",onPointerDown:Y,onPointerMove:B,onPointerUp:X,onPointerCancel:X,children:[c.jsxs("div",{className:"status-copy status-drag-handle",onDoubleClick:()=>p(null),children:[c.jsx("span",{className:"status-dot"}),c.jsxs("div",{children:[c.jsxs("strong",{children:[u.name," · ",Ep(u.status)]}),c.jsx("small",{children:u.error||(r?.stage==="gaussian_splatting"?"Optimizing Gaussian splats":"Running reconstruction pipeline")})]})]}),c.jsxs("div",{className:"status-metrics",children:[c.jsx("span",{children:r?.max_steps?`${Number(r.step).toLocaleString()} / ${Number(r.max_steps).toLocaleString()} steps`:""}),c.jsx("span",{children:L}),c.jsx("span",{children:Q})]}),c.jsxs("div",{className:"status-actions",children:[u.has_final_splat&&c.jsx(Tp,{jobId:u.id}),["queued","running"].includes(u.status)&&c.jsxs("button",{className:"secondary-action stop-process",type:"button",onClick:()=>h(u.id),children:[c.jsx(Pu,{size:10,fill:"currentColor"})," Stop"]}),c.jsxs("button",{className:"secondary-action",onClick:()=>o(!f),children:[c.jsx(ar,{size:13})," Logs"]}),c.jsx("button",{className:"status-close",type:"button",title:"Close run status","aria-label":"Close run status",onClick:_,children:c.jsx(Ba,{size:15})})]}),c.jsx(Vy,{className:"run-progress-track",value:Z*100,children:c.jsx(Xy,{className:"run-progress-fill",style:{transform:`translateX(-${100-Z*100}%)`}})})]})}function d1({open:u,lines:r,onClose:f}){const o=g.useRef(null),m=g.useRef(null),[h,_]=g.useState(null),[E,j]=g.useState(!1),y=async()=>{await Mp(r.join(` +`))&&(j(!0),m.current!==null&&window.clearTimeout(m.current),m.current=window.setTimeout(()=>j(!1),1e3))};g.useEffect(()=>()=>{m.current!==null&&window.clearTimeout(m.current)},[]);const p=B=>{if(B.target.closest("button"))return;const X=o.current,Z=X?.parentElement;if(!X||!Z)return;B.preventDefault(),B.currentTarget.setPointerCapture(B.pointerId);const L=X.getBoundingClientRect(),Q=Z.getBoundingClientRect(),k={pointerX:B.clientX,pointerY:B.clientY,left:L.left-Q.left,top:L.top-Q.top,width:L.width,height:L.height,maxLeft:Q.width-L.width,maxTop:Q.height-L.height};_({left:k.left,top:k.top,width:k.width,height:k.height});const H=ee=>_({left:Math.max(0,Math.min(k.maxLeft,k.left+ee.clientX-k.pointerX)),top:Math.max(0,Math.min(k.maxTop,k.top+ee.clientY-k.pointerY)),width:k.width,height:k.height}),J=()=>{window.removeEventListener("pointermove",H),window.removeEventListener("pointerup",J),window.removeEventListener("pointercancel",J)};window.addEventListener("pointermove",H),window.addEventListener("pointerup",J,{once:!0}),window.addEventListener("pointercancel",J,{once:!0})},M=B=>X=>{const Z=o.current,L=Z?.parentElement;if(!Z||!L)return;X.preventDefault(),X.stopPropagation(),X.currentTarget.setPointerCapture(X.pointerId);const Q=Z.getBoundingClientRect(),k=L.getBoundingClientRect(),H={pointerX:X.clientX,pointerY:X.clientY,left:Q.left-k.left,top:Q.top-k.top,right:Q.right-k.left,bottom:Q.bottom-k.top,containerWidth:k.width,containerHeight:k.height};_({left:H.left,top:H.top,width:Q.width,height:Q.height});const J=V=>{const ue=V.clientX-H.pointerX,te=V.clientY-H.pointerY,je=B.includes("w")?Math.max(0,Math.min(H.right-300,H.left+ue)):H.left,Me=B.includes("e")?Math.min(H.containerWidth,Math.max(H.left+300,H.right+ue)):H.right,de=B.includes("n")?Math.max(0,Math.min(H.bottom-150,H.top+te)):H.top,me=B.includes("s")?Math.min(H.containerHeight,Math.max(H.top+150,H.bottom+te)):H.bottom;_({left:je,top:de,width:Me-je,height:me-de})},ee=()=>{window.removeEventListener("pointermove",J),window.removeEventListener("pointerup",ee),window.removeEventListener("pointercancel",ee)};window.addEventListener("pointermove",J),window.addEventListener("pointerup",ee,{once:!0}),window.addEventListener("pointercancel",ee,{once:!0})};if(!u)return null;const O=h?Math.max(8,Math.min(16,9+(h.width-420)/140+(h.height-240)/120)):9,Y=h?{left:h.left,top:h.top,width:h.width,height:h.height,right:"auto",bottom:"auto","--log-font-size":`${O}px`}:void 0;return c.jsxs("div",{ref:o,className:"log-drawer",role:"dialog","aria-label":"Run logs",style:Y,children:[["nw","ne","sw","se"].map(B=>c.jsx("button",{className:`log-resize-handle ${B}`,type:"button",title:"Resize logs","aria-label":`Resize logs from ${B}`,onPointerDown:M(B)},B)),c.jsxs("div",{className:"log-header",onPointerDown:p,children:[c.jsxs("strong",{children:[c.jsx(ar,{size:12})," Run logs"]}),c.jsxs("div",{className:"log-header-actions",children:[c.jsxs("button",{className:"log-copy",type:"button",title:"Copy all logs","aria-label":"Copy all logs",onClick:y,children:[E?c.jsx(cl,{size:12}):c.jsx(Sp,{size:12}),c.jsx("span",{children:E?"Copied!":"Copy"})]}),c.jsx("button",{type:"button",title:"Minimize logs","aria-label":"Minimize logs",onClick:f,children:c.jsx(Bo,{size:15})}),c.jsx("button",{type:"button",title:"Close logs","aria-label":"Close logs",onClick:f,children:c.jsx(Ba,{size:14})})]})]}),c.jsx("pre",{id:"runLogs",children:r.join(` +`)})]})}function m1({setup:u,refreshing:r,onRefresh:f,onSetupChange:o,hasActiveJob:m}){const[h,_]=g.useState(!1),[E,j]=g.useState(!1),[y,p]=g.useState(null),[M,O]=g.useState({}),Y=m?"with-active-job":"",B=async L=>{if(!(!L.action?.enabled||y)){p(L.id),O(Q=>({...Q,[L.id]:""}));try{const Q=await Ht(`/api/setup/${encodeURIComponent(L.id)}/install`,{method:"POST"});o(Q.setup)}catch(Q){O(k=>({...k,[L.id]:Bl(Q)}))}finally{p(null)}}};if(E)return c.jsx("button",{className:`setup-reopen ${Y}`,type:"button",title:"Show setup checks","aria-label":"Show setup checks",onClick:()=>j(!1),children:c.jsx(K0,{size:15})});const X=u?.status??"warning",Z=u?.counts.optional??0;return c.jsxs("section",{className:`setup-panel ${h?"collapsed":""} ${Y}`,"aria-label":"Setup checks","aria-live":"polite",children:[c.jsxs("header",{className:"setup-panel-header",children:[c.jsx("span",{className:`setup-overall-icon ${X}`,"aria-hidden":"true",children:X==="ready"?c.jsx(Y0,{size:16}):c.jsx(Ni,{size:16})}),c.jsxs("div",{className:"setup-panel-copy",children:[c.jsx("span",{children:"SETUP CHECKS"}),c.jsx("strong",{children:u?.summary??"Checking environment…"})]}),c.jsxs("div",{className:"setup-panel-actions",children:[c.jsx("button",{type:"button",title:"Refresh checks","aria-label":"Refresh setup checks",onClick:f,disabled:r,children:c.jsx(il,{className:r?"spin":"",size:13})}),c.jsx("button",{type:"button",title:h?"Expand checks":"Collapse checks","aria-label":h?"Expand setup checks":"Collapse setup checks",onClick:()=>_(L=>!L),children:h?c.jsx(gp,{size:14}):c.jsx(L0,{size:14})}),c.jsx("button",{type:"button",title:"Close checks","aria-label":"Close setup checks",onClick:()=>j(!0),children:c.jsx(Ba,{size:14})})]})]}),!h&&c.jsx("div",{className:"setup-panel-body",children:u?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"setup-summary-line",children:[c.jsxs("span",{children:[u.counts.ready," passed"]}),Z>0&&c.jsxs("span",{children:[Z," optional unavailable"]})]}),c.jsx("ul",{children:u.items.map(L=>c.jsxs("li",{"data-state":L.state,children:[c.jsx("span",{className:"setup-check-mark","aria-hidden":"true",children:L.state==="ready"?c.jsx(cl,{size:12}):L.state==="error"?c.jsx(Ba,{size:12}):c.jsx("span",{})}),c.jsxs("div",{className:"setup-check-content",children:[c.jsxs("div",{className:"setup-check-title",children:[c.jsx("strong",{children:L.label}),c.jsxs("span",{className:"setup-check-tools",children:[!L.required&&c.jsx("em",{children:"optional"}),L.action&&c.jsxs("button",{className:"setup-install",type:"button",disabled:!L.action.enabled||!!y,title:L.action.reason||L.action.label,onClick:()=>B(L),children:[y===L.id?c.jsx(il,{className:"spin",size:9}):L.action.enabled?c.jsx(_p,{size:9}):null,c.jsx("span",{children:y===L.id?"Working…":L.action.label})]})]})]}),c.jsx("small",{className:M[L.id]?"setup-action-error":void 0,children:M[L.id]||L.detail})]})]},L.id))})]}):c.jsxs("div",{className:"setup-loading",children:[c.jsx(il,{className:"spin",size:13})," Inspecting this machine…"]})})]})}function h1({job:u,live:r}){const f=r?.dask,o=f?.memory_limit_bytes?Math.min(1,f.memory_bytes/f.memory_limit_bytes):0,m=r?.stage==="gaussian_splatting"?"Optimizing splats":u.status==="queued"?"Waiting to start":"Reconstructing scene";return c.jsxs("section",{className:"dask-stats","aria-label":"Live Dask status",children:[c.jsxs("div",{className:"dask-stats-heading",children:[c.jsxs("div",{children:[c.jsx("span",{children:"DASK LIVE"}),c.jsx("strong",{children:m})]}),f?.dashboard_url&&c.jsx("a",{href:f.dashboard_url,target:"_blank",rel:"noreferrer",children:"Open dashboard ↗"})]}),f?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"dask-stat-grid",children:[c.jsxs("div",{children:[c.jsx("span",{children:"Workers"}),c.jsx("strong",{children:f.workers}),c.jsxs("small",{children:[f.threads," threads"]})]}),c.jsxs("div",{children:[c.jsx("span",{children:"Running"}),c.jsx("strong",{children:f.running_tasks}),c.jsxs("small",{children:[f.pending_tasks," pending"]})]}),c.jsxs("div",{children:[c.jsx("span",{children:"Finished"}),c.jsx("strong",{children:f.completed_tasks}),c.jsx("small",{children:f.failed_tasks?`${f.failed_tasks} failed`:"no errors"})]}),c.jsxs("div",{children:[c.jsx("span",{children:"CPU"}),c.jsxs("strong",{children:[Math.round(f.cpu_percent),"%"]}),c.jsx("small",{children:"across workers"})]})]}),c.jsxs("div",{className:"dask-memory",children:[c.jsxs("div",{children:[c.jsx("span",{children:"Memory"}),c.jsxs("strong",{children:[Ei(f.memory_bytes)," / ",Ei(f.memory_limit_bytes)]})]}),c.jsx("div",{className:"dask-memory-track",children:c.jsx("span",{style:{width:`${o*100}%`}})})]})]}):c.jsxs("div",{className:"dask-stats-waiting",children:[c.jsx("span",{className:"dask-pulse"})," Starting workers…"]})]})}function p1(u,r){if(r?.stage==="gaussian_splatting"){const o=Number(r.step||0),m=Number(r.max_steps||0);return m>0?`GTSFM: Optimizing Gaussian splats · ${o.toLocaleString()} / ${m.toLocaleString()} steps`:"GTSFM: Initializing Gaussian optimization…"}return r?.message?r.message:u.status==="queued"?u.remote?"Waiting for the Modal GPU worker…":"Waiting for the reconstruction worker…":[...u.log_tail||[]].reverse().find(o=>/GTSFM|partition|VGGT|Gaussian|splat/i.test(o))?.replace(/^.*?\b(?:DEBUG|INFO|WARNING|ERROR|CRITICAL):\s*/,"")||"GTSFM: Preparing the reconstruction pipeline…"}function v1({activeJob:u,live:r,logsOpen:f,setLogsOpen:o,statusBarOpen:m,setStatusBarOpen:h,onCancelJob:_,setup:E,setupRefreshing:j,onRefreshSetup:y,onSetupChange:p}){const M=()=>{h(!1),o(!1)},O=!!(u&&["queued","running"].includes(u.status)),Y=!!(u&&(u.spec.splat_implementation||"none")!=="none"),B=!!(r?.preview_url||r?.final_url||u?.has_final_splat),X=!!(u&&Y&&["queued","running"].includes(u.status)&&!B);return c.jsxs("main",{id:"main-content",children:[c.jsx(f1,{job:u,live:r,logsOpen:f,setLogsOpen:o,visible:m,onCancel:_,onClose:M}),c.jsx(m1,{setup:E,refreshing:j,onRefresh:y,onSetupChange:p,hasActiveJob:!!(u&&m)}),c.jsxs("div",{id:"sceneStats",className:O?"dask-active":void 0,children:[c.jsxs("div",{className:"stat-group","data-mode":"scene",children:[c.jsxs("div",{className:"stat-pair",children:[c.jsx("span",{className:"label",children:"Cameras"}),c.jsx("span",{className:"value",id:"statCameras",children:"0"})]}),c.jsxs("div",{className:"stat-pair",children:[c.jsx("span",{className:"label",children:"Points"}),c.jsx("span",{className:"value",id:"statPoints",children:"0"})]}),c.jsxs("div",{className:"stat-wide",children:[c.jsx("span",{className:"label",children:"Image"}),c.jsx("span",{className:"value",id:"statImageName",children:"—"})]})]}),c.jsx("div",{className:"stat-group","data-mode":"splat",children:c.jsxs("div",{className:"stat-pair",children:[c.jsx("span",{className:"label",children:"Splats"}),c.jsx("span",{className:"value",id:"statSplats",children:"0"})]})}),O&&u&&c.jsx(h1,{job:u,live:r})]}),c.jsx("canvas",{id:"renderCanvas"}),c.jsxs("div",{id:"hud",children:[c.jsxs("label",{className:"background-control",children:["BG ",c.jsxs("select",{id:"backgroundSelect",defaultValue:"dark","aria-label":"Viewer background",children:[c.jsx("option",{value:"dark",children:"Dark"}),c.jsx("option",{value:"graphite",children:"Graphite"}),c.jsx("option",{value:"light-gray",children:"Light gray"}),c.jsx("option",{value:"white",children:"White"})]})]}),c.jsx("button",{id:"prevCamBtn",className:"hud-scene-only",title:"Previous camera",children:c.jsx(yp,{size:14})}),c.jsx("button",{id:"nextCamBtn",className:"hud-scene-only",title:"Next camera",children:c.jsx(bp,{size:14})}),c.jsx("button",{id:"toggleStats",children:"Hide stats"}),c.jsxs("label",{className:"hud-scene-only",children:[c.jsx("input",{type:"checkbox",id:"toggleCams",defaultChecked:!0})," Cameras"]}),c.jsxs("label",{className:"hud-scene-only",children:["Point size ",c.jsx("input",{type:"range",id:"ptSize",min:"1",max:"10",defaultValue:"2"})]}),c.jsx("button",{id:"toggleGround",type:"button","aria-pressed":"true",children:"Hide plane"}),c.jsxs("label",{className:"plane-height-control",children:["Plane Y ",c.jsx("input",{type:"range",id:"groundY",min:"-5",max:"5",step:"0.1",defaultValue:"0","aria-label":"Plane vertical position"}),c.jsx("output",{id:"groundYValue",htmlFor:"groundY",children:"0.0"})]})]}),c.jsx("a",{className:"viewport-github",href:"https://github.com/borglab/gtsfm",target:"_blank",rel:"noreferrer",title:"Open GTSFM on GitHub","aria-label":"Open GTSFM GitHub repository",children:c.jsx(X0,{size:16})}),c.jsx(d1,{open:f,lines:u?.log_tail||[],onClose:()=>o(!1)}),X&&u&&c.jsx("div",{className:"pipeline-wait-overlay",role:"status","aria-live":"polite",children:c.jsxs("div",{className:"pipeline-wait-content",children:[c.jsx("span",{children:"RECONSTRUCTION IN PROGRESS"}),c.jsx("strong",{children:p1(u,r)}),c.jsxs("div",{className:"pipeline-wait-dots","aria-hidden":"true",children:[c.jsx("i",{}),c.jsx("i",{}),c.jsx("i",{})]}),c.jsx("small",{children:"The first live Gaussian preview will appear here automatically."})]})}),c.jsx("div",{id:"loadingOverlay",className:"loading-overlay",role:"status",children:c.jsxs("div",{className:"loading-box",children:[c.jsx("span",{id:"loadingMessage",children:"Loading…"}),c.jsx("div",{className:"loading-progress-track",children:c.jsx("div",{className:"loading-progress-fill",id:"loadingProgress"})})]})})]})}function g1(u){const r=u.devices.filter(_=>!_.status||_.status==="available");if(u.devices.find(_=>_.kind==="mps"))return{title:"Apple Metal (MPS) is not supported",description:"Apple Silicon and MPS can run reconstruction, but GTSFM Gaussian splatting does not currently support this backend. Use a Remote VM with an NVIDIA GPU to generate splats."};const o=u.devices.find(_=>_.kind==="rocm"||/\b(amd|radeon|rocm)\b/i.test(`${_.label} ${_.details}`));if(o)return{title:"AMD ROCm is not supported",description:`${o.label} was detected. AMD ROCm can run reconstruction, but GTSFM Gaussian splatting currently requires NVIDIA CUDA. Use a Remote VM with an NVIDIA GPU to generate splats.`};const m=u.devices.find(_=>_.kind==="nvidia"||_.kind==="cuda"||/\bnvidia\b/i.test(_.label));if(m)return{title:"NVIDIA GPU found, but CUDA is not ready",description:`${m.label} was detected, but this PyTorch environment cannot currently use it for Gaussian splatting. Install a CUDA-enabled PyTorch setup, or use a Remote VM with NVIDIA CUDA.`};const h=r.find(_=>_.kind!=="cpu");return h?{title:`${h.label} is not supported for splats`,description:"This accelerator can still be used where supported for reconstruction, but GTSFM Gaussian splatting currently requires NVIDIA CUDA. Use a compatible Remote VM to generate splats."}:{title:"No supported GPU was detected",description:"This machine can run CPU reconstruction, but GTSFM Gaussian splatting currently requires an NVIDIA CUDA GPU. Use a Remote VM to generate splats."}}function y1({hardware:u,onClose:r,onUseRemote:f}){const o=g1(u);return c.jsxs("section",{className:"hardware-warning",role:"alertdialog","aria-labelledby":"hardware-warning-title","aria-describedby":"hardware-warning-description",children:[c.jsx("div",{className:"hardware-warning-icon","aria-hidden":"true",children:c.jsx(Ni,{size:18})}),c.jsxs("div",{className:"hardware-warning-copy",children:[c.jsx("span",{children:"HARDWARE NOTICE"}),c.jsx("strong",{id:"hardware-warning-title",children:o.title}),c.jsx("p",{id:"hardware-warning-description",children:o.description}),c.jsxs("div",{className:"hardware-warning-actions",children:[c.jsxs("button",{type:"button",className:"warning-primary",onClick:f,children:[c.jsx($u,{size:12})," Use Remote VM"]}),c.jsx("button",{type:"button",onClick:r,children:"Continue without splats"})]})]}),c.jsx("button",{className:"hardware-warning-close",type:"button",title:"Dismiss hardware warning","aria-label":"Dismiss hardware warning",onClick:r,children:c.jsx(Ba,{size:14})})]})}const Ap="gtsfm-studio-sidebar-width",Ho=320,zp=760;function Mi(u){const r=Math.max(Ho,window.innerWidth-360);return Math.round(Math.min(zp,r,Math.max(Ho,u)))}function b1(){try{const u=Number(window.localStorage.getItem(Ap));return Mi(Number.isFinite(u)&&u>0?u:420)}catch{return 420}}function S1(){const[u,r]=g.useState(!1),[f,o]=g.useState(b1),[m,h]=g.useState(!1),_=g.useRef(null),[E,j]=g.useState(new URLSearchParams(location.search).get("view")==="results"?"results":"run"),[y,p]=g.useState(I0),[M,O]=g.useState(!0),[Y,B]=g.useState(""),[X,Z]=g.useState(null),[L,Q]=g.useState(null),[k,H]=g.useState(!1),[J,ee]=g.useState([]),[V,ue]=g.useState(!0),[te,je]=g.useState([]),[Me,de]=g.useState(null),[me,Ne]=g.useState(null),[Fe,R]=g.useState(!1),[q,I]=g.useState(!0),[pe,Ce]=g.useState(!1),[x,U]=g.useState(0),[K,$]=g.useState(0),ie=g.useRef(null),oe=g.useRef(null),he=g.useCallback(()=>{_.current=null,h(!1),document.body.classList.remove("sidebar-is-resizing")},[]),Ve=F=>{u||F.button!==0||(F.preventDefault(),_.current={pointerX:F.clientX,width:f},F.currentTarget.setPointerCapture(F.pointerId),h(!0),document.body.classList.add("sidebar-is-resizing"))},ke=F=>{const Re=_.current;Re&&o(Mi(Re.width+F.clientX-Re.pointerX))},qt=F=>{if(F.key==="ArrowLeft"||F.key==="ArrowRight"){F.preventDefault();const Re=F.key==="ArrowRight"?1:-1;o(ve=>Mi(ve+Re*(F.shiftKey?40:10)))}else F.key==="Home"&&(F.preventDefault(),o(420))};g.useEffect(()=>()=>document.body.classList.remove("sidebar-is-resizing"),[]),g.useEffect(()=>{try{window.localStorage.setItem(Ap,String(f))}catch{}},[f]),g.useEffect(()=>{const F=()=>o(Re=>Mi(Re));return window.addEventListener("resize",F),()=>window.removeEventListener("resize",F)},[]);const Lt=g.useCallback(async()=>{try{const F=await Ht("/api/jobs");je(F.items||[]),de(Re=>Re||F.items?.find(ve=>["queued","running"].includes(ve.status))?.id||null)}catch(F){console.warn("Unable to refresh jobs",F)}},[]),st=g.useCallback(async()=>{H(!0);try{Q(await Ht("/api/setup"))}catch(F){console.warn("Unable to inspect setup",F)}finally{H(!1)}},[]),pl=g.useCallback(async()=>{O(!0),B("");try{p(await Ht("/api/configuration"))}catch(F){B(Bl(F))}finally{O(!1)}},[]),ht=g.useCallback(async()=>{try{Z(await Ht("/api/hardware"))}catch(F){console.warn("Unable to inspect hardware",F)}finally{st()}},[st]),ga=g.useCallback(async()=>{try{const F=await Ht("/api/samples");ee(F.items)}catch(F){console.warn("Unable to load sample catalog",F)}finally{ue(!1)}},[]);g.useEffect(()=>{pl(),ht(),ga(),Lt()},[pl,ht,ga,Lt]);const at=te.find(F=>F.id===Me)??null;g.useEffect(()=>{Me&&I(!0)},[Me]),g.useEffect(()=>{let F=null,Re=null,ve=!1;const Vt=()=>{F=new WebSocket(Sh("/api/events/jobs")),F.onmessage=bt=>{const Ae=JSON.parse(bt.data);je(Ae.items||[]),de(pt=>pt||Ae.items?.find(gl=>["queued","running"].includes(gl.status))?.id||null)},F.onclose=()=>{ve||(Re=window.setTimeout(Vt,1e3))}};return Vt(),()=>{ve=!0,Re!==null&&clearTimeout(Re),F?.close()}},[]),g.useEffect(()=>{if(!at){Ne(null);return}Ne(null);const F=new WebSocket(Sh(`/api/events/jobs/${encodeURIComponent(at.id)}`));return F.onmessage=Re=>{const ve=JSON.parse(Re.data);je(Vt=>Vt.map(bt=>bt.id===ve.job.id?ve.job:bt)),Ne(ve.live)},()=>F.close()},[at?.id]),g.useEffect(()=>{if(!at||!me)return;const F=at.status==="completed"&&me.final_url?`${at.id}:${me.final_url}`:null,Re=me.preview_url?`${at.id}:${String(me.preview_version??me.preview_url)}`:null,ve=F?{kind:"final",key:F,url:me.final_url,label:`${at.name} · final`}:Re?{kind:"preview",key:Re,url:me.preview_url,label:`${at.name} · live`}:null;if(!ve||ve.kind==="final"&&oe.current===ve.key||ve.kind==="preview"&&ie.current===ve.key)return;let Vt=!1,bt=null,Ae=0;const pt=async()=>{if(Vt)return;const gl=window.gtsfmViewer;if(!gl||gl.isBusy()){bt=window.setTimeout(()=>{pt()},250);return}const ol=await gl.loadSplatsFile({splatsUrl:ve.url,label:ve.label});if(!Vt){if(ol===!1){Ae+=1,Ae<3&&(bt=window.setTimeout(()=>{pt()},1200));return}ve.kind==="final"?oe.current=ve.key:ie.current=ve.key}};return pt(),()=>{Vt=!0,bt!==null&&window.clearTimeout(bt)}},[at?.id,at?.status,me?.final_url,me?.preview_url,me?.preview_version,K]);const ql=async F=>{await fetch(`/api/jobs/${encodeURIComponent(F)}/cancel`,{method:"POST"}),await Lt()},Yt=te.filter(F=>["queued","running"].includes(F.status)).length,vl=X?.devices.some(F=>F.supports_gaussian_splatting&&(!F.status||F.status==="available"))??!1,le=!!(X&&!vl&&!pe),Ll=()=>{Ce(!0),j("run"),U(F=>F+1)};return c.jsxs("div",{className:"app-shell",children:[le&&X&&c.jsx(y1,{hardware:X,onClose:()=>Ce(!0),onUseRemote:Ll}),c.jsxs("aside",{id:"sidebar",className:`${u?"sidebar-collapsed":""} ${m?"sidebar-resizing":""}`,style:{"--sidebar-width":`${f}px`},children:[c.jsx(e1,{collapsed:u,onToggle:()=>r(F=>!F)}),c.jsxs(U0,{className:"workspace-tabs",value:E,onValueChange:j,children:[c.jsxs(G0,{className:"studio-tabs","aria-label":"Workspace sections",children:[c.jsxs(Co,{className:"studio-tab",value:"run",children:[c.jsx(jp,{size:12})," New run"]}),c.jsxs(Co,{className:"studio-tab",value:"activity",children:[c.jsx(vp,{size:12})," Activity ",Yt>0&&c.jsx("span",{id:"activeJobCount",children:Yt})]}),c.jsxs(Co,{className:"studio-tab",value:"results",children:[c.jsx(q0,{size:12})," Results"]})]}),c.jsx(Eo,{className:"studio-panel",value:"run",forceMount:!0,children:c.jsx(s1,{schema:y,hardware:X,samples:J,samplesLoading:V,onStarted:F=>{I(!0),de(F.id),Lt()},onTabChange:j,remotePromptKey:x,schemaLoading:M,schemaError:Y,onRetrySchema:pl})}),c.jsx(Eo,{className:"studio-panel",value:"activity",forceMount:!0,children:c.jsx(o1,{jobs:te,activeId:Me,onSelect:F=>{I(!0),de(F),ie.current=null,oe.current=null,$(Re=>Re+1)},onCancel:ql,onRefresh:Lt})}),c.jsx(Eo,{className:"studio-panel",value:"results",forceMount:!0,children:c.jsx(r1,{})})]}),c.jsx("div",{className:"sidebar-resize-handle",role:"separator","aria-label":"Resize side panel","aria-orientation":"vertical","aria-valuemin":Ho,"aria-valuemax":zp,"aria-valuenow":f,tabIndex:u?-1:0,title:"Drag to resize side panel",onPointerDown:Ve,onPointerMove:ke,onPointerUp:he,onPointerCancel:he,onDoubleClick:()=>o(Mi(420)),onKeyDown:qt})]}),c.jsx(v1,{activeJob:at,live:me,logsOpen:Fe,setLogsOpen:R,statusBarOpen:q,setStatusBarOpen:I,onCancelJob:ql,setup:L,setupRefreshing:k,onRefreshSetup:st,onSetupChange:Q})]})}const Np=document.getElementById("root");if(!Np)throw new Error("GTSFM Studio root element is missing");qo.flushSync(()=>Pg.createRoot(Np).render(c.jsx(S1,{})));