From ea47ae729abbe21df2bc95f642a2c88640de199f Mon Sep 17 00:00:00 2001 From: "Josef M. Gallmetzer" <64498081+galjos@users.noreply.github.com> Date: Sat, 8 Aug 2026 22:18:55 +0200 Subject: [PATCH] Update PQSetup for PQ 0.7 --- README.md | 2 +- docs/reference/compatibility.rst | 9 +- docs/run-packages.rst | 3 +- docs/workflow.rst | 2 +- frontend/src/App.tsx | 137 ++++++++++++------ frontend/src/conditionOptions.test.ts | 2 +- frontend/src/method.test.ts | 50 ++++++- frontend/src/method.ts | 20 ++- frontend/src/types.ts | 1 + pqsetup/api.py | 21 ++- pqsetup/cli.py | 28 ++-- pqsetup/external_qm.py | 2 +- pqsetup/models.py | 1 + pqsetup/release.py | 2 +- pqsetup/runners.py | 25 ++++ pqsetup/static/assets/index-BnGP_kT3.js | 184 ++++++++++++++++++++++++ pqsetup/static/assets/index-DYUebUkg.js | 184 ------------------------ pqsetup/static/index.html | 2 +- tests/test_api_cli.py | 67 +++++++++ tests/test_plan_api_export.py | 38 +++++ tests/test_run_plans.py | 22 ++- tests/test_runners.py | 28 +++- 22 files changed, 573 insertions(+), 257 deletions(-) create mode 100644 pqsetup/static/assets/index-BnGP_kT3.js delete mode 100644 pqsetup/static/assets/index-DYUebUkg.js diff --git a/README.md b/README.md index 8f3b4c4..7b78bc3 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ validation, PQSetup also checks the inputs with PQ. Environment detection reports what is available. It does not establish that a method, force field, or protocol is scientifically suitable. -PQSetup targets the stable PQ v0.6.4 input schema. +PQSetup writes inputs for the stable PQ v0.7.0 release. ## Run Packages diff --git a/docs/reference/compatibility.rst b/docs/reference/compatibility.rst index aa74352..0eaa8f8 100644 --- a/docs/reference/compatibility.rst +++ b/docs/reference/compatibility.rst @@ -4,7 +4,7 @@ Compatibility PQ inputs --------- -PQSetup currently writes inputs for the stable PQ v0.6.4 schema. It does not +PQSetup currently writes inputs for the stable PQ v0.7.0 release. It does not expose unreleased keywords merely because they exist on a development branch. .. list-table:: @@ -18,7 +18,7 @@ expose unreleased keywords merely because they exist on a development branch. - Available - ``portable`` during export and ``installed`` from the CLI * - Does not advertise the validation contract - - Available for v0.6.4 inputs + - Available for v0.7.0 inputs - Not run; local checks remain active * - Not detected - Portable export remains available @@ -26,6 +26,11 @@ expose unreleased keywords merely because they exist on a development branch. Calculator availability is reported separately from PQ parser support. +The guided QM methods are DFTB+, ASE–DFTB+, ASE–xTB, PySCF, Turbomole, +MACE-MP, and MACE-OFF. PQ 0.7.0 also accepts FeNNol inputs, but PQSetup does +not yet package its binary model file and therefore does not present a partial +FeNNol workflow. + Structure formats ----------------- diff --git a/docs/run-packages.rst b/docs/run-packages.rst index 05f31a9..ba7584a 100644 --- a/docs/run-packages.rst +++ b/docs/run-packages.rst @@ -66,7 +66,8 @@ Project manifest * the scientific plan and execution order; * input, structure, setup-file, and run-script SHA-256 hashes; * structure and preparation provenance; -* the PQ and calculator environment seen during export; +* the PQ build, calculator readiness, and method availability seen during + export; * warnings and the result of each PQ validation layer. The manifest makes it possible to inspect what was prepared without parsing diff --git a/docs/workflow.rst b/docs/workflow.rst index 666e752..44ff351 100644 --- a/docs/workflow.rst +++ b/docs/workflow.rst @@ -84,7 +84,7 @@ warnings remain visible and are recorded in the project manifest. The restart relationship and final PQ input are visible before export. -The exported input header identifies PQSetup and the targeted PQ schema. It is +The exported input header identifies PQSetup and the target PQ release. It is designed to make provenance obvious without obscuring the settings that matter. diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 09b2545..8144ca9 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -55,6 +55,7 @@ import { MM_MODES, mmModeLabel, packagedSetupFileName, + preferredRunner, qmSetupFileSpecs, recommendedRunnerScript, selectedExternalQMScript, @@ -783,15 +784,27 @@ export default function App() { .then((value) => { if (!current) return; setBootstrap(value); - const preferred = - value.runners.find((runner) => runner.id === "ase_xtb") ?? - value.runners.find((runner) => runner.supported); + const preferred = preferredRunner(value.runners); if (preferred) { - setSetup((existing) => - isMolecularMechanics(existing) || existing.runner - ? existing - : { ...existing, runner: preferred.id }, - ); + setSetup((existing) => { + const selected = value.runners.find( + (runner) => runner.id === existing.runner, + ); + if ( + isMolecularMechanics(existing) || + (existing.runner && selected?.available_in_pq !== false) + ) { + return existing; + } + return { + ...existing, + runner: preferred.id, + runner_script: recommendedRunnerScript( + value.pq.external_qm, + preferred.id, + ), + }; + }); } }) .catch((error) => { @@ -901,6 +914,9 @@ export default function App() { setup.runner && !selectedRunnerStatus?.ready, ); + const pqMethodUnavailable = Boolean( + !molecularMechanics && selectedRunnerStatus?.available_in_pq === false, + ); const portableValidationAvailable = Boolean( bootstrap?.pq.validation_scopes.includes("portable"), ); @@ -964,7 +980,10 @@ export default function App() { const stepState = useMemo>( () => ({ system: analysis.valid ? "ok" : "warn", - method: !methodReady || calculatorMissing ? "warn" : "ok", + method: + !methodReady || calculatorMissing || pqMethodUnavailable + ? "warn" + : "ok", conditions: diagnostics.some( (item) => item.severity === "error" && @@ -984,6 +1003,7 @@ export default function App() { calculatorMissing, diagnostics, methodReady, + pqMethodUnavailable, ready, rendered, ], @@ -1132,9 +1152,12 @@ export default function App() { id: `calculator-${runner.id}`, group: "Scientific setup", label: runner.label, - detail: runner.ready - ? "Calculator ready" - : `${runner.detail} Inputs can still be created.`, + detail: + runner.available_in_pq === false + ? "Selected PQ build does not include this method. Inputs can still be created." + : runner.ready + ? "Calculator ready" + : `${runner.detail} Inputs can still be created.`, keywords: [ "calculator", "runner", @@ -1147,10 +1170,16 @@ export default function App() { chooseCalculator(runner.id); goToControl("method"); setNotice({ - kind: runner.ready ? "success" : "info", - message: runner.ready - ? `${runner.label} selected.` - : `${runner.label} selected but was not detected.`, + kind: + runner.ready && runner.available_in_pq !== false + ? "success" + : "info", + message: + runner.available_in_pq === false + ? `${runner.label} selected. Use a PQ build that includes it when running.` + : runner.ready + ? `${runner.label} selected.` + : `${runner.label} selected but was not detected.`, }); }, }), @@ -1792,9 +1821,7 @@ export default function App() { return; } - const preferred = - bootstrap?.runners.find((runner) => runner.id === "ase_xtb") ?? - bootstrap?.runners.find((runner) => runner.supported); + const preferred = preferredRunner(bootstrap?.runners ?? []); setSetup((existing) => ({ ...existing, preset_id: null, @@ -2001,7 +2028,7 @@ export default function App() { - Schema {bootstrap.target_pq_release} + Input target {bootstrap.target_pq_release} ) : bootstrapError ? ( @@ -2159,7 +2186,7 @@ export default function App() { - Target schema {bootstrap.target_pq_release} + Input target {bootstrap.target_pq_release} )} @@ -2211,11 +2238,14 @@ export default function App() { .filter((runner) => runner.supported) .map((runner) => { const selected = setup.runner === runner.id; - const runnerState = runner.ready - ? "ready" - : runner.installed + const runnerState = + runner.available_in_pq === false ? "incomplete" - : "missing"; + : runner.ready + ? "ready" + : runner.installed + ? "incomplete" + : "missing"; return (
- {runner.ready - ? "Ready" - : runner.installed - ? "Setup incomplete" - : "Not detected"} + {runner.available_in_pq === false + ? "PQ build mismatch" + : runner.ready + ? "Ready" + : runner.installed + ? "Setup incomplete" + : "Not detected"} - {selected && !runner.ready && ( -
-
- )} + {selected && + (!runner.ready || + runner.available_in_pq === false) && ( +
+
+ )}
); })} @@ -3389,10 +3426,16 @@ export default function App() { -
  • +
  • diff --git a/frontend/src/conditionOptions.test.ts b/frontend/src/conditionOptions.test.ts index a5f0778..4f3fa6b 100644 --- a/frontend/src/conditionOptions.test.ts +++ b/frontend/src/conditionOptions.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from "vitest"; import { MANOSTATS, THERMOSTATS } from "./conditionOptions"; -describe("PQ 0.6.4 condition options", () => { +describe("PQ 0.7.0 condition options", () => { it("uses the exact thermostat keywords", () => { expect(THERMOSTATS.map((option) => option.value)).toEqual([ "berendsen", diff --git a/frontend/src/method.test.ts b/frontend/src/method.test.ts index 6373bd2..4214816 100644 --- a/frontend/src/method.test.ts +++ b/frontend/src/method.test.ts @@ -6,12 +6,17 @@ import { missingSetupFileRoles, mmModeLabel, packagedSetupFileName, + preferredRunner, qmSetupFileSpecs, recommendedRunnerScript, selectedExternalQMScript, setupFileSpecs, } from "./method"; -import type { ExternalQMCapabilities, SetupFile } from "./types"; +import type { + ExternalQMCapabilities, + RunnerStatus, + SetupFile, +} from "./types"; const files: SetupFile[] = [ { role: "moldescriptor", name: "molecules.dat", content: "water" }, @@ -21,6 +26,41 @@ const files: SetupFile[] = [ { role: "intra_nonbonded", name: "intra.dat", content: "pairs" }, ]; +function runner( + id: string, + availableInPQ: boolean | null, + ready = true, +): RunnerStatus { + return { + id, + label: id, + supported: true, + installed: ready, + ready, + executable: null, + version: null, + available_in_pq: availableInPQ, + detail: ready ? "Detected." : "Not detected.", + }; +} + +describe("calculator preference", () => { + it("does not default to a method missing from the selected PQ build", () => { + expect( + preferredRunner([ + runner("ase_xtb", false), + runner("dftbplus", true), + ])?.id, + ).toBe("dftbplus"); + expect( + preferredRunner([ + runner("ase_xtb", null), + runner("dftbplus", null), + ])?.id, + ).toBe("ase_xtb"); + }); +}); + describe("molecular mechanics method", () => { it("exposes only files used by each force-field mode", () => { expect(setupFileSpecs("off").map((file) => file.role)).toEqual([ @@ -75,6 +115,14 @@ describe("QM companion files", () => { expect(defaultSetupFileName("dftb_template")).toBe("dftb_in.template"); }); + it("requires an explicit PySCF method without installed capabilities", () => { + expect(recommendedRunnerScript(null, "pyscf")).toBeNull(); + expect(selectedExternalQMScript(null, "pyscf", null)).toBeNull(); + expect( + selectedExternalQMScript(null, "pyscf", "pyscf_hf.py")?.name, + ).toBe("pyscf_hf.py"); + }); + it("uses advertised scripts, labels, and dependencies", () => { const capabilities: ExternalQMCapabilities = { script_mode: "bundled_or_full_path", diff --git a/frontend/src/method.ts b/frontend/src/method.ts index f6e67d8..cba0fbc 100644 --- a/frontend/src/method.ts +++ b/frontend/src/method.ts @@ -4,6 +4,7 @@ import type { ExternalQMProgram, ExternalQMScript, MMForceFieldMode, + RunnerStatus, SetupFile, SetupFileRole, } from "./types"; @@ -39,6 +40,23 @@ export const MM_MODES: MMModeOption[] = [ }, ]; +export function preferredRunner( + runners: RunnerStatus[], +): RunnerStatus | undefined { + const supported = runners.filter((runner) => runner.supported); + const available = supported.filter( + (runner) => runner.available_in_pq !== false, + ); + return ( + available.find((runner) => runner.id === "ase_xtb" && runner.ready) ?? + available.find((runner) => runner.ready) ?? + available.find((runner) => runner.id === "ase_xtb") ?? + available[0] ?? + supported.find((runner) => runner.id === "ase_xtb") ?? + supported[0] + ); +} + const FILE_SPECS: Record> = { moldescriptor: { role: "moldescriptor", @@ -92,7 +110,7 @@ const FALLBACK_EXTERNAL_QM: ExternalQMCapabilities = { ], }, pyscf: { - recommended_script: "pyscf_hf.py", + recommended_script: null, scripts: [ { name: "pyscf_hf.py", diff --git a/frontend/src/types.ts b/frontend/src/types.ts index 1046431..36ce3ac 100644 --- a/frontend/src/types.ts +++ b/frontend/src/types.ts @@ -95,6 +95,7 @@ export interface RunnerStatus { ready: boolean; executable: string | null; version: string | null; + available_in_pq: boolean | null; detail: string; } diff --git a/pqsetup/api.py b/pqsetup/api.py index 744647a..956b0ab 100644 --- a/pqsetup/api.py +++ b/pqsetup/api.py @@ -38,7 +38,7 @@ from .pq_validation import PQValidationError, validate_pq_input from .presets import list_presets from .release import TARGET_PQ_RELEASE -from .runners import detect_runners +from .runners import apply_pq_capabilities, detect_runners from .run_plan import plan_requested, render_run_plan from .run_script import RUN_SCRIPT_NAME, render_run_script from .setup_files import required_qm_file_roles @@ -65,10 +65,13 @@ def create_app(*, pq_executable: str | None = None) -> FastAPI: app.add_middleware(TrustedHostMiddleware, allowed_hosts=_TRUSTED_HOSTS) pq = discover_pq(pq_executable) runner_context = pq.executable if pq.found else None - runners = ( - detect_runners(runner_context, external_qm=pq.external_qm) - if pq.external_qm is not None - else detect_runners(runner_context) + runners = apply_pq_capabilities( + ( + detect_runners(runner_context, external_qm=pq.external_qm) + if pq.external_qm is not None + else detect_runners(runner_context) + ), + pq.capabilities, ) @app.get("/api/health") @@ -440,7 +443,13 @@ def _export_plan( else { "id": runner_id, "detected": bool(status and status.installed), - "ready": bool(status and status.ready), + "calculator_ready": bool(status and status.ready), + "available_in_pq": status.available_in_pq if status else None, + "ready": bool( + status + and status.ready + and status.available_in_pq is not False + ), "version": status.version if status else None, "detail": ( status.detail diff --git a/pqsetup/cli.py b/pqsetup/cli.py index 426153f..4bdbeb4 100644 --- a/pqsetup/cli.py +++ b/pqsetup/cli.py @@ -14,7 +14,7 @@ from .input_writer import validate_input_file from .models import DoctorReport from .pq_validation import PQValidationError, validate_pq_input -from .runners import detect_runners +from .runners import apply_pq_capabilities, detect_runners def build_parser() -> argparse.ArgumentParser: @@ -96,13 +96,16 @@ def main(arguments: list[str] | None = None) -> int: ) report = DoctorReport( pq=pq, - runners=( - detect_runners( - pq.executable if pq.found else None, - external_qm=pq.external_qm, - ) - if pq.external_qm is not None - else detect_runners(pq.executable if pq.found else None) + runners=apply_pq_capabilities( + ( + detect_runners( + pq.executable if pq.found else None, + external_qm=pq.external_qm, + ) + if pq.external_qm is not None + else detect_runners(pq.executable if pq.found else None) + ), + pq.capabilities, ), diagnostics=[], ) @@ -204,6 +207,15 @@ def _print_doctor(report: DoctorReport) -> None: for runner in report.runners: if not runner.supported: state = "unsupported" + elif runner.available_in_pq is False and runner.ready: + state = "calculator ready · PQ build mismatch" + elif runner.available_in_pq is False and runner.installed: + state = ( + f"calculator setup incomplete · {runner.detail} " + "· PQ build mismatch" + ) + elif runner.available_in_pq is False: + state = "calculator not detected · PQ build mismatch" elif runner.ready: state = "detected" elif runner.installed: diff --git a/pqsetup/external_qm.py b/pqsetup/external_qm.py index 606e162..fc22959 100644 --- a/pqsetup/external_qm.py +++ b/pqsetup/external_qm.py @@ -26,7 +26,7 @@ ], }, "pyscf": { - "recommended_script": "pyscf_hf.py", + "recommended_script": None, "scripts": [ {"name": "pyscf_hf.py", "label": "UHF / STO-3G"}, { diff --git a/pqsetup/models.py b/pqsetup/models.py index 6c8906c..ce49a1e 100644 --- a/pqsetup/models.py +++ b/pqsetup/models.py @@ -103,6 +103,7 @@ class RunnerStatus(BaseModel): ready: bool executable: str | None = None version: str | None = None + available_in_pq: bool | None = None detail: str diff --git a/pqsetup/release.py b/pqsetup/release.py index 99c06df..90c211f 100644 --- a/pqsetup/release.py +++ b/pqsetup/release.py @@ -1,4 +1,4 @@ -TARGET_PQ_RELEASE = "v0.6.4" +TARGET_PQ_RELEASE = "v0.7.0" PQ_QM_PROGRAMS = frozenset( { diff --git a/pqsetup/runners.py b/pqsetup/runners.py index 9cc3c7c..2986ad6 100644 --- a/pqsetup/runners.py +++ b/pqsetup/runners.py @@ -7,6 +7,7 @@ import subprocess from functools import lru_cache from pathlib import Path +from typing import Any from .external_qm import advertised_script_names, external_qm_config from .models import ExternalQMCapabilities, RunnerStatus @@ -276,3 +277,27 @@ def detect_runners( status.model_copy(deep=True) for status in _detect_runners(context, scripts, config.script_mode) ] + + +def apply_pq_capabilities( + statuses: list[RunnerStatus], + capabilities: dict[str, Any] | None, +) -> list[RunnerStatus]: + if capabilities is None: + return statuses + input_capabilities = capabilities.get("input") + if not isinstance(input_capabilities, dict): + return statuses + advertised = input_capabilities.get("qm_programs") + if not isinstance(advertised, list) or not all( + isinstance(item, str) for item in advertised + ): + return statuses + + available = set(advertised) + return [ + status.model_copy( + update={"available_in_pq": status.id in available}, + ) + for status in statuses + ] diff --git a/pqsetup/static/assets/index-BnGP_kT3.js b/pqsetup/static/assets/index-BnGP_kT3.js new file mode 100644 index 0000000..2eb8b7c --- /dev/null +++ b/pqsetup/static/assets/index-BnGP_kT3.js @@ -0,0 +1,184 @@ +(function(){const g=document.createElement("link").relList;if(g&&g.supports&&g.supports("modulepreload"))return;for(const D of document.querySelectorAll('link[rel="modulepreload"]'))r(D);new MutationObserver(D=>{for(const R of D)if(R.type==="childList")for(const q of R.addedNodes)q.tagName==="LINK"&&q.rel==="modulepreload"&&r(q)}).observe(document,{childList:!0,subtree:!0});function _(D){const R={};return D.integrity&&(R.integrity=D.integrity),D.referrerPolicy&&(R.referrerPolicy=D.referrerPolicy),D.crossOrigin==="use-credentials"?R.credentials="include":D.crossOrigin==="anonymous"?R.credentials="omit":R.credentials="same-origin",R}function r(D){if(D.ep)return;D.ep=!0;const R=_(D);fetch(D.href,R)}})();var ef={exports:{}},vu={};/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var fm;function $p(){if(fm)return vu;fm=1;var f=Symbol.for("react.transitional.element"),g=Symbol.for("react.fragment");function _(r,D,R){var q=null;if(R!==void 0&&(q=""+R),D.key!==void 0&&(q=""+D.key),"key"in D){R={};for(var F in D)F!=="key"&&(R[F]=D[F])}else R=D;return D=R.ref,{$$typeof:f,type:r,key:q,ref:D!==void 0?D:null,props:R}}return vu.Fragment=g,vu.jsx=_,vu.jsxs=_,vu}var rm;function Wp(){return rm||(rm=1,ef.exports=$p()),ef.exports}var i=Wp(),lf={exports:{}},ae={};/** + * @license React + * react.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var om;function Fp(){if(om)return ae;om=1;var f=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),q=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),M=Symbol.for("react.memo"),ee=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),te=Symbol.iterator;function oe(d){return d===null||typeof d!="object"?null:(d=te&&d[te]||d["@@iterator"],typeof d=="function"?d:null)}var Be={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},se=Object.assign,we={};function Qe(d,j,B){this.props=d,this.context=j,this.refs=we,this.updater=B||Be}Qe.prototype.isReactComponent={},Qe.prototype.setState=function(d,j){if(typeof d!="object"&&typeof d!="function"&&d!=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,d,j,"setState")},Qe.prototype.forceUpdate=function(d){this.updater.enqueueForceUpdate(this,d,"forceUpdate")};function x(){}x.prototype=Qe.prototype;function X(d,j,B){this.props=d,this.context=j,this.refs=we,this.updater=B||Be}var W=X.prototype=new x;W.constructor=X,se(W,Qe.prototype),W.isPureReactComponent=!0;var G=Array.isArray;function V(){}var k={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function al(d,j,B){var Z=B.ref;return{$$typeof:f,type:d,key:j,ref:Z!==void 0?Z:null,props:B}}function yl(d,j){return al(d.type,j,d.props)}function ke(d){return typeof d=="object"&&d!==null&&d.$$typeof===f}function C(d){var j={"=":"=0",":":"=2"};return"$"+d.replace(/[=:]/g,function(B){return j[B]})}var ql=/\/+/g;function jl(d,j){return typeof d=="object"&&d!==null&&d.key!=null?C(""+d.key):j.toString(36)}function Je(d){switch(d.status){case"fulfilled":return d.value;case"rejected":throw d.reason;default:switch(typeof d.status=="string"?d.then(V,V):(d.status="pending",d.then(function(j){d.status==="pending"&&(d.status="fulfilled",d.value=j)},function(j){d.status==="pending"&&(d.status="rejected",d.reason=j)})),d.status){case"fulfilled":return d.value;case"rejected":throw d.reason}}throw d}function N(d,j,B,Z,le){var ue=typeof d;(ue==="undefined"||ue==="boolean")&&(d=null);var ge=!1;if(d===null)ge=!0;else switch(ue){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(d.$$typeof){case f:case g:ge=!0;break;case ee:return ge=d._init,N(ge(d._payload),j,B,Z,le)}}if(ge)return le=le(d),ge=Z===""?"."+jl(d,0):Z,G(le)?(B="",ge!=null&&(B=ge.replace(ql,"$&/")+"/"),N(le,j,B,"",function(dt){return dt})):le!=null&&(ke(le)&&(le=yl(le,B+(le.key==null||d&&d.key===le.key?"":(""+le.key).replace(ql,"$&/")+"/")+ge)),j.push(le)),1;ge=0;var el=Z===""?".":Z+":";if(G(d))for(var qe=0;qe>>1,ye=N[pe];if(0>>1;peD(B,$))ZD(le,B)?(N[pe]=le,N[Z]=$,pe=Z):(N[pe]=B,N[j]=$,pe=j);else if(ZD(le,$))N[pe]=le,N[Z]=$,pe=Z;else break e}}return Y}function D(N,Y){var $=N.sortIndex-Y.sortIndex;return $!==0?$:N.id-Y.id}if(f.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var R=performance;f.unstable_now=function(){return R.now()}}else{var q=Date,F=q.now();f.unstable_now=function(){return q.now()-F}}var H=[],M=[],ee=1,L=null,te=3,oe=!1,Be=!1,se=!1,we=!1,Qe=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function W(N){for(var Y=_(M);Y!==null;){if(Y.callback===null)r(M);else if(Y.startTime<=N)r(M),Y.sortIndex=Y.expirationTime,g(H,Y);else break;Y=_(M)}}function G(N){if(se=!1,W(N),!Be)if(_(H)!==null)Be=!0,V||(V=!0,C());else{var Y=_(M);Y!==null&&Je(G,Y.startTime-N)}}var V=!1,k=-1,P=5,al=-1;function yl(){return we?!0:!(f.unstable_now()-alN&&yl());){var pe=L.callback;if(typeof pe=="function"){L.callback=null,te=L.priorityLevel;var ye=pe(L.expirationTime<=N);if(N=f.unstable_now(),typeof ye=="function"){L.callback=ye,W(N),Y=!0;break l}L===_(H)&&r(H),W(N)}else r(H);L=_(H)}if(L!==null)Y=!0;else{var d=_(M);d!==null&&Je(G,d.startTime-N),Y=!1}}break e}finally{L=null,te=$,oe=!1}Y=void 0}}finally{Y?C():V=!1}}}var C;if(typeof X=="function")C=function(){X(ke)};else if(typeof MessageChannel<"u"){var ql=new MessageChannel,jl=ql.port2;ql.port1.onmessage=ke,C=function(){jl.postMessage(null)}}else C=function(){Qe(ke,0)};function Je(N,Y){k=Qe(function(){N(f.unstable_now())},Y)}f.unstable_IdlePriority=5,f.unstable_ImmediatePriority=1,f.unstable_LowPriority=4,f.unstable_NormalPriority=3,f.unstable_Profiling=null,f.unstable_UserBlockingPriority=2,f.unstable_cancelCallback=function(N){N.callback=null},f.unstable_forceFrameRate=function(N){0>N||125pe?(N.sortIndex=$,g(M,N),_(H)===null&&N===_(M)&&(se?(x(k),k=-1):se=!0,Je(G,$-pe))):(N.sortIndex=ye,g(H,N),Be||oe||(Be=!0,V||(V=!0,C()))),N},f.unstable_shouldYield=yl,f.unstable_wrapCallback=function(N){var Y=te;return function(){var $=te;te=Y;try{return N.apply(this,arguments)}finally{te=$}}}})(nf)),nf}var hm;function Pp(){return hm||(hm=1,af.exports=Ip()),af.exports}var uf={exports:{}},dl={};/** + * @license React + * react-dom.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var pm;function e0(){if(pm)return dl;pm=1;var f=_f();function g(H){var M="https://react.dev/errors/"+H;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f)}catch(g){console.error(g)}}return f(),uf.exports=e0(),uf.exports}/** + * @license React + * react-dom-client.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var gm;function t0(){if(gm)return bu;gm=1;var f=Pp(),g=_f(),_=l0();function r(e){var l="https://react.dev/errors/"+e;if(1ye||(e.current=pe[ye],pe[ye]=null,ye--)}function B(e,l){ye++,pe[ye]=e.current,e.current=l}var Z=d(null),le=d(null),ue=d(null),ge=d(null);function el(e,l){switch(B(ue,l),B(le,e),B(Z,null),l.nodeType){case 9:case 11:e=(e=l.documentElement)&&(e=e.namespaceURI)?Cd(e):0;break;default:if(e=l.tagName,l=l.namespaceURI)l=Cd(l),e=qd(l,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}j(Z),B(Z,e)}function qe(){j(Z),j(le),j(ue)}function dt(e){e.memoizedState!==null&&B(ge,e);var l=Z.current,t=qd(l,e.type);l!==t&&(B(le,e),B(Z,t))}function da(e){le.current===e&&(j(Z),j(le)),ge.current===e&&(j(ge),hu._currentValue=$)}var Rt,De;function Pl(e){if(Rt===void 0)try{throw Error()}catch(t){var l=t.stack.trim().match(/\n( *(at )?)/);Rt=l&&l[1]||"",De=-1)":-1n||m[a]!==b[n]){var E=` +`+m[a].replace(" at new "," at ");return e.displayName&&E.includes("")&&(E=E.replace("",e.displayName)),E}while(1<=a&&0<=n);break}}}finally{Ha=!1,Error.prepareStackTrace=t}return(t=e?e.displayName||e.name:"")?Pl(t):""}function zu(e,l){switch(e.tag){case 26:case 27:case 5:return Pl(e.type);case 16:return Pl("Lazy");case 13:return e.child!==l&&l!==null?Pl("Suspense Fallback"):Pl("Suspense");case 19:return Pl("SuspenseList");case 0:case 15:return Ba(e.type,!1);case 11:return Ba(e.type.render,!1);case 1:return Ba(e.type,!0);case 31:return Pl("Activity");default:return""}}function En(e){try{var l="",t=null;do l+=zu(e,t),t=e,e=e.return;while(e);return l}catch(a){return` +Error generating stack: `+a.message+` +`+a.stack}}var Ht=Object.prototype.hasOwnProperty,Bt=f.unstable_scheduleCallback,et=f.unstable_cancelCallback,Nu=f.unstable_shouldYield,Qa=f.unstable_requestPaint,ce=f.unstable_now,ml=f.unstable_getCurrentPriorityLevel,Qt=f.unstable_ImmediatePriority,Yt=f.unstable_UserBlockingPriority,lt=f.unstable_NormalPriority,mt=f.unstable_LowPriority,ht=f.unstable_IdlePriority,Eu=f.log,hl=f.unstable_setDisableYieldValue,Se=null,Ge=null;function Vl(e){if(typeof Eu=="function"&&hl(e),Ge&&typeof Ge.setStrictMode=="function")try{Ge.setStrictMode(Se,e)}catch{}}var rl=Math.clz32?Math.clz32:tt,Tn=Math.log,ma=Math.LN2;function tt(e){return e>>>=0,e===0?32:31-(Tn(e)/ma|0)|0}var Gt=256,ha=262144,at=4194304;function zl(e){var l=e&42;if(l!==0)return l;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,l,t){var a=e.pendingLanes;if(a===0)return 0;var n=0,u=e.suspendedLanes,c=e.pingedLanes;e=e.warmLanes;var s=a&134217727;return s!==0?(a=s&~u,a!==0?n=zl(a):(c&=s,c!==0?n=zl(c):t||(t=s&~e,t!==0&&(n=zl(t))))):(s=a&~u,s!==0?n=zl(s):c!==0?n=zl(c):t||(t=a&~e,t!==0&&(n=zl(t)))),n===0?0:l!==0&&l!==n&&(l&u)===0&&(u=n&-n,t=l&-l,u>=t||u===32&&(t&4194048)!==0)?l:n}function Ul(e,l){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&l)===0}function Tu(e,l){switch(e){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 nl(){var e=at;return at<<=1,(at&62914560)===0&&(at=4194304),e}function Ga(e){for(var l=[],t=0;31>t;t++)l.push(e);return l}function pt(e,l){e.pendingLanes|=l,l!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function pa(e,l,t,a,n,u){var c=e.pendingLanes;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=t,e.entangledLanes&=t,e.errorRecoveryDisabledLanes&=t,e.shellSuspendCounter=0;var s=e.entanglements,m=e.expirationTimes,b=e.hiddenUpdates;for(t=c&~t;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Zm=/[\n"\\]/g;function Hl(e){return e.replace(Zm,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Ji(e,l,t,a,n,u,c,s){e.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?e.type=c:e.removeAttribute("type"),l!=null?c==="number"?(l===0&&e.value===""||e.value!=l)&&(e.value=""+Te(l)):e.value!==""+Te(l)&&(e.value=""+Te(l)):c!=="submit"&&c!=="reset"||e.removeAttribute("value"),l!=null?$i(e,c,Te(l)):t!=null?$i(e,c,Te(t)):a!=null&&e.removeAttribute("value"),n==null&&u!=null&&(e.defaultChecked=!!u),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.name=""+Te(s):e.removeAttribute("name")}function Nf(e,l,t,a,n,u,c,s){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),l!=null||t!=null){if(!(u!=="submit"&&u!=="reset"||l!=null)){ki(e);return}t=t!=null?""+Te(t):"",l=l!=null?""+Te(l):t,s||l===e.value||(e.value=l),e.defaultValue=l}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=s?e.checked:!!a,e.defaultChecked=!!a,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.name=c),ki(e)}function $i(e,l,t){l==="number"&&Cu(e.ownerDocument)===e||e.defaultValue===""+t||(e.defaultValue=""+t)}function wa(e,l,t,a){if(e=e.options,l){l={};for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ec=!1;if(bt)try{var Cn={};Object.defineProperty(Cn,"passive",{get:function(){ec=!0}}),window.addEventListener("test",Cn,Cn),window.removeEventListener("test",Cn,Cn)}catch{ec=!1}var Zt=null,lc=null,Uu=null;function Cf(){if(Uu)return Uu;var e,l=lc,t=l.length,a,n="value"in Zt?Zt.value:Zt.textContent,u=n.length;for(e=0;e=Rn),Qf=" ",Yf=!1;function Gf(e,l){switch(e){case"keyup":return gh.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ja=!1;function bh(e,l){switch(e){case"compositionend":return Lf(l);case"keypress":return l.which!==32?null:(Yf=!0,Qf);case"textInput":return e=l.data,e===Qf&&Yf?null:e;default:return null}}function _h(e,l){if(Ja)return e==="compositionend"||!ic&&Gf(e,l)?(e=Cf(),Uu=lc=Zt=null,Ja=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:t,offset:l-e};e=a}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=$f(t)}}function Ff(e,l){return e&&l?e===l?!0:e&&e.nodeType===3?!1:l&&l.nodeType===3?Ff(e,l.parentNode):"contains"in e?e.contains(l):e.compareDocumentPosition?!!(e.compareDocumentPosition(l)&16):!1:!1}function If(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var l=Cu(e.document);l instanceof e.HTMLIFrameElement;){try{var t=typeof l.contentWindow.location.href=="string"}catch{t=!1}if(t)e=l.contentWindow;else break;l=Cu(e.document)}return l}function fc(e){var l=e&&e.nodeName&&e.nodeName.toLowerCase();return l&&(l==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||l==="textarea"||e.contentEditable==="true")}var Mh=bt&&"documentMode"in document&&11>=document.documentMode,$a=null,rc=null,Yn=null,oc=!1;function Pf(e,l,t){var a=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;oc||$a==null||$a!==Cu(a)||(a=$a,"selectionStart"in a&&fc(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}),Yn&&Qn(Yn,a)||(Yn=a,a=Ti(rc,"onSelect"),0>=c,n-=c,ct=1<<32-rl(l)+n|t<ie?(me=K,K=null):me=K.sibling;var be=S(p,K,v[ie],A);if(be===null){K===null&&(K=me);break}e&&K&&be.alternate===null&&l(p,K),h=u(be,h,ie),ve===null?J=be:ve.sibling=be,ve=be,K=me}if(ie===v.length)return t(p,K),he&&St(p,ie),J;if(K===null){for(;ieie?(me=K,K=null):me=K.sibling;var oa=S(p,K,be.value,A);if(oa===null){K===null&&(K=me);break}e&&K&&oa.alternate===null&&l(p,K),h=u(oa,h,ie),ve===null?J=oa:ve.sibling=oa,ve=oa,K=me}if(be.done)return t(p,K),he&&St(p,ie),J;if(K===null){for(;!be.done;ie++,be=v.next())be=O(p,be.value,A),be!==null&&(h=u(be,h,ie),ve===null?J=be:ve.sibling=be,ve=be);return he&&St(p,ie),J}for(K=a(K);!be.done;ie++,be=v.next())be=z(K,p,ie,be.value,A),be!==null&&(e&&be.alternate!==null&&K.delete(be.key===null?ie:be.key),h=u(be,h,ie),ve===null?J=be:ve.sibling=be,ve=be);return e&&K.forEach(function(Jp){return l(p,Jp)}),he&&St(p,ie),J}function Oe(p,h,v,A){if(typeof v=="object"&&v!==null&&v.type===se&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case oe:e:{for(var J=v.key;h!==null;){if(h.key===J){if(J=v.type,J===se){if(h.tag===7){t(p,h.sibling),A=n(h,v.props.children),A.return=p,p=A;break e}}else if(h.elementType===J||typeof J=="object"&&J!==null&&J.$$typeof===P&&Ta(J)===h.type){t(p,h.sibling),A=n(h,v.props),Vn(A,v),A.return=p,p=A;break e}t(p,h);break}else l(p,h);h=h.sibling}v.type===se?(A=xa(v.props.children,p.mode,A,v.key),A.return=p,p=A):(A=wu(v.type,v.key,v.props,null,p.mode,A),Vn(A,v),A.return=p,p=A)}return c(p);case Be:e:{for(J=v.key;h!==null;){if(h.key===J)if(h.tag===4&&h.stateNode.containerInfo===v.containerInfo&&h.stateNode.implementation===v.implementation){t(p,h.sibling),A=n(h,v.children||[]),A.return=p,p=A;break e}else{t(p,h);break}else l(p,h);h=h.sibling}A=vc(v,p.mode,A),A.return=p,p=A}return c(p);case P:return v=Ta(v),Oe(p,h,v,A)}if(Je(v))return w(p,h,v,A);if(C(v)){if(J=C(v),typeof J!="function")throw Error(r(150));return v=J.call(v),I(p,h,v,A)}if(typeof v.then=="function")return Oe(p,h,Fu(v),A);if(v.$$typeof===X)return Oe(p,h,ku(p,v),A);Iu(p,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,h!==null&&h.tag===6?(t(p,h.sibling),A=n(h,v),A.return=p,p=A):(t(p,h),A=gc(v,p.mode,A),A.return=p,p=A),c(p)):t(p,h)}return function(p,h,v,A){try{wn=0;var J=Oe(p,h,v,A);return cn=null,J}catch(K){if(K===un||K===$u)throw K;var ve=Tl(29,K,null,p.mode);return ve.lanes=A,ve.return=p,ve}finally{}}}var Aa=xr(!0),jr=xr(!1),Jt=!1;function Oc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Dc(e,l){e=e.updateQueue,l.updateQueue===e&&(l.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function $t(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Wt(e,l,t){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(_e&2)!==0){var n=a.pending;return n===null?l.next=l:(l.next=n.next,n.next=l),a.pending=l,l=Zu(e),ir(e,null,t),l}return Xu(e,a,l,t),Zu(e)}function Kn(e,l,t){if(l=l.updateQueue,l!==null&&(l=l.shared,(t&4194048)!==0)){var a=l.lanes;a&=e.pendingLanes,t|=a,l.lanes=t,Mn(e,t)}}function Cc(e,l){var t=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,t===a)){var n=null,u=null;if(t=t.firstBaseUpdate,t!==null){do{var c={lane:t.lane,tag:t.tag,payload:t.payload,callback:null,next:null};u===null?n=u=c:u=u.next=c,t=t.next}while(t!==null);u===null?n=u=l:u=u.next=l}else n=u=l;t={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},e.updateQueue=t;return}e=t.lastBaseUpdate,e===null?t.firstBaseUpdate=l:e.next=l,t.lastBaseUpdate=l}var qc=!1;function kn(){if(qc){var e=nn;if(e!==null)throw e}}function Jn(e,l,t,a){qc=!1;var n=e.updateQueue;Jt=!1;var u=n.firstBaseUpdate,c=n.lastBaseUpdate,s=n.shared.pending;if(s!==null){n.shared.pending=null;var m=s,b=m.next;m.next=null,c===null?u=b:c.next=b,c=m;var E=e.alternate;E!==null&&(E=E.updateQueue,s=E.lastBaseUpdate,s!==c&&(s===null?E.firstBaseUpdate=b:s.next=b,E.lastBaseUpdate=m))}if(u!==null){var O=n.baseState;c=0,E=b=m=null,s=u;do{var S=s.lane&-536870913,z=S!==s.lane;if(z?(de&S)===S:(a&S)===S){S!==0&&S===an&&(qc=!0),E!==null&&(E=E.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var w=e,I=s;S=l;var Oe=t;switch(I.tag){case 1:if(w=I.payload,typeof w=="function"){O=w.call(Oe,O,S);break e}O=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=I.payload,S=typeof w=="function"?w.call(Oe,O,S):w,S==null)break e;O=L({},O,S);break e;case 2:Jt=!0}}S=s.callback,S!==null&&(e.flags|=64,z&&(e.flags|=8192),z=n.callbacks,z===null?n.callbacks=[S]:z.push(S))}else z={lane:S,tag:s.tag,payload:s.payload,callback:s.callback,next:null},E===null?(b=E=z,m=O):E=E.next=z,c|=S;if(s=s.next,s===null){if(s=n.shared.pending,s===null)break;z=s,s=z.next,z.next=null,n.lastBaseUpdate=z,n.shared.pending=null}}while(!0);E===null&&(m=O),n.baseState=m,n.firstBaseUpdate=b,n.lastBaseUpdate=E,u===null&&(n.shared.lanes=0),la|=c,e.lanes=c,e.memoizedState=O}}function zr(e,l){if(typeof e!="function")throw Error(r(191,e));e.call(l)}function Nr(e,l){var t=e.callbacks;if(t!==null)for(e.callbacks=null,e=0;eu?u:8;var c=N.T,s={};N.T=s,Ic(e,!1,l,t);try{var m=n(),b=N.S;if(b!==null&&b(s,m),m!==null&&typeof m=="object"&&typeof m.then=="function"){var E=Bh(m,a);Fn(e,l,E,Cl(e))}else Fn(e,l,a,Cl(e))}catch(O){Fn(e,l,{then:function(){},status:"rejected",reason:O},Cl())}finally{Y.p=u,c!==null&&s.types!==null&&(c.types=s.types),N.T=c}}function Zh(){}function Wc(e,l,t,a){if(e.tag!==5)throw Error(r(476));var n=ao(e).queue;to(e,n,l,$,t===null?Zh:function(){return no(e),t(a)})}function ao(e){var l=e.memoizedState;if(l!==null)return l;l={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nt,lastRenderedState:$},next:null};var t={};return l.next={memoizedState:t,baseState:t,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nt,lastRenderedState:t},next:null},e.memoizedState=l,e=e.alternate,e!==null&&(e.memoizedState=l),l}function no(e){var l=ao(e);l.next===null&&(l=e.alternate.memoizedState),Fn(e,l.next.queue,{},Cl())}function Fc(){return cl(hu)}function uo(){return Ke().memoizedState}function io(){return Ke().memoizedState}function wh(e){for(var l=e.return;l!==null;){switch(l.tag){case 24:case 3:var t=Cl();e=$t(t);var a=Wt(l,e,t);a!==null&&(xl(a,l,t),Kn(a,l,t)),l={cache:Ec()},e.payload=l;return}l=l.return}}function Vh(e,l,t){var a=Cl();t={lane:a,revertLane:0,gesture:null,action:t,hasEagerState:!1,eagerState:null,next:null},si(e)?so(l,t):(t=pc(e,l,t,a),t!==null&&(xl(t,e,a),fo(t,l,a)))}function co(e,l,t){var a=Cl();Fn(e,l,t,a)}function Fn(e,l,t,a){var n={lane:a,revertLane:0,gesture:null,action:t,hasEagerState:!1,eagerState:null,next:null};if(si(e))so(l,n);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=l.lastRenderedReducer,u!==null))try{var c=l.lastRenderedState,s=u(c,t);if(n.hasEagerState=!0,n.eagerState=s,El(s,c))return Xu(e,l,n,0),Ce===null&&Lu(),!1}catch{}finally{}if(t=pc(e,l,n,a),t!==null)return xl(t,e,a),fo(t,l,a),!0}return!1}function Ic(e,l,t,a){if(a={lane:2,revertLane:Os(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},si(e)){if(l)throw Error(r(479))}else l=pc(e,t,a,2),l!==null&&xl(l,e,2)}function si(e){var l=e.alternate;return e===ne||l!==null&&l===ne}function so(e,l){fn=li=!0;var t=e.pending;t===null?l.next=l:(l.next=t.next,t.next=l),e.pending=l}function fo(e,l,t){if((t&4194048)!==0){var a=l.lanes;a&=e.pendingLanes,t|=a,l.lanes=t,Mn(e,t)}}var In={readContext:cl,use:ni,useCallback:Xe,useContext:Xe,useEffect:Xe,useImperativeHandle:Xe,useLayoutEffect:Xe,useInsertionEffect:Xe,useMemo:Xe,useReducer:Xe,useRef:Xe,useState:Xe,useDebugValue:Xe,useDeferredValue:Xe,useTransition:Xe,useSyncExternalStore:Xe,useId:Xe,useHostTransitionStatus:Xe,useFormState:Xe,useActionState:Xe,useOptimistic:Xe,useMemoCache:Xe,useCacheRefresh:Xe};In.useEffectEvent=Xe;var ro={readContext:cl,use:ni,useCallback:function(e,l){return pl().memoizedState=[e,l===void 0?null:l],e},useContext:cl,useEffect:kr,useImperativeHandle:function(e,l,t){t=t!=null?t.concat([e]):null,ii(4194308,4,Fr.bind(null,l,e),t)},useLayoutEffect:function(e,l){return ii(4194308,4,e,l)},useInsertionEffect:function(e,l){ii(4,2,e,l)},useMemo:function(e,l){var t=pl();l=l===void 0?null:l;var a=e();if(Oa){Vl(!0);try{e()}finally{Vl(!1)}}return t.memoizedState=[a,l],a},useReducer:function(e,l,t){var a=pl();if(t!==void 0){var n=t(l);if(Oa){Vl(!0);try{t(l)}finally{Vl(!1)}}}else n=l;return a.memoizedState=a.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},a.queue=e,e=e.dispatch=Vh.bind(null,ne,e),[a.memoizedState,e]},useRef:function(e){var l=pl();return e={current:e},l.memoizedState=e},useState:function(e){e=Vc(e);var l=e.queue,t=co.bind(null,ne,l);return l.dispatch=t,[e.memoizedState,t]},useDebugValue:Jc,useDeferredValue:function(e,l){var t=pl();return $c(t,e,l)},useTransition:function(){var e=Vc(!1);return e=to.bind(null,ne,e.queue,!0,!1),pl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,l,t){var a=ne,n=pl();if(he){if(t===void 0)throw Error(r(407));t=t()}else{if(t=l(),Ce===null)throw Error(r(349));(de&127)!==0||Dr(a,l,t)}n.memoizedState=t;var u={value:t,getSnapshot:l};return n.queue=u,kr(qr.bind(null,a,u,e),[e]),a.flags|=2048,on(9,{destroy:void 0},Cr.bind(null,a,u,t,l),null),t},useId:function(){var e=pl(),l=Ce.identifierPrefix;if(he){var t=st,a=ct;t=(a&~(1<<32-rl(a)-1)).toString(32)+t,l="_"+l+"R_"+t,t=ti++,0<\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?c.createElement("select",{is:a.is}):c.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?c.createElement(n,{is:a.is}):c.createElement(n)}}u[ll]=l,u[ol]=a;e:for(c=l.child;c!==null;){if(c.tag===5||c.tag===6)u.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break e;for(;c.sibling===null;){if(c.return===null||c.return===l)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}l.stateNode=u;e:switch(fl(u,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&&Tt(l)}}return He(l),ds(l,l.type,e===null?null:e.memoizedProps,l.pendingProps,t),null;case 6:if(e&&l.stateNode!=null)e.memoizedProps!==a&&Tt(l);else{if(typeof a!="string"&&l.stateNode===null)throw Error(r(166));if(e=ue.current,ln(l)){if(e=l.stateNode,t=l.memoizedProps,a=null,n=il,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}e[ll]=l,e=!!(e.nodeValue===t||a!==null&&a.suppressHydrationWarning===!0||Od(e.nodeValue,t)),e||Kt(l,!0)}else e=Mi(e).createTextNode(a),e[ll]=l,l.stateNode=e}return He(l),null;case 31:if(t=l.memoizedState,e===null||e.memoizedState!==null){if(a=ln(l),t!==null){if(e===null){if(!a)throw Error(r(318));if(e=l.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[ll]=l}else ja(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;He(l),e=!1}else t=xc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=t),e=!0;if(!e)return l.flags&256?(Al(l),l):(Al(l),null);if((l.flags&128)!==0)throw Error(r(558))}return He(l),null;case 13:if(a=l.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=ln(l),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(r(318));if(n=l.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));n[ll]=l}else ja(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;He(l),n=!1}else n=xc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return l.flags&256?(Al(l),l):(Al(l),null)}return Al(l),(l.flags&128)!==0?(l.lanes=t,l):(t=a!==null,e=e!==null&&e.memoizedState!==null,t&&(a=l.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==n&&(a.flags|=2048)),t!==e&&t&&(l.child.flags|=8192),mi(l,l.updateQueue),He(l),null);case 4:return qe(),e===null&&Us(l.stateNode.containerInfo),He(l),null;case 10:return jt(l.type),He(l),null;case 19:if(j(Ve),a=l.memoizedState,a===null)return He(l),null;if(n=(l.flags&128)!==0,u=a.rendering,u===null)if(n)eu(a,!1);else{if(Ze!==0||e!==null&&(e.flags&128)!==0)for(e=l.child;e!==null;){if(u=ei(e),u!==null){for(l.flags|=128,eu(a,!1),e=u.updateQueue,l.updateQueue=e,mi(l,e),l.subtreeFlags=0,e=t,t=l.child;t!==null;)cr(t,e),t=t.sibling;return B(Ve,Ve.current&1|2),he&&St(l,a.treeForkCount),l.child}e=e.sibling}a.tail!==null&&ce()>vi&&(l.flags|=128,n=!0,eu(a,!1),l.lanes=4194304)}else{if(!n)if(e=ei(u),e!==null){if(l.flags|=128,n=!0,e=e.updateQueue,l.updateQueue=e,mi(l,e),eu(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!he)return He(l),null}else 2*ce()-a.renderingStartTime>vi&&t!==536870912&&(l.flags|=128,n=!0,eu(a,!1),l.lanes=4194304);a.isBackwards?(u.sibling=l.child,l.child=u):(e=a.last,e!==null?e.sibling=u:l.child=u,a.last=u)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=ce(),e.sibling=null,t=Ve.current,B(Ve,n?t&1|2:t&1),he&&St(l,a.treeForkCount),e):(He(l),null);case 22:case 23:return Al(l),Rc(),a=l.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(l.flags|=8192):a&&(l.flags|=8192),a?(t&536870912)!==0&&(l.flags&128)===0&&(He(l),l.subtreeFlags&6&&(l.flags|=8192)):He(l),t=l.updateQueue,t!==null&&mi(l,t.retryQueue),t=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),a=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(a=l.memoizedState.cachePool.pool),a!==t&&(l.flags|=2048),e!==null&&j(Ea),null;case 24:return t=null,e!==null&&(t=e.memoizedState.cache),l.memoizedState.cache!==t&&(l.flags|=2048),jt(We),He(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function Wh(e,l){switch(_c(l),l.tag){case 1:return e=l.flags,e&65536?(l.flags=e&-65537|128,l):null;case 3:return jt(We),qe(),e=l.flags,(e&65536)!==0&&(e&128)===0?(l.flags=e&-65537|128,l):null;case 26:case 27:case 5:return da(l),null;case 31:if(l.memoizedState!==null){if(Al(l),l.alternate===null)throw Error(r(340));ja()}return e=l.flags,e&65536?(l.flags=e&-65537|128,l):null;case 13:if(Al(l),e=l.memoizedState,e!==null&&e.dehydrated!==null){if(l.alternate===null)throw Error(r(340));ja()}return e=l.flags,e&65536?(l.flags=e&-65537|128,l):null;case 19:return j(Ve),null;case 4:return qe(),null;case 10:return jt(l.type),null;case 22:case 23:return Al(l),Rc(),e!==null&&j(Ea),e=l.flags,e&65536?(l.flags=e&-65537|128,l):null;case 24:return jt(We),null;case 25:return null;default:return null}}function Ro(e,l){switch(_c(l),l.tag){case 3:jt(We),qe();break;case 26:case 27:case 5:da(l);break;case 4:qe();break;case 31:l.memoizedState!==null&&Al(l);break;case 13:Al(l);break;case 19:j(Ve);break;case 10:jt(l.type);break;case 22:case 23:Al(l),Rc(),e!==null&&j(Ea);break;case 24:jt(We)}}function lu(e,l){try{var t=l.updateQueue,a=t!==null?t.lastEffect:null;if(a!==null){var n=a.next;t=n;do{if((t.tag&e)===e){a=void 0;var u=t.create,c=t.inst;a=u(),c.destroy=a}t=t.next}while(t!==n)}}catch(s){Ee(l,l.return,s)}}function Pt(e,l,t){try{var a=l.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var u=n.next;a=u;do{if((a.tag&e)===e){var c=a.inst,s=c.destroy;if(s!==void 0){c.destroy=void 0,n=l;var m=t,b=s;try{b()}catch(E){Ee(n,m,E)}}}a=a.next}while(a!==u)}}catch(E){Ee(l,l.return,E)}}function Ho(e){var l=e.updateQueue;if(l!==null){var t=e.stateNode;try{Nr(l,t)}catch(a){Ee(e,e.return,a)}}}function Bo(e,l,t){t.props=Da(e.type,e.memoizedProps),t.state=e.memoizedState;try{t.componentWillUnmount()}catch(a){Ee(e,l,a)}}function tu(e,l){try{var t=e.ref;if(t!==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 t=="function"?e.refCleanup=t(a):t.current=a}}catch(n){Ee(e,l,n)}}function ft(e,l){var t=e.ref,a=e.refCleanup;if(t!==null)if(typeof a=="function")try{a()}catch(n){Ee(e,l,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof t=="function")try{t(null)}catch(n){Ee(e,l,n)}else t.current=null}function Qo(e){var l=e.type,t=e.memoizedProps,a=e.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":t.autoFocus&&a.focus();break e;case"img":t.src?a.src=t.src:t.srcSet&&(a.srcset=t.srcSet)}}catch(n){Ee(e,e.return,n)}}function ms(e,l,t){try{var a=e.stateNode;vp(a,e.type,t,l),a[ol]=l}catch(n){Ee(e,e.return,n)}}function Yo(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ia(e.type)||e.tag===4}function hs(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Yo(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&&ia(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 ps(e,l,t){var a=e.tag;if(a===5||a===6)e=e.stateNode,l?(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t).insertBefore(e,l):(l=t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.appendChild(e),t=t._reactRootContainer,t!=null||l.onclick!==null||(l.onclick=vt));else if(a!==4&&(a===27&&ia(e.type)&&(t=e.stateNode,l=null),e=e.child,e!==null))for(ps(e,l,t),e=e.sibling;e!==null;)ps(e,l,t),e=e.sibling}function hi(e,l,t){var a=e.tag;if(a===5||a===6)e=e.stateNode,l?t.insertBefore(e,l):t.appendChild(e);else if(a!==4&&(a===27&&ia(e.type)&&(t=e.stateNode),e=e.child,e!==null))for(hi(e,l,t),e=e.sibling;e!==null;)hi(e,l,t),e=e.sibling}function Go(e){var l=e.stateNode,t=e.memoizedProps;try{for(var a=e.type,n=l.attributes;n.length;)l.removeAttributeNode(n[0]);fl(l,a,t),l[ll]=e,l[ol]=t}catch(u){Ee(e,e.return,u)}}var Mt=!1,Pe=!1,ys=!1,Lo=typeof WeakSet=="function"?WeakSet:Set,ul=null;function Fh(e,l){if(e=e.containerInfo,Bs=Ri,e=If(e),fc(e)){if("selectionStart"in e)var t={start:e.selectionStart,end:e.selectionEnd};else e:{t=(t=e.ownerDocument)&&t.defaultView||window;var a=t.getSelection&&t.getSelection();if(a&&a.rangeCount!==0){t=a.anchorNode;var n=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{t.nodeType,u.nodeType}catch{t=null;break e}var c=0,s=-1,m=-1,b=0,E=0,O=e,S=null;l:for(;;){for(var z;O!==t||n!==0&&O.nodeType!==3||(s=c+n),O!==u||a!==0&&O.nodeType!==3||(m=c+a),O.nodeType===3&&(c+=O.nodeValue.length),(z=O.firstChild)!==null;)S=O,O=z;for(;;){if(O===e)break l;if(S===t&&++b===n&&(s=c),S===u&&++E===a&&(m=c),(z=O.nextSibling)!==null)break;O=S,S=O.parentNode}O=z}t=s===-1||m===-1?null:{start:s,end:m}}else t=null}t=t||{start:0,end:0}}else t=null;for(Qs={focusedElem:e,selectionRange:t},Ri=!1,ul=l;ul!==null;)if(l=ul,e=l.child,(l.subtreeFlags&1028)!==0&&e!==null)e.return=l,ul=e;else for(;ul!==null;){switch(l=ul,u=l.alternate,e=l.flags,l.tag){case 0:if((e&4)!==0&&(e=l.updateQueue,e=e!==null?e.events:null,e!==null))for(t=0;t title"))),fl(u,a,t),u[ll]=e,$e(u),a=u;break e;case"link":var c=kd("link","href",n).get(a+(t.href||""));if(c){for(var s=0;sOe&&(c=Oe,Oe=I,I=c);var p=Wf(s,I),h=Wf(s,Oe);if(p&&h&&(z.rangeCount!==1||z.anchorNode!==p.node||z.anchorOffset!==p.offset||z.focusNode!==h.node||z.focusOffset!==h.offset)){var v=O.createRange();v.setStart(p.node,p.offset),z.removeAllRanges(),I>Oe?(z.addRange(v),z.extend(h.node,h.offset)):(v.setEnd(h.node,h.offset),z.addRange(v))}}}}for(O=[],z=s;z=z.parentNode;)z.nodeType===1&&O.push({element:z,left:z.scrollLeft,top:z.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;st?32:t,N.T=null,t=js,js=null;var u=aa,c=qt;if(tl=0,yn=aa=null,qt=0,(_e&6)!==0)throw Error(r(331));var s=_e;if(_e|=4,Io(u.current),$o(u,u.current,c,t),_e=s,su(0,!1),Ge&&typeof Ge.onPostCommitFiberRoot=="function")try{Ge.onPostCommitFiberRoot(Se,u)}catch{}return!0}finally{Y.p=n,N.T=a,yd(e,l)}}function vd(e,l,t){l=Ql(t,l),l=ts(e.stateNode,l,2),e=Wt(e,l,2),e!==null&&(pt(e,2),rt(e))}function Ee(e,l,t){if(e.tag===3)vd(e,e,t);else for(;l!==null;){if(l.tag===3){vd(l,e,t);break}else if(l.tag===1){var a=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(ta===null||!ta.has(a))){e=Ql(t,e),t=bo(2),a=Wt(l,t,2),a!==null&&(_o(t,a,l,e),pt(a,2),rt(a));break}}l=l.return}}function Ts(e,l,t){var a=e.pingCache;if(a===null){a=e.pingCache=new ep;var n=new Set;a.set(l,n)}else n=a.get(l),n===void 0&&(n=new Set,a.set(l,n));n.has(t)||(bs=!0,n.add(t),e=up.bind(null,e,l,t),l.then(e,e))}function up(e,l,t){var a=e.pingCache;a!==null&&a.delete(l),e.pingedLanes|=e.suspendedLanes&t,e.warmLanes&=~t,Ce===e&&(de&t)===t&&(Ze===4||Ze===3&&(de&62914560)===de&&300>ce()-gi?(_e&2)===0&&gn(e,0):_s|=t,pn===de&&(pn=0)),rt(e)}function bd(e,l){l===0&&(l=nl()),e=Sa(e,l),e!==null&&(pt(e,l),rt(e))}function ip(e){var l=e.memoizedState,t=0;l!==null&&(t=l.retryLane),bd(e,t)}function cp(e,l){var t=0;switch(e.tag){case 31:case 13:var a=e.stateNode,n=e.memoizedState;n!==null&&(t=n.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(r(314))}a!==null&&a.delete(l),bd(e,t)}function sp(e,l){return Bt(e,l)}var zi=null,bn=null,Ms=!1,Ni=!1,As=!1,ua=0;function rt(e){e!==bn&&e.next===null&&(bn===null?zi=bn=e:bn=bn.next=e),Ni=!0,Ms||(Ms=!0,rp())}function su(e,l){if(!As&&Ni){As=!0;do for(var t=!1,a=zi;a!==null;){if(e!==0){var n=a.pendingLanes;if(n===0)var u=0;else{var c=a.suspendedLanes,s=a.pingedLanes;u=(1<<31-rl(42|e)+1)-1,u&=n&~(c&~s),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(t=!0,jd(a,u))}else u=de,u=Ya(a,a===Ce?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||Ul(a,u)||(t=!0,jd(a,u));a=a.next}while(t);As=!1}}function fp(){_d()}function _d(){Ni=Ms=!1;var e=0;ua!==0&&_p()&&(e=ua);for(var l=ce(),t=null,a=zi;a!==null;){var n=a.next,u=Sd(a,l);u===0?(a.next=null,t===null?zi=n:t.next=n,n===null&&(bn=t)):(t=a,(e!==0||(u&3)!==0)&&(Ni=!0)),a=n}tl!==0&&tl!==5||su(e),ua!==0&&(ua=0)}function Sd(e,l){for(var t=e.suspendedLanes,a=e.pingedLanes,n=e.expirationTimes,u=e.pendingLanes&-62914561;0s)break;var E=m.transferSize,O=m.initiatorType;E&&Dd(O)&&(m=m.responseEnd,c+=E*(m"u"?null:document;function Zd(e,l,t){var a=_n;if(a&&typeof l=="string"&&l){var n=Hl(l);n='link[rel="'+e+'"][href="'+n+'"]',typeof t=="string"&&(n+='[crossorigin="'+t+'"]'),Xd.has(n)||(Xd.add(n),e={rel:e,crossOrigin:t,href:l},a.querySelector(n)===null&&(l=a.createElement("link"),fl(l,"link",e),$e(l),a.head.appendChild(l)))}}function Ap(e){Ut.D(e),Zd("dns-prefetch",e,null)}function Op(e,l){Ut.C(e,l),Zd("preconnect",e,l)}function Dp(e,l,t){Ut.L(e,l,t);var a=_n;if(a&&e&&l){var n='link[rel="preload"][as="'+Hl(l)+'"]';l==="image"&&t&&t.imageSrcSet?(n+='[imagesrcset="'+Hl(t.imageSrcSet)+'"]',typeof t.imageSizes=="string"&&(n+='[imagesizes="'+Hl(t.imageSizes)+'"]')):n+='[href="'+Hl(e)+'"]';var u=n;switch(l){case"style":u=Sn(e);break;case"script":u=xn(e)}wl.has(u)||(e=L({rel:"preload",href:l==="image"&&t&&t.imageSrcSet?void 0:e,as:l},t),wl.set(u,e),a.querySelector(n)!==null||l==="style"&&a.querySelector(du(u))||l==="script"&&a.querySelector(mu(u))||(l=a.createElement("link"),fl(l,"link",e),$e(l),a.head.appendChild(l)))}}function Cp(e,l){Ut.m(e,l);var t=_n;if(t&&e){var a=l&&typeof l.as=="string"?l.as:"script",n='link[rel="modulepreload"][as="'+Hl(a)+'"][href="'+Hl(e)+'"]',u=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=xn(e)}if(!wl.has(u)&&(e=L({rel:"modulepreload",href:e},l),wl.set(u,e),t.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(t.querySelector(mu(u)))return}a=t.createElement("link"),fl(a,"link",e),$e(a),t.head.appendChild(a)}}}function qp(e,l,t){Ut.S(e,l,t);var a=_n;if(a&&e){var n=Rl(a).hoistableStyles,u=Sn(e);l=l||"default";var c=n.get(u);if(!c){var s={loading:0,preload:null};if(c=a.querySelector(du(u)))s.loading=5;else{e=L({rel:"stylesheet",href:e,"data-precedence":l},t),(t=wl.get(u))&&Vs(e,t);var m=c=a.createElement("link");$e(m),fl(m,"link",e),m._p=new Promise(function(b,E){m.onload=b,m.onerror=E}),m.addEventListener("load",function(){s.loading|=1}),m.addEventListener("error",function(){s.loading|=2}),s.loading|=4,Oi(c,l,a)}c={type:"stylesheet",instance:c,count:1,state:s},n.set(u,c)}}}function Up(e,l){Ut.X(e,l);var t=_n;if(t&&e){var a=Rl(t).hoistableScripts,n=xn(e),u=a.get(n);u||(u=t.querySelector(mu(n)),u||(e=L({src:e,async:!0},l),(l=wl.get(n))&&Ks(e,l),u=t.createElement("script"),$e(u),fl(u,"link",e),t.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function Rp(e,l){Ut.M(e,l);var t=_n;if(t&&e){var a=Rl(t).hoistableScripts,n=xn(e),u=a.get(n);u||(u=t.querySelector(mu(n)),u||(e=L({src:e,async:!0,type:"module"},l),(l=wl.get(n))&&Ks(e,l),u=t.createElement("script"),$e(u),fl(u,"link",e),t.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function wd(e,l,t,a){var n=(n=ue.current)?Ai(n):null;if(!n)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof t.precedence=="string"&&typeof t.href=="string"?(l=Sn(t.href),t=Rl(n).hoistableStyles,a=t.get(l),a||(a={type:"style",instance:null,count:0,state:null},t.set(l,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(t.rel==="stylesheet"&&typeof t.href=="string"&&typeof t.precedence=="string"){e=Sn(t.href);var u=Rl(n).hoistableStyles,c=u.get(e);if(c||(n=n.ownerDocument||n,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,c),(u=n.querySelector(du(e)))&&!u._p&&(c.instance=u,c.state.loading=5),wl.has(e)||(t={rel:"preload",as:"style",href:t.href,crossOrigin:t.crossOrigin,integrity:t.integrity,media:t.media,hrefLang:t.hrefLang,referrerPolicy:t.referrerPolicy},wl.set(e,t),u||Hp(n,e,t,c.state))),l&&a===null)throw Error(r(528,""));return c}if(l&&a!==null)throw Error(r(529,""));return null;case"script":return l=t.async,t=t.src,typeof t=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=xn(t),t=Rl(n).hoistableScripts,a=t.get(l),a||(a={type:"script",instance:null,count:0,state:null},t.set(l,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Sn(e){return'href="'+Hl(e)+'"'}function du(e){return'link[rel="stylesheet"]['+e+"]"}function Vd(e){return L({},e,{"data-precedence":e.precedence,precedence:null})}function Hp(e,l,t,a){e.querySelector('link[rel="preload"][as="style"]['+l+"]")?a.loading=1:(l=e.createElement("link"),a.preload=l,l.addEventListener("load",function(){return a.loading|=1}),l.addEventListener("error",function(){return a.loading|=2}),fl(l,"link",t),$e(l),e.head.appendChild(l))}function xn(e){return'[src="'+Hl(e)+'"]'}function mu(e){return"script[async]"+e}function Kd(e,l,t){if(l.count++,l.instance===null)switch(l.type){case"style":var a=e.querySelector('style[data-href~="'+Hl(t.href)+'"]');if(a)return l.instance=a,$e(a),a;var n=L({},t,{"data-href":t.href,"data-precedence":t.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),$e(a),fl(a,"style",n),Oi(a,t.precedence,e),l.instance=a;case"stylesheet":n=Sn(t.href);var u=e.querySelector(du(n));if(u)return l.state.loading|=4,l.instance=u,$e(u),u;a=Vd(t),(n=wl.get(n))&&Vs(a,n),u=(e.ownerDocument||e).createElement("link"),$e(u);var c=u;return c._p=new Promise(function(s,m){c.onload=s,c.onerror=m}),fl(u,"link",a),l.state.loading|=4,Oi(u,t.precedence,e),l.instance=u;case"script":return u=xn(t.src),(n=e.querySelector(mu(u)))?(l.instance=n,$e(n),n):(a=t,(n=wl.get(u))&&(a=L({},t),Ks(a,n)),e=e.ownerDocument||e,n=e.createElement("script"),$e(n),fl(n,"link",a),e.head.appendChild(n),l.instance=n);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(a=l.instance,l.state.loading|=4,Oi(a,t.precedence,e));return l.instance}function Oi(e,l,t){for(var a=t.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,u=n,c=0;c title"):null)}function Bp(e,l,t){if(t===1||l.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return e=l.disabled,typeof l.precedence=="string"&&e==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function $d(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Qp(e,l,t,a){if(t.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var n=Sn(a.href),u=l.querySelector(du(n));if(u){l=u._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(e.count++,e=Ci.bind(e),l.then(e,e)),t.state.loading|=4,t.instance=u,$e(u);return}u=l.ownerDocument||l,a=Vd(a),(n=wl.get(n))&&Vs(a,n),u=u.createElement("link"),$e(u);var c=u;c._p=new Promise(function(s,m){c.onload=s,c.onerror=m}),fl(u,"link",a),t.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(t,l),(l=t.state.preload)&&(t.state.loading&3)===0&&(e.count++,t=Ci.bind(e),l.addEventListener("load",t),l.addEventListener("error",t))}}var ks=0;function Yp(e,l){return e.stylesheets&&e.count===0&&Ui(e,e.stylesheets),0ks?50:800)+l);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function Ci(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ui(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var qi=null;function Ui(e,l){e.stylesheets=null,e.unsuspend!==null&&(e.count++,qi=new Map,l.forEach(Gp,e),qi=null,Ci.call(e))}function Gp(e,l){if(!(l.state.loading&4)){var t=qi.get(e);if(t)var a=t.get(null);else{t=new Map,qi.set(e,t);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f)}catch(g){console.error(g)}}return f(),tf.exports=t0(),tf.exports}var n0=a0();/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const u0=f=>f.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Cm=(...f)=>f.filter((g,_,r)=>!!g&&g.trim()!==""&&r.indexOf(g)===_).join(" ").trim();/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var i0={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"};/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const c0=U.forwardRef(({color:f="currentColor",size:g=24,strokeWidth:_=2,absoluteStrokeWidth:r,className:D="",children:R,iconNode:q,...F},H)=>U.createElement("svg",{ref:H,...i0,width:g,height:g,stroke:f,strokeWidth:r?Number(_)*24/Number(g):_,className:Cm("lucide",D),...F},[...q.map(([M,ee])=>U.createElement(M,ee)),...Array.isArray(R)?R:[R]]));/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Le=(f,g)=>{const _=U.forwardRef(({className:r,...D},R)=>U.createElement(c0,{ref:R,iconNode:g,className:Cm(`lucide-${u0(f)}`,r),...D}));return _.displayName=`${f}`,_};/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zi=Le("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const s0=Le("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bm=Le("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"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yf=Le("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qm=Le("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const f0=Le("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cf=Le("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ra=Le("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"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gf=Le("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const r0=Le("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Um=Le("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _m=Le("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"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sf=Le("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const o0=Le("Focus",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const d0=Le("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const m0=Le("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ua=Le("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const h0=Le("Move3d",[["path",{d:"M5 3v16h16",key:"1mqmf9"}],["path",{d:"m5 19 6-6",key:"jh6hbb"}],["path",{d:"m2 6 3-3 3 3",key:"tkyvxa"}],["path",{d:"m18 16 3 3-3 3",key:"1d4glt"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const p0=Le("Rotate3d",[["path",{d:"M16.466 7.5C15.643 4.237 13.952 2 12 2 9.239 2 7 6.477 7 12s2.239 10 5 10c.342 0 .677-.069 1-.2",key:"10n0gc"}],["path",{d:"m15.194 13.707 3.814 1.86-1.86 3.814",key:"16shm9"}],["path",{d:"M19 15.57c-1.804.885-4.274 1.43-7 1.43-5.523 0-10-2.239-10-5s4.477-5 10-5c4.838 0 8.873 1.718 9.8 4",key:"1lxi77"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Rm=Le("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Sm=Le("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ff=Le("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const y0=Le("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Hm(f,g){if(typeof f=="string")return f;if(Array.isArray(f)){const _=f.map(r=>{if(typeof r=="object"&&r!==null){if("msg"in r&&typeof r.msg=="string")return r.msg;if("message"in r&&typeof r.message=="string"){const D="file"in r&&typeof r.file=="string"?r.file:null,R="line"in r&&typeof r.line=="number"?r.line:null,q=D?`${D}${R==null?"":`:${R}`}`:null;return q?`${r.message} · ${q}`:r.message}}return null}).filter(r=>!!r);if(_.length)return _.join(" ")}return g}async function Ki(f){if(!f.ok){const g=await f.json().catch(()=>null);throw new Error(Hm(g==null?void 0:g.detail,`Request failed (${f.status})`))}return f.json()}async function g0(){return Ki(await fetch("/api/bootstrap"))}async function v0(f){const g=new FormData;return g.append("file",f),Ki(await fetch("/api/structure/analyze",{method:"POST",body:g}))}async function b0(f,g,_){const r=new FormData;return r.append("file",f),r.append("sigma_angstrom",String(g)),r.append("seed",String(_)),Ki(await fetch("/api/structure/perturb",{method:"POST",body:r}))}async function _0(f,g,_,r,D){return Ki(await fetch("/api/plan/render",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({setup:f,equilibration:g,sampling_run_count:_,setup_files:r,structure:D})}))}async function S0(f,g,_,r,D,R,q){const F=await fetch("/api/project/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({setup:f,structure:g,project_name:_,preparation:r,equilibration:D,sampling_run_count:R,setup_files:q})});if(!F.ok){const H=await F.json().catch(()=>null);throw new Error(Hm(H==null?void 0:H.detail,`Export failed (${F.status})`))}return F.blob()}const Bm=["Suggested","Problems","Workflow","Scientific setup","Parameters","Inputs","Actions"];function wi(f){return f.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/[^a-z0-9]+/g," ").trim()}function rf(f){return wi(f).split(/\s+/).filter(Boolean)}function x0(f,g){const _=wi(g);if(!_)return f.featured?0:null;const r=wi(f.label),D=wi([f.detail,f.hint,...f.keywords??[]].filter(Boolean).join(" ")),R=rf(f.label),q=rf(`${f.label} ${D}`),F=rf(_);let H=0;r===_?H+=160:r.startsWith(_)?H+=110:r.includes(_)&&(H+=70);for(const M of F){const ee=R.includes(M),L=q.includes(M),te=R.some(se=>se.startsWith(M)),oe=q.some(se=>se.startsWith(M)),Be=M.length>=3&&q.some(se=>se.includes(M));if(ee)H+=48;else if(L)H+=38;else if(te)H+=28;else if(oe)H+=20;else if(Be)H+=10;else return null}return f.current&&(H+=4),f.featured&&(H+=2),H}function j0(f,g){const _=new Map(Bm.map((r,D)=>[r,D]));return f.map((r,D)=>({command:r,index:D,score:x0(r,g)})).filter(r=>r.score!==null).sort((r,D)=>D.score-r.score||(_.get(r.command.group)??99)-(_.get(D.command.group)??99)||r.index-D.index).map(({command:r})=>r)}function z0({open:f,commands:g,onClose:_}){const[r,D]=U.useState(""),[R,q]=U.useState(0),F=U.useRef(null),H=U.useRef(null),M=U.useRef(null),ee=U.useRef(null),L=U.useMemo(()=>j0(g,r),[g,r]),te=U.useMemo(()=>{const x=new Map;return L.forEach((X,W)=>{const G=x.get(X.group)??[];G.push({command:X,index:W}),x.set(X.group,G)}),Bm.flatMap(X=>{const W=x.get(X);return W!=null&&W.length?[{group:X,items:W}]:[]})},[L]),oe=U.useMemo(()=>te.flatMap(({items:x})=>x.map(({command:X})=>X)),[te]),Be=U.useMemo(()=>new Map(oe.map((x,X)=>[x.id,X])),[oe]),se=oe[R]?`command-option-${oe[R].id}`:void 0;if(U.useEffect(()=>{if(!f)return;ee.current=document.activeElement;const x=document.querySelectorAll(".app-header, .workspace");x.forEach(W=>{W.inert=!0});const X=document.body.style.overflow;return document.body.style.overflow="hidden",D(""),q(0),requestAnimationFrame(()=>{var W;return(W=F.current)==null?void 0:W.focus()}),()=>{var W;x.forEach(G=>{G.inert=!1}),document.body.style.overflow=X,(W=ee.current)==null||W.focus()}},[f]),U.useEffect(()=>{q(0)},[r]),U.useEffect(()=>{q(x=>Math.min(x,Math.max(oe.length-1,0)))},[oe.length]),U.useEffect(()=>{var x;(x=M.current)==null||x.scrollIntoView({block:"nearest"})},[r,R]),U.useEffect(()=>{if(!f)return;function x(X){X.key==="Escape"&&_()}return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[_,f]),!f)return null;function we(x){x.disabledReason||(_(),x.run())}function Qe(x){if(x.key!=="Tab"||!H.current)return;const X=Array.from(H.current.querySelectorAll("button:not([disabled]), input:not([disabled])"));if(!X.length)return;const W=X[0],G=X[X.length-1];x.shiftKey&&document.activeElement===W?(x.preventDefault(),G.focus()):!x.shiftKey&&document.activeElement===G&&(x.preventDefault(),W.focus())}return i.jsx("div",{className:"palette-backdrop",onMouseDown:_,children:i.jsxs("section",{ref:H,className:"command-palette",role:"dialog","aria-modal":"true","aria-label":"Search setup",onMouseDown:x=>x.stopPropagation(),onKeyDown:Qe,children:[i.jsxs("div",{className:"palette-search",children:[i.jsx(Rm,{size:19,"aria-hidden":"true"}),i.jsx("input",{ref:F,value:r,onChange:x=>D(x.target.value),onKeyDown:x=>{x.key==="ArrowDown"&&(x.preventDefault(),q(X=>oe.length?(X+1)%oe.length:0)),x.key==="ArrowUp"&&(x.preventDefault(),q(X=>oe.length?(X-1+oe.length)%oe.length:0)),x.key==="Home"&&(x.preventDefault(),q(0)),x.key==="End"&&(x.preventDefault(),q(Math.max(oe.length-1,0))),x.key==="Enter"&&oe[R]&&(x.preventDefault(),we(oe[R]))},placeholder:"Search settings, methods, or actions","aria-label":"Search setup",role:"combobox","aria-expanded":"true","aria-controls":"command-results","aria-activedescendant":se,"aria-autocomplete":"list"}),i.jsx("button",{type:"button",onClick:_,"aria-label":"Close search",children:i.jsx(y0,{size:18})})]}),i.jsx("span",{className:"visually-hidden","aria-live":"polite",children:L.length?`${L.length} result${L.length===1?"":"s"}`:"No results"}),i.jsx("div",{className:"palette-results",id:"command-results",role:"listbox","aria-label":"Search results",children:L.length?te.map(({group:x,items:X})=>i.jsxs("section",{className:"command-group",children:[i.jsx("h2",{children:x}),X.map(({command:W})=>{const G=Be.get(W.id)??0;return i.jsxs("button",{type:"button",role:"option",id:`command-option-${W.id}`,ref:R===G?M:void 0,className:R===G?"selected":"","aria-selected":R===G,"aria-disabled":!!W.disabledReason,onMouseMove:()=>q(G),onClick:()=>we(W),children:[i.jsxs("span",{className:"command-copy",children:[i.jsx("strong",{children:W.label}),(W.disabledReason||W.detail)&&i.jsx("small",{children:W.disabledReason??W.detail})]}),i.jsxs("span",{className:"command-hint",children:[W.current&&i.jsx(yf,{size:15,"aria-label":"Current"}),W.hint,!W.current&&i.jsx(Zi,{size:15,"aria-hidden":"true"})]})]},W.id)})]},x)):i.jsxs("div",{className:"palette-empty",children:[i.jsx("strong",{children:"No matching setting"}),i.jsx("span",{children:"Try temperature, barostat, calculator, eq, or xyz."})]})}),i.jsxs("footer",{children:[i.jsxs("span",{children:[i.jsx("kbd",{children:"↑↓"})," navigate"]}),i.jsxs("span",{children:[i.jsx("kbd",{children:"Enter"})," select"]}),i.jsxs("span",{children:[i.jsx("kbd",{children:"Esc"})," close"]})]})]})})}function Qm({formula:f,fallback:g="—"}){return f?i.jsx("span",{className:"chemical-formula","aria-label":f,children:f.split(/(\d+)/).map((_,r)=>/^\d+$/.test(_)?i.jsx("sub",{"aria-hidden":"true",children:_},`${_}-${r}`):i.jsx("span",{"aria-hidden":"true",children:_},`${_}-${r}`))}):i.jsx(i.Fragment,{children:g})}const Sf=[{value:"berendsen",label:"Berendsen",description:"Fast equilibration; does not sample the canonical ensemble."},{value:"velocity_rescaling",label:"Stochastic velocity rescaling",description:"Canonical temperature sampling with stochastic rescaling."},{value:"langevin",label:"Langevin",description:"Stochastic coupling through friction and random forces."},{value:"nh-chain",label:"Nosé–Hoover chain",description:"Deterministic canonical sampling with an extended chain."}],xf=[{value:"berendsen",label:"Berendsen",description:"Weak pressure coupling for equilibration."},{value:"stochastic_rescaling",label:"Stochastic cell rescaling",description:"Stochastic pressure coupling through cell rescaling."}],N0=[{value:"isotropic",label:"Isotropic"},{value:"xy",label:"Semi-isotropic · xy"},{value:"xz",label:"Semi-isotropic · xz"},{value:"yz",label:"Semi-isotropic · yz"},{value:"anisotropic",label:"Anisotropic"},{value:"full_anisotropic",label:"Fully anisotropic"}];function xm(f){return f.startsWith("structure.")||f.startsWith("cell.")?"system":f.startsWith("method.")||f.startsWith("mm.")||f.startsWith("qm.")||f.startsWith("runner.")||f.startsWith("calculator.")||f.startsWith("pq.")||f.startsWith("environment.pq")?"method":"conditions"}const vf=[{value:"off",label:"GUFF",description:"Nonbonded interactions from a GUFF table."},{value:"bonded",label:"Bonded + GUFF",description:"Bonded terms from topology and parameters; GUFF nonbonded terms."},{value:"on",label:"Classical force field",description:"All interactions from topology and parameter files."}];function jm(f){const g=f.filter(r=>r.supported),_=g.filter(r=>r.available_in_pq!==!1);return _.find(r=>r.id==="ase_xtb"&&r.ready)??_.find(r=>r.ready)??_.find(r=>r.id==="ase_xtb")??_[0]??g.find(r=>r.id==="ase_xtb")??g[0]}const Vi={moldescriptor:{role:"moldescriptor",label:"Molecule descriptor",defaultName:"moldescriptor.dat"},guff:{role:"guff",label:"GUFF table",defaultName:"guff.dat"},topology:{role:"topology",label:"Topology",defaultName:"topology.dat"},parameter:{role:"parameter",label:"Parameters",defaultName:"parameter.dat"},intra_nonbonded:{role:"intra_nonbonded",label:"Intramolecular nonbonded",defaultName:"intra-nonbonded.dat"},dftb_template:{role:"dftb_template",label:"DFTB+ template",defaultName:"dftb_in.template"},turbomole_define_template:{role:"turbomole_define_template",label:"Turbomole define template",defaultName:"tm_define.template"}},E0={programs:{dftbplus:{recommended_script:"dftbplus_periodic_stress",scripts:[{name:"dftbplus_periodic_stress",label:"DFTB+ periodic stress",required_file_keywords:["dftb_file"],required_working_files:[]}]},pyscf:{recommended_script:null,scripts:[{name:"pyscf_hf.py",label:"UHF / STO-3G",required_file_keywords:[],required_working_files:[]},{name:"pyscf_mp2.py",label:"UMP2 / 6-311++G**",required_file_keywords:[],required_working_files:[]}]},turbomole:{recommended_script:"turbomole_rimp2",scripts:[{name:"turbomole_rimp2",label:"RI-MP2",required_file_keywords:[],required_working_files:["tm_define.template"]}]}}},T0={dftb_file:"dftb_template"},M0={"tm_define.template":"turbomole_define_template"},A0={turbomole_define_template:"tm_define.template"};function O0(f){var g;return((g=vf.find(_=>_.value===f))==null?void 0:g.label)??"GUFF"}function D0(f){return[...(f==="off"?["moldescriptor","guff"]:f==="bonded"?["moldescriptor","guff","topology","parameter"]:["moldescriptor","topology","parameter"]).map(_=>({...Vi[_],optional:!1})),...f==="off"?[]:[{...Vi.intra_nonbonded,optional:!0}]]}function of(f,g,_=null,r=null){const D=new Set;g==="NPT"&&D.add("moldescriptor");const R=Ym(r,f,_);return R==null||R.required_file_keywords.forEach(q=>{const F=T0[q];F&&D.add(F)}),R==null||R.required_working_files.forEach(q=>{const F=M0[q];F&&D.add(F)}),[...D].map(q=>({...Vi[q],optional:!1}))}function xu(f,g){return g?(f??E0).programs[g]??null:null}function zm(f,g){var _;return((_=xu(f,g))==null?void 0:_.scripts)??[]}function Nm(f,g){var _;return((_=xu(f,g))==null?void 0:_.recommended_script)??null}function Ym(f,g,_){const r=xu(f,g),D=_??(r==null?void 0:r.recommended_script);return(r==null?void 0:r.scripts.find(R=>R.name===D))??null}function C0(f,g){const _=new Set(f.map(r=>r.role));return g.filter(r=>_.has(r.role))}function q0(f,g){const _=new Set(g.filter(r=>r.name.trim()&&r.content.length>0).map(r=>r.role));return f.filter(r=>!r.optional&&!_.has(r.role)).map(r=>r.role)}function ot(f){return Vi[f].defaultName}function U0(f,g){return A0[f]??g}const bf=1,Su=999,jf=2,Gm=3;function Nn(f){return Number.isFinite(f)?Math.min(Su,Math.max(bf,Math.trunc(f))):bf}function R0(f){if(!/^\d+$/.test(f))return null;const g=Number(f);return gSu?null:g}function H0(f){const g=R0(f);return g===null||gR.name===f)?f:r}function X0(f,g){const _=Nn(f),r=_===1?"file":"files";if(g)return`${_} sampling ${r} · from eq`;if(_===1)return"1 sampling file";const D=_===2?"02 continued":`02–${ju(_)} continued`;return`${_} sampling files · ${D}`}function Z0(f,g){const _=Nn(g),r=f?["run-eq.in"]:[],D=_<=4?Array.from({length:_},(R,q)=>q+1):[1,2];return r.push(...D.map(R=>`run-${ju(R)}.in`)),_>4&&r.push("…",`run-${ju(_)}.in`),r}function w0(f){return/^[A-Za-z0-9_@%+=:,./-]+$/.test(f)?f:`'${f.replaceAll("'",`'"'"'`)}'`}function V0(f){return f!=null&&f.found&&f.executable?{command:`./run.sh ${w0(f.executable)}`,detail:`Detected ${f.version??"PQ"}`}:{command:"./run.sh /path/to/PQ",detail:"PQ not detected · replace the path below"}}const K0={H:"#f7f7f4",C:"#4b5560",N:"#315fbc",O:"#d94a42",F:"#55a65c",P:"#de8d31",S:"#d7b52f",Cl:"#4c9a59",Zn:"#6d79a8"},df={H:.31,C:.76,N:.71,O:.66,F:.57,P:1.07,S:1.05,Cl:1.02,Zn:1.22};function k0(f,g,_){const[r,D,R]=f,q=Math.cos(_),F=Math.sin(_),H=r*q+R*F,M=-r*F+R*q,ee=Math.cos(g),L=Math.sin(g);return[H,D*ee-M*L,D*L+M*ee]}function J0(f,g){return Math.hypot(f.position[0]-g.position[0],f.position[1]-g.position[1],f.position[2]-g.position[2])}function $0(f){const[g,_,r]=f,D=[];for(const R of[-.5,.5])for(const q of[-.5,.5])for(const F of[-.5,.5])D.push([R*g[0]+q*_[0]+F*r[0],R*g[1]+q*_[1]+F*r[1],R*g[2]+q*_[2]+F*r[2]]);return D}const W0=[[0,1],[0,2],[0,4],[1,3],[1,5],[2,3],[2,6],[3,7],[4,5],[4,6],[5,7],[6,7]];function F0({analysis:f,example:g,generatedCellTreatment:_,densityGcm3:r}){const[D,R]=U.useState([-.42,.58]),[q,F]=U.useState(1),[H,M]=U.useState(!1),ee=U.useRef(null),L=U.useRef(null);U.useEffect(()=>{const G=ee.current;if(!G)return;function V(k){k.preventDefault(),F(P=>Math.min(2.5,Math.max(.45,P*(k.deltaY>0?.9:1.1))))}return G.addEventListener("wheel",V,{passive:!1}),()=>G.removeEventListener("wheel",V)},[]),U.useEffect(()=>{M(!1)},[f.structure,_]);const te=f.structure.cell_generated,oe=!!(f.structure.cell&&(!te||H)),Be=f.structure.cell_padding_angstrom??6,se=U.useMemo(()=>{const G=f.structure.atoms,V=Math.max(1,Math.ceil(G.length/1200)),k=G.map((d,j)=>({atom:d,index:j})).filter((d,j)=>j%V===0),P=k.map(({atom:d})=>d.position),al=oe&&f.structure.cell?$0(f.structure.cell):[],yl=oe&&f.structure.cell?[0,0,0]:P.length?[0,1,2].map(d=>{const j=P.map(B=>B[d]);return(Math.min(...j)+Math.max(...j))/2}):[0,0,0],ke=P.map(d=>d.map((j,B)=>j-yl[B])),C=al.map(d=>d.map((j,B)=>j-yl[B])),ql=[...ke,...C],Je=155/Math.max(1,...ql.map(d=>Math.hypot(d[0],d[1],d[2])))*q,N=d=>{const j=k0(d,D[0],D[1]);return{x:300+j[0]*Je,y:205-j[1]*Je,z:j[2]}},Y=k.map(({atom:d,index:j},B)=>({atom:d,index:j,...N(ke[B])})).sort((d,j)=>d.z-j.z),$=C.map(N),pe=[];if(G.length<=280)for(let d=0;d.2&&Z<=B&&pe.push({left:d,right:j})}const ye=new Map(Y.map(d=>[d.index,d]));return{atoms:Y,bonds:pe,positionMap:ye,cell:$,sampled:V>1}},[f,oe,D,q]),we=U.useMemo(()=>new Set(f.collisions.flatMap(G=>[G.atom_i,G.atom_j])),[f.collisions]);function Qe(G){const V={free:[-.42,.58],xy:[0,0],xz:[Math.PI/2,0],yz:[0,Math.PI/2]};R(V[G]),F(1)}function x(G){G.currentTarget.setPointerCapture(G.pointerId),L.current={x:G.clientX,y:G.clientY,rx:D[0],ry:D[1]}}function X(G){L.current&&R([L.current.rx+(G.clientY-L.current.y)*.008,L.current.ry+(G.clientX-L.current.x)*.008])}function W(G){G.currentTarget.hasPointerCapture(G.pointerId)&&G.currentTarget.releasePointerCapture(G.pointerId),L.current=null}return i.jsxs("section",{className:"viewer","aria-labelledby":"viewer-title",children:[i.jsxs("div",{className:"viewer-heading",children:[i.jsxs("div",{children:[i.jsx("div",{className:"eyebrow",children:g?"Example":f.structure.source_format??"Structure"}),i.jsx("h2",{id:"viewer-title",children:f.structure.source_name??"Untitled structure"})]}),i.jsxs("div",{className:"viewer-count",children:[f.summary.atom_count.toLocaleString()," atoms"]})]}),i.jsxs("div",{className:"viewer-stage",children:[i.jsxs("svg",{ref:ee,viewBox:"0 0 600 420",role:"img","aria-label":`Interactive view of ${f.summary.formula||"the structure"}${te?`. Generated cell ${H?"shown":"hidden"}`:""}`,onPointerDown:x,onPointerMove:X,onPointerUp:W,onPointerCancel:W,children:[i.jsx("rect",{width:"600",height:"420",className:"viewer-background"}),se.cell.length===8&&W0.map(([G,V])=>i.jsx("line",{x1:se.cell[G].x,y1:se.cell[G].y,x2:se.cell[V].x,y2:se.cell[V].y,className:`cell-edge ${te?"generated-cell-edge":""}`},`cell-${G}-${V}`)),se.bonds.map(({left:G,right:V})=>{const k=se.positionMap.get(G),P=se.positionMap.get(V);return!k||!P?null:i.jsx("line",{x1:k.x,y1:k.y,x2:P.x,y2:P.y,className:"bond"},`bond-${G}-${V}`)}),f.collisions.map(G=>{const V=se.positionMap.get(G.atom_i),k=se.positionMap.get(G.atom_j);return!V||!k?null:i.jsx("line",{x1:V.x,y1:V.y,x2:k.x,y2:k.y,className:"collision-link"},`collision-${G.atom_i}-${G.atom_j}`)}),se.atoms.map(({atom:G,index:V,x:k,y:P,z:al})=>{const yl=Math.max(.72,Math.min(1.22,1+al*.012)),ke=Math.max(8,Math.min(18,(df[G.symbol]??.8)*14))*yl;return i.jsxs("g",{children:[we.has(V)&&i.jsx("circle",{cx:k,cy:P,r:ke+5,className:"collision-halo"}),i.jsx("circle",{cx:k,cy:P,r:ke,fill:K0[G.symbol]??"#8c6db0",className:`atom ${G.symbol==="H"?"atom-light":""}`})]},`atom-${V}`)}),i.jsxs("g",{className:"axis",transform:"translate(42 368)",children:[i.jsx("line",{x1:"0",y1:"0",x2:"28",y2:"0",className:"axis-x"}),i.jsx("line",{x1:"0",y1:"0",x2:"0",y2:"-28",className:"axis-y"}),i.jsx("line",{x1:"0",y1:"0",x2:"16",y2:"16",className:"axis-z"}),i.jsx("text",{x:"33",y:"4",children:"x"}),i.jsx("text",{x:"-4",y:"-34",children:"y"}),i.jsx("text",{x:"19",y:"25",children:"z"})]})]}),i.jsxs("div",{className:"viewer-help",children:[i.jsx(h0,{size:14,"aria-hidden":"true"}),"Drag to rotate · Scroll to zoom"]}),se.sampled&&i.jsx("div",{className:"sample-label",children:"Preview sampled for speed"}),te&&H&&i.jsx("div",{className:"generated-cell-label",children:"Generated preview box"})]}),i.jsxs("div",{className:"view-controls","aria-label":"View orientation",children:[i.jsxs("button",{type:"button",onClick:()=>Qe("free"),children:[i.jsx(p0,{size:15,"aria-hidden":"true"}),"3D"]}),i.jsx("button",{type:"button",onClick:()=>Qe("xy"),children:"XY"}),i.jsx("button",{type:"button",onClick:()=>Qe("xz"),children:"XZ"}),i.jsx("button",{type:"button",onClick:()=>Qe("yz"),children:"YZ"}),i.jsxs("button",{type:"button",className:"fit-view",onClick:()=>{F(1),R(G=>[...G])},children:[i.jsx(o0,{size:15,"aria-hidden":"true"}),"Fit"]})]}),te&&i.jsxs("div",{className:"generated-cell-note",children:[i.jsxs("span",{children:[i.jsx("strong",{children:"No periodic cell in source"}),i.jsx("small",{children:_==="density"?r?`PQ derives the run cell from ${r} g cm⁻³. The optional box is a ${Be} Å preview envelope.`:`PQ derives the run cell from density. The optional box is a ${Be} Å preview envelope.`:`PQSetup adds a centered run cell with ${Be} Å padding. The uploaded file is unchanged.`})]}),i.jsxs("button",{type:"button","aria-pressed":H,onClick:()=>M(G=>!G),children:[i.jsx(bm,{size:14,"aria-hidden":"true"}),H?"Hide box":"Show box"]})]}),i.jsxs("dl",{className:"structure-facts",children:[i.jsxs("div",{children:[i.jsx("dt",{children:"Formula"}),i.jsx("dd",{children:i.jsx(Qm,{formula:f.summary.formula})})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Cell"}),i.jsx("dd",{children:f.structure.cell?i.jsxs(i.Fragment,{children:[i.jsx(bm,{size:14,"aria-hidden":"true"}),te?_==="density"?"Density-derived":"Generated":"Imported"]}):"None"})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Min. distance"}),i.jsx("dd",{children:f.summary.minimum_distance_angstrom==null?"—":`${f.summary.minimum_distance_angstrom.toFixed(3)} Å`})]})]})]})}const Tm="https://molarverse.github.io/PQSetup/",Il=[{id:"system",label:"System",hint:"Structure"},{id:"method",label:"Method",hint:"Interaction"},{id:"conditions",label:"Conditions",hint:"Run plan"},{id:"prepare",label:"Prepare",hint:"Coordinates"},{id:"review",label:"Review",hint:"Inputs"}],Mm={structure:{atoms:[{symbol:"O",position:[0,0,0],molecule_type:0,velocity:null,force:null},{symbol:"H",position:[.9572,0,0],molecule_type:0,velocity:null,force:null},{symbol:"H",position:[-.239987,.927297,0],molecule_type:0,velocity:null,force:null}],cell:[[12,0,0],[0,12,0],[0,0,12]],periodic:[!0,!0,!0],source_name:"water-example.rst",source_format:"pq-restart",wrapped_centered:!0,cell_generated:!1,cell_padding_angstrom:null},summary:{atom_count:3,formula:"H2O",volume_angstrom3:1728,density_g_cm3:.0173,minimum_distance_angstrom:.9572},diagnostics:[],collisions:[],collisions_truncated:!1,valid:!0},I0={preset_id:"ambient-nvt",job_type:"qm-md",ensemble:"NVT",start_file:"water-example.rst",restart_file:null,file_prefix:"water-nvt",timestep_fs:.5,steps:1e3,temperature_k:298.15,start_temperature_k:null,temperature_ramp_steps:null,temperature_ramp_frequency:1,pressure_bar:null,thermostat:"velocity_rescaling",thermostat_relaxation_ps:.1,thermostat_friction_ps_inverse:.1,nh_chain_length:3,coupling_frequency_cm_inverse:1e3,manostat:null,manostat_relaxation_ps:1,compressibility_bar_inverse:4591e-8,pressure_isotropy:"isotropic",initialize_velocities:!0,random_seed:238917,runner:"ase_xtb",runner_script:null,mm_force_field:"off",density_g_cm3:null,coulomb_cutoff_angstrom:12.5,moldescriptor_file:null,guff_file:null,topology_file:null,parameter_file:null,intra_nonbonded_file:null,dftb_template_file:null,turbomole_define_template_file:null,overwrite_output:!1,extra_settings:{}},mf={enabled:!0,steps:5e3,timestep_fs:.5,temperature_k:298.15,start_temperature_k:null,temperature_ramp_steps:null,temperature_ramp_frequency:1,thermostat:"berendsen",thermostat_relaxation_ps:.1,thermostat_friction_ps_inverse:.1,nh_chain_length:3,coupling_frequency_cm_inverse:1e3};function hf(f){return f.job_type==="mm-md"||f.job_type==="mm-opt"}function Am(f,g){return{...f,mm_force_field:g,moldescriptor_file:f.moldescriptor_file??ot("moldescriptor"),guff_file:g==="off"||g==="bonded"?f.guff_file??ot("guff"):f.guff_file,topology_file:g==="on"||g==="bonded"?f.topology_file??ot("topology"):f.topology_file,parameter_file:g==="on"||g==="bonded"?f.parameter_file??ot("parameter"):f.parameter_file}}function P0(f,g,_){return g==="moldescriptor"?{...f,moldescriptor_file:_}:g==="guff"?{...f,guff_file:_}:g==="topology"?{...f,topology_file:_}:g==="parameter"?{...f,parameter_file:_}:g==="intra_nonbonded"?{...f,intra_nonbonded_file:_}:g==="dftb_template"?{...f,dftb_template_file:_}:{...f,turbomole_define_template_file:_}}function zn(f){return f instanceof Error?f.message:"Something went wrong."}function pf(f,g){if(!f||!g)return"Duration incomplete";const _=f*g;return _>=1e3?`${(_/1e3).toLocaleString(void 0,{maximumFractionDigits:3})} ps`:`${_.toLocaleString()} fs`}function Lm(f){var g;return((g=Sf.find(_=>_.value===f))==null?void 0:g.description)??"Choose how temperature is coupled."}function ey(f){var g;return((g=xf.find(_=>_.value===f))==null?void 0:g.description)??"Choose how pressure is coupled."}function Ue({label:f,unit:g,help:_,info:r,controlId:D,children:R}){const q=U.useId(),F=D??q,H=U.useId();return i.jsxs("div",{className:"field",children:[i.jsxs("span",{className:"field-label",children:[i.jsx("label",{htmlFor:F,children:f}),i.jsxs("span",{className:"field-label-tools",children:[g&&i.jsx("span",{className:"unit",children:g}),r&&i.jsxs("button",{type:"button",className:"info-affordance","aria-label":r,"aria-describedby":H,children:[i.jsx(Um,{size:14,"aria-hidden":"true"}),i.jsx("span",{className:"info-tooltip",id:H,role:"tooltip",children:r})]})]})]}),U.cloneElement(R,{id:F}),_&&i.jsx("span",{className:"field-help",children:_})]})}function Om({value:f,onChange:g,controlId:_}){return i.jsxs("section",{className:"coupling-section","aria-label":"Temperature coupling",children:[i.jsxs("div",{className:"section-rule-heading",children:[i.jsx("strong",{children:"Temperature coupling"}),i.jsx("span",{children:"Thermostat"})]}),i.jsxs("div",{className:"form-grid coupling-grid",children:[i.jsx(Ue,{label:"Thermostat",controlId:_,children:i.jsx("select",{value:f.thermostat??"velocity_rescaling",onChange:r=>g({thermostat:r.target.value}),children:Sf.map(r=>i.jsx("option",{value:r.value,children:r.label},r.value))})}),(f.thermostat==="berendsen"||f.thermostat==="velocity_rescaling")&&i.jsx(Ue,{label:"Relaxation time",unit:"ps",help:"PQ default: 0.1 ps.",children:i.jsx("input",{type:"number",min:"0.000001",step:"0.01",value:f.thermostat_relaxation_ps??"",onChange:r=>g({thermostat_relaxation_ps:r.target.value?Number(r.target.value):null})})}),f.thermostat==="langevin"&&i.jsx(Ue,{label:"Friction",unit:"ps⁻¹",help:"PQ default: 0.1 ps⁻¹.",children:i.jsx("input",{type:"number",min:"0",step:"0.01",value:f.thermostat_friction_ps_inverse,onChange:r=>g({thermostat_friction_ps_inverse:Number(r.target.value)})})}),f.thermostat==="nh-chain"&&i.jsxs(i.Fragment,{children:[i.jsx(Ue,{label:"Chain length",help:"PQ default: 3.",children:i.jsx("input",{type:"number",min:"1",step:"1",value:f.nh_chain_length,onChange:r=>g({nh_chain_length:Number(r.target.value)})})}),i.jsx(Ue,{label:"Coupling frequency",unit:"cm⁻¹",help:"PQ default: 1000 cm⁻¹.",children:i.jsx("input",{type:"number",min:"0",step:"1",value:f.coupling_frequency_cm_inverse,onChange:r=>g({coupling_frequency_cm_inverse:Number(r.target.value)})})})]})]}),i.jsx("p",{className:"coupling-description",children:Lm(f.thermostat)})]})}function Dm({value:f,onChange:g}){return i.jsxs("details",{className:"schedule-settings",children:[i.jsxs("summary",{children:[i.jsxs("span",{children:[i.jsx("strong",{children:"Temperature schedule"}),i.jsx("small",{children:f.start_temperature_k==null?"Constant target temperature":`${f.start_temperature_k} K → target`})]}),i.jsx(qm,{size:16,"aria-hidden":"true"})]}),i.jsxs("div",{className:"form-grid schedule-grid",children:[i.jsx(Ue,{label:"Start temperature",unit:"K",help:"Leave blank to start at the target temperature.",children:i.jsx("input",{type:"number",min:"0",step:"0.01",value:f.start_temperature_k??"",onChange:_=>g({start_temperature_k:_.target.value?Number(_.target.value):null})})}),i.jsx(Ue,{label:"Ramp steps",help:"0 uses the full stage.",children:i.jsx("input",{type:"number",min:"0",step:"1",value:f.temperature_ramp_steps??"",onChange:_=>g({temperature_ramp_steps:_.target.value?Number(_.target.value):null})})}),i.jsx(Ue,{label:"Ramp frequency",unit:"steps",children:i.jsx("input",{type:"number",min:"1",step:"1",value:f.temperature_ramp_frequency,onChange:_=>g({temperature_ramp_frequency:Number(_.target.value)})})})]})]})}function ly({value:f,onChange:g,controlId:_}){return i.jsxs("section",{className:"coupling-section","aria-label":"Pressure coupling",children:[i.jsxs("div",{className:"section-rule-heading",children:[i.jsx("strong",{children:"Pressure coupling"}),i.jsx("span",{children:"Manostat"})]}),i.jsxs("div",{className:"form-grid coupling-grid pressure-grid",children:[i.jsx(Ue,{label:"Manostat",controlId:_,info:"PQ calls this a manostat. It is essentially a barostat: the pressure-coupling method that adjusts the simulation cell.",children:i.jsx("select",{value:f.manostat??"stochastic_rescaling",onChange:r=>g({manostat:r.target.value}),children:xf.map(r=>i.jsx("option",{value:r.value,children:r.label},r.value))})}),i.jsx(Ue,{label:"Relaxation time",unit:"ps",help:"PQ default: 1 ps.",children:i.jsx("input",{type:"number",min:"0.000001",step:"0.01",value:f.manostat_relaxation_ps??"",onChange:r=>g({manostat_relaxation_ps:r.target.value?Number(r.target.value):null})})}),i.jsx(Ue,{label:"Compressibility",unit:"bar⁻¹",help:"PQ water default: 4.591 × 10⁻⁵ bar⁻¹; adjust for the material.",children:i.jsx("input",{type:"number",min:"0",step:"0.000001",value:f.compressibility_bar_inverse,onChange:r=>g({compressibility_bar_inverse:Number(r.target.value)})})}),i.jsx(Ue,{label:"Cell response",help:"PQ default: isotropic.",children:i.jsx("select",{value:f.pressure_isotropy,onChange:r=>g({pressure_isotropy:r.target.value}),children:N0.map(r=>i.jsx("option",{value:r.value,children:r.label},r.value))})})]}),i.jsx("p",{className:"coupling-description",children:ey(f.manostat)})]})}function _u({eyebrow:f,title:g,description:_}){return i.jsxs("header",{className:"step-heading",children:[i.jsx("span",{className:"eyebrow",children:f}),i.jsx("h1",{children:g}),i.jsx("p",{children:_})]})}function Xi({status:f}){return f==="ok"?i.jsx(gf,{"aria-hidden":"true"}):f==="warn"?i.jsx(Ra,{"aria-hidden":"true"}):i.jsx(r0,{"aria-hidden":"true"})}function ty(){var gt,Du;const[f,g]=U.useState(null),[_,r]=U.useState(null),[D,R]=U.useState("system"),[q,F]=U.useState(Mm),[H,M]=U.useState(Mm),[ee,L]=U.useState(!0),[te,oe]=U.useState(null),[Be,se]=U.useState("water-example.rst"),[we,Qe]=U.useState(null),[x,X]=U.useState(I0),[W,G]=U.useState([]),[V,k]=U.useState(null),[P,al]=U.useState(1),[yl,ke]=U.useState("1"),[C,ql]=U.useState(null),[jl,Je]=U.useState(null),[N,Y]=U.useState(!1),[$,pe]=U.useState(!1),[ye,d]=U.useState(!1),[j,B]=U.useState(!1),[Z,le]=U.useState(!1),[ue,ge]=U.useState(.01),[el,qe]=U.useState(!1),dt=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform)?"⌘ K":"Ctrl K",da=dt.startsWith("⌘")?"⌘ Enter":"Ctrl Enter",[Rt,De]=U.useState(null),Pl=U.useId(),Ha=U.useRef(null),Ba=U.useRef(null),zu=U.useRef({}),En=U.useRef(null),Ht=U.useRef(0),Bt=U.useRef(0),et=U.useRef(0),Nu=U.useRef(null),Qa=U.useRef(Gm),ce=hf(x),ml=(f==null?void 0:f.pq.external_qm)??null,Qt=U.useMemo(()=>zm(ml,x.runner),[ml,x.runner]),Yt=U.useMemo(()=>xu(ml,x.runner),[ml,x.runner]),lt=U.useMemo(()=>Ym(ml,x.runner,x.runner_script),[ml,x.runner,x.runner_script]),mt=U.useMemo(()=>ce?D0(x.mm_force_field):of(x.runner,x.ensemble,x.runner_script,ml),[ml,ce,x.ensemble,x.mm_force_field,x.runner,x.runner_script]),ht=U.useMemo(()=>C0(mt,W),[mt,W]),Eu=U.useMemo(()=>ht.map(({role:o,name:y,content:Q})=>({role:o,name:y,content:o==="moldescriptor"?Q:null})),[ht]);U.useEffect(()=>{var o;(o=En.current)==null||o.scrollTo({top:0,left:0})},[D]),U.useEffect(()=>{function o(){window.matchMedia("(max-width: 720px)").matches&&window.requestAnimationFrame(()=>{const y=Ba.current,Q=zu.current[D];if(!y||!Q)return;const xe=Q.offsetLeft+Q.offsetWidth/2-y.clientWidth/2;y.scrollTo({left:Math.max(0,xe),behavior:"smooth"})})}return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[D]),U.useEffect(()=>{let o=!0;return g0().then(y=>{if(!o)return;g(y);const Q=jm(y.runners);Q&&X(xe=>{const ze=y.runners.find(T=>T.id===xe.runner);return hf(xe)||xe.runner&&(ze==null?void 0:ze.available_in_pq)!==!1?xe:{...xe,runner:Q.id,runner_script:Nm(y.pq.external_qm,Q.id)}})}).catch(y=>{o&&r(zn(y))}),()=>{o=!1}},[]),U.useEffect(()=>{const o=++Ht.current;Y(!0);const y=window.setTimeout(()=>{_0(x,V,P,Eu,q.structure).then(Q=>{var ze;if(o!==Ht.current)return;const xe=Nu.current;Nu.current=((ze=Q.files[0])==null?void 0:ze.name)??null,ql(Q),Je(T=>L0(T,xe,Q.files))}).catch(Q=>{o===Ht.current&&ql({files:[],valid:!1,diagnostics:[{code:"api.render",severity:"error",message:zn(Q),atom_indices:[]}]})}).finally(()=>{o===Ht.current&&Y(!1)})},120);return()=>window.clearTimeout(y)},[q.structure,V,P,x,Eu]);const hl=U.useMemo(()=>(f==null?void 0:f.runners.find(o=>o.id===x.runner))??null,[f,x.runner]),Se=U.useMemo(()=>(C==null?void 0:C.files.find(o=>o.name===jl))??(C==null?void 0:C.files[0])??null,[C,jl]),Ge=(C==null?void 0:C.files.findIndex(o=>o.name===(Se==null?void 0:Se.name)))??-1,Vl=U.useMemo(()=>(C==null?void 0:C.files.filter(o=>o.stage_id==="equilibration"))??[],[C]),rl=U.useMemo(()=>(C==null?void 0:C.files.filter(o=>o.stage_id==="sampling"))??[],[C]),Tn=(hl==null?void 0:hl.label)??x.runner??"Not selected",ma=ce?`Molecular mechanics · ${O0(x.mm_force_field)}`:lt?`${Tn} · ${lt.label}`:Tn,tt=U.useMemo(()=>q0(mt,ht),[mt,ht]),Gt=q.structure.atoms.some(o=>o.molecule_type>0),ha=!q.structure.cell_generated||!!(x.density_g_cm3&&x.density_g_cm3>0),at=!!(!ce&&f&&x.runner&&!(hl!=null&&hl.ready)),zl=!ce&&(hl==null?void 0:hl.available_in_pq)===!1,Ya=!!(f!=null&&f.pq.validation_scopes.includes("portable")),Ul=ce?Gt&&ha&&tt.length===0:!!x.runner&&(!Yt||!!lt)&&tt.length===0,Tu=x.steps==null?null:x.steps*P,nl=Y0(P),Ga=U.useMemo(()=>Z0(!!V,P),[V,P]),pt=!ce&&q.structure.cell_generated&&x.ensemble==="NPT",pa=U.useMemo(()=>[...q.diagnostics,...(C==null?void 0:C.diagnostics)??[],...pt?[{code:"conditions.generated_cell_npt",severity:"error",message:"NPT needs a physical periodic cell, not a generated vacuum cell.",atom_indices:[]}]:[]],[q.diagnostics,pt,C==null?void 0:C.diagnostics]),ya=U.useMemo(()=>pa.filter(o=>o.code!=="structure.cell_generated"),[pa]),Mn=pa.filter(o=>o.severity==="error").length,Nl=!!(q.valid&&!pt&&(C!=null&&C.valid)&&Ul&&Mn===0),La=U.useMemo(()=>({system:q.valid?"ok":"warn",method:!Ul||at||zl?"warn":"ok",conditions:pa.some(o=>o.severity==="error"&&(o.code.startsWith("conditions.")||o.code.startsWith("run.")||o.code.startsWith("plan.")))?"warn":C?"ok":"idle",prepare:q.collisions.length?"warn":"ok",review:Nl?"ok":C?"warn":"idle"}),[q,at,pa,Ul,zl,Nl,C]),ga=U.useCallback(()=>{var o;return(o=Ha.current)==null?void 0:o.click()},[]),yt=U.useCallback(async()=>{if(!Nl||j){R("review");return}B(!0),De(null);try{const o=await S0(x,q.structure,x.file_prefix,we,V,P,ht),y=URL.createObjectURL(o),Q=document.createElement("a");Q.href=y,Q.download=`${x.file_prefix}.zip`,Q.click(),URL.revokeObjectURL(y),De({kind:"success",message:`${x.file_prefix}.zip is ready.`})}catch(o){De({kind:"error",message:zn(o)})}finally{B(!1)}},[q.structure,V,j,ht,we,Nl,P,x]),Mu=U.useMemo(()=>{var ze;const o=Il.findIndex(T=>T.id===D),y=oT.severity!=="info").filter(T=>{const Te=`${T.code}:${T.message}`;return Q.has(Te)?!1:(Q.add(Te),!0)}).map((T,Te)=>({id:`problem-${T.code}-${Te}`,group:"Problems",label:T.severity==="error"?"Fix input error":"Review warning",detail:T.message,keywords:[T.code,T.message,"preflight","diagnostic"],featured:Te<2,run:()=>je(xm(T.code))}));return[...y?[{id:"continue",group:"Suggested",label:`Continue to ${y.label}`,detail:y.hint,keywords:["next","continue","workflow"],featured:!0,run:()=>je(y.id)}]:[],...xe,...Il.map((T,Te)=>({id:`step-${T.id}`,group:"Workflow",label:T.label,detail:T.hint,hint:`Alt ${Te+1}`,keywords:["go","open",T.id==="system"?"structure atoms cell":"",T.id==="method"?"calculator engine force field":"",T.id==="conditions"?"protocol ensemble sampling thermostat manostat":"",T.id==="prepare"?"coordinates jitter perturb symmetry":"",T.id==="review"?"inputs files preview package":""],current:D===T.id,run:()=>je(T.id)})),{id:"model-qm",group:"Scientific setup",label:"Use quantum mechanics",detail:"External electronic-structure calculator",keywords:["qm","quantum","electronic structure","calculator"],current:!ce,run:()=>{Za("qm"),je("method"),De({kind:"success",message:"Quantum mechanics selected."})}},{id:"model-mm",group:"Scientific setup",label:"Use molecular mechanics",detail:"GUFF or classical force field",keywords:["mm","molecular mechanics","force field","classical"],current:ce,run:()=>{Za("mm"),je("method"),De({kind:"success",message:"Molecular mechanics selected."})}},...((f==null?void 0:f.runners)??[]).filter(T=>T.supported).map(T=>({id:`calculator-${T.id}`,group:"Scientific setup",label:T.label,detail:T.available_in_pq===!1?"Selected PQ build does not include this method. Inputs can still be created.":T.ready?"Calculator ready":`${T.detail} Inputs can still be created.`,keywords:["calculator","runner","engine",T.id,T.label],current:!ce&&x.runner===T.id,run:()=>{Xa(T.id),je("method"),De({kind:T.ready&&T.available_in_pq!==!1?"success":"info",message:T.available_in_pq===!1?`${T.label} selected. Use a PQ build that includes it when running.`:T.ready?`${T.label} selected.`:`${T.label} selected but was not detected.`})}})),...Qt.map(T=>({id:`electronic-method-${T.name}`,group:"Scientific setup",label:T.label,detail:`${(hl==null?void 0:hl.label)??x.runner} electronic method`,keywords:["electronic method","basis","pyscf",T.name,T.label],current:x.runner_script===T.name,run:()=>{Au(T.name),je("method"),De({kind:"success",message:`${T.label} selected.`})}})),...vf.map(T=>({id:`mm-mode-${T.value}`,group:"Scientific setup",label:T.label,detail:T.description,keywords:["molecular mechanics","force field","guff"],current:ce&&x.mm_force_field===T.value,run:()=>{An(T.value),je("method"),De({kind:"success",message:`${T.label} selected.`})}})),...["NVE","NVT","NPT"].map(T=>({id:`ensemble-${T.toLowerCase()}`,group:"Scientific setup",label:`Use ${T} sampling`,detail:T==="NVE"?"Fixed energy and volume":T==="NVT"?"Fixed temperature and volume":"Fixed temperature and pressure",keywords:T==="NVE"?["microcanonical","energy","fixed volume"]:T==="NVT"?["canonical","temperature","fixed volume"]:["isobaric","pressure","barostat","manostat","pressure coupling"],current:x.ensemble===T,disabledReason:T==="NPT"&&!ce&&q.structure.cell_generated?"NPT needs a physical periodic cell.":void 0,run:()=>{Rl(T),je("conditions"),De({kind:"success",message:`Sampling ensemble set to ${T}.`})}})),{id:"protocol-equilibration",group:"Scientific setup",label:"Include NVT equilibration",detail:"Write run-eq.in before sampling",keywords:["eq","equilibrate","warmup","prepare"],current:!!V,run:()=>{ut(!0),je("conditions"),De({kind:"success",message:"Equilibration included."})}},{id:"protocol-no-equilibration",group:"Scientific setup",label:"Skip equilibration",detail:"Start directly with sampling",keywords:["no eq","sampling only"],current:!V,run:()=>{ut(!1),je("conditions"),De({kind:"success",message:"Equilibration skipped."})}},{id:"sampling-single",group:"Scientific setup",label:"Use one sampling input",detail:"Write a single run-01.in",keywords:["single","one file","sampling output"],current:nl==="single",run:()=>{kl("single"),je("conditions","sampling-steps"),De({kind:"success",message:"One sampling input selected."})}},{id:"sampling-continued",group:"Scientific setup",label:"Split into continued inputs",detail:"Write linked 01, 02, 03… inputs",keywords:["multiple","continued","continuation","split","segments","number of inputs"],current:nl==="continued",run:()=>{kl("continued"),je("conditions","sampling-run-count"),De({kind:"success",message:"Continued sampling inputs selected."})}},...Sf.map(T=>({id:`thermostat-${T.value}`,group:"Scientific setup",label:T.label,detail:T.description,keywords:["thermostat","temperature coupling",T.value,T.value==="nh-chain"?"nose hoover":"",T.value==="velocity_rescaling"?"svr stochastic velocity rescaling":""],current:x.ensemble!=="NVE"&&x.thermostat===T.value,run:()=>{$e(T.value),je("conditions","sampling-thermostat"),De({kind:"success",message:`${T.label} thermostat selected.`})}})),...xf.map(T=>({id:`manostat-${T.value}`,group:"Scientific setup",label:`${T.label} manostat`,detail:T.description,keywords:["manostat","barostat","pressure coupling",T.value],current:x.ensemble==="NPT"&&x.manostat===T.value,disabledReason:!ce&&q.structure.cell_generated?"Pressure coupling needs a physical periodic cell.":void 0,run:()=>{Ou(T.value),je("conditions","sampling-manostat"),De({kind:"success",message:`${T.label} manostat selected.`})}})),{id:"parameter-temperature",group:"Parameters",label:"Target temperature",detail:`${x.temperature_k??"Not set"} K`,keywords:["temperature","kelvin","heat","initial temperature"],run:()=>je("conditions","sampling-temperature")},{id:"parameter-pressure",group:"Parameters",label:"Target pressure",detail:`${x.pressure_bar??1.01325} bar`,keywords:["pressure","atm","bar","isobaric"],disabledReason:!ce&&q.structure.cell_generated?"Pressure needs a physical periodic cell.":void 0,run:()=>{Rl("NPT"),je("conditions","sampling-pressure")}},{id:"parameter-timestep",group:"Parameters",label:"Sampling timestep",detail:`${x.timestep_fs??"Not set"} fs`,keywords:["time step","dt","integration"],run:()=>je("conditions","sampling-timestep")},{id:"parameter-steps",group:"Parameters",label:nl==="single"?"Sampling steps":"Steps per input",detail:`${((ze=x.steps)==null?void 0:ze.toLocaleString())??"Not set"} steps`,keywords:["length","duration","sampling","steps per input"],run:()=>je("conditions","sampling-steps")},...nl==="continued"?[{id:"parameter-input-count",group:"Parameters",label:"Number of sampling inputs",detail:`${P} linked inputs · maximum ${Su}`,keywords:["segments","files","split","continued","count"],run:()=>je("conditions","sampling-run-count")}]:[],{id:"parameter-thermostat",group:"Parameters",label:"Thermostat settings",detail:Lm(x.thermostat),keywords:["temperature coupling","relaxation","friction","nose hoover","svr"],run:()=>{x.ensemble==="NVE"&&Rl("NVT"),je("conditions","sampling-thermostat")}},{id:"parameter-manostat",group:"Parameters",label:"Manostat settings",detail:"Pressure coupling, also called a barostat",keywords:["barostat","pressure coupling","compressibility","cell response"],disabledReason:!ce&&q.structure.cell_generated?"Pressure coupling needs a physical periodic cell.":void 0,run:()=>{Rl("NPT"),je("conditions","sampling-manostat")}},{id:"parameter-density",group:"Parameters",label:"System density",detail:"Molecular mechanics cell construction",keywords:["density","g cm","box","volume"],disabledReason:ce?q.structure.cell_generated?void 0:"The imported structure already has a physical cell.":"Available for molecular mechanics.",run:()=>je("method","mm-density")},{id:"parameter-cutoff",group:"Parameters",label:"Coulomb cutoff",detail:`${x.coulomb_cutoff_angstrom} Å`,keywords:["electrostatic","nonbonded","angstrom"],disabledReason:ce?void 0:"Available for molecular mechanics.",run:()=>je("method","mm-cutoff")},{id:"parameter-jitter",group:"Parameters",label:"Position perturbation",detail:"Seeded Gaussian symmetry breaking",keywords:["jitter","sigma","gaussian","crystal","symmetry","random"],disabledReason:te?void 0:"Import a structure before perturbing coordinates.",run:()=>{le(!0),je("prepare","position-sigma")}},...((C==null?void 0:C.files)??[]).map(T=>({id:`input-${T.name}`,group:"Inputs",label:T.name,detail:T.stage_id==="equilibration"?"Equilibration input":`Sampling input ${T.segment_index}`,keywords:["generated input","preview",T.stage_id==="equilibration"?"eq equilibrium":"sampling"],run:()=>{Je(T.name),je("review","generated-input-preview")}})),{id:"import",group:"Actions",label:"Import a structure",detail:"RST, CIF, XYZ, PDB, MOL, SDF, TRAJ",keywords:["open","upload","file","rst","cif","xyz","pdb","mol","sdf","traj","extxyz"],featured:!0,run:ga},{id:"create",group:"Actions",label:"Create run package",detail:"Export inputs, run script, structure, and manifest",hint:da,keywords:["export","zip","download","inputs","run script"],featured:!0,disabledReason:N?"Inputs are still validating.":Nl?void 0:"Resolve preflight issues first.",run:()=>void yt()},{id:"documentation",group:"Actions",label:"Open documentation",detail:"Guides, validation, run packages, and command line",keywords:["docs","help","manual","guide","getting started"],run:()=>window.open(Tm,"_blank","noopener,noreferrer")}]},[D,q.structure.cell_generated,f,yt,ya,Qt,V,ce,ga,Nl,C==null?void 0:C.files,N,da,nl,P,hl,x,te]);U.useEffect(()=>{function o(y){const Q=y.target,xe=(Q==null?void 0:Q.matches("input, textarea, select, [contenteditable=true]"))??!1;if((y.metaKey||y.ctrlKey)&&y.key.toLowerCase()==="k"){y.preventDefault(),qe(ze=>!ze);return}if((y.metaKey||y.ctrlKey)&&y.key==="Enter"&&!el){y.preventDefault(),yt();return}if(y.altKey&&/^[1-5]$/.test(y.key)){y.preventDefault(),R(Il[Number(y.key)-1].id);return}!xe&&y.key==="/"&&(y.preventDefault(),qe(!0))}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[yt,el]);async function Kl(o){const y=++Bt.current;et.current+=1,pe(!0),De(null);try{const Q=await v0(o);if(y!==Bt.current)return;F(Q),M(Q),oe(o),L(!1),le(!1),Qe(null);const xe=o.name.replace(/\.[^.]+$/,"").replace(/[^a-zA-Z0-9_-]/g,"-"),ze=`${xe||"structure"}.rst`;se(ze),X(T=>({...T,start_file:ze,file_prefix:`${xe||"pq"}-run`,density_g_cm3:hf(T)&&Q.structure.cell_generated?T.density_g_cm3??1:T.density_g_cm3})),De({kind:Q.valid?"success":"info",message:Q.valid?`${o.name} passed the structure checks.`:`${o.name} needs attention.`})}catch(Q){y===Bt.current&&De({kind:"error",message:zn(Q)})}finally{y===Bt.current&&pe(!1)}}function ll(o){var Q;const y=(Q=o.target.files)==null?void 0:Q[0];o.target.value="",y&&Kl(y)}async function ol(){if(!te)return;const o=++et.current;d(!0),De(null);try{const y=await b0(te,ue,x.random_seed);if(o!==et.current)return;F(y),Qe({kind:"gaussian-position-jitter",sigma_angstrom:y.sigma_angstrom,seed:y.seed,source_sha256:y.source_sha256,prepared_sha256:y.prepared_sha256}),X(Q=>({...Q,start_file:y.restart_filename})),De({kind:y.valid?"success":"info",message:y.valid?`Prepared with σ = ${ue} Å and seed ${x.random_seed}.`:"Prepared coordinates still need attention."})}catch(y){o===et.current&&De({kind:"error",message:zn(y)})}finally{o===et.current&&d(!1)}}function nt(){et.current+=1,d(!1),we&&(F(H),Qe(null),De({kind:"info",message:"Original coordinates restored."}),X(o=>({...o,start_file:Be})))}function Xa(o){X(y=>{const Q=xu(ml,o),ze=y.runner===o&&(Q==null?void 0:Q.scripts.some(Xt=>Xt.name===y.runner_script))?y.runner_script:Nm(ml,o),T=of(o,y.ensemble,ze,ml),Te=new Set(T.map(Xt=>Xt.role));return{...y,preset_id:null,job_type:"qm-md",runner:o,runner_script:ze,moldescriptor_file:Te.has("moldescriptor")?y.moldescriptor_file??ot("moldescriptor"):y.moldescriptor_file,dftb_template_file:Te.has("dftb_template")?y.dftb_template_file??ot("dftb_template"):y.dftb_template_file,turbomole_define_template_file:Te.has("turbomole_define_template")?y.turbomole_define_template_file??ot("turbomole_define_template"):y.turbomole_define_template_file}})}function Au(o){X(y=>{if(!zm(ml,y.runner).some(T=>T.name===o))return y;const xe=of(y.runner,y.ensemble,o,ml),ze=new Set(xe.map(T=>T.role));return{...y,preset_id:null,runner_script:o,dftb_template_file:ze.has("dftb_template")?y.dftb_template_file??ot("dftb_template"):y.dftb_template_file,turbomole_define_template_file:ze.has("turbomole_define_template")?y.turbomole_define_template_file??ot("turbomole_define_template"):y.turbomole_define_template_file}})}function Za(o){if(o==="mm"){X(Q=>({...Am(Q,Q.mm_force_field),preset_id:null,job_type:"mm-md",runner:null,density_g_cm3:q.structure.cell_generated?Q.density_g_cm3??1:Q.density_g_cm3}));return}const y=jm((f==null?void 0:f.runners)??[]);X(Q=>({...Q,preset_id:null,job_type:"qm-md",runner:Q.runner??(y==null?void 0:y.id)??null}))}function An(o){X(y=>({...Am(y,o),preset_id:null,job_type:"mm-md",runner:null}))}async function Lt(o,y){var xe;const Q=(xe=y.target.files)==null?void 0:xe[0];if(y.target.value="",!!Q)try{const ze=await Q.text(),T=U0(o,Q.name);G(Te=>[...Te.filter(Xt=>Xt.role!==o),{role:o,name:T,content:ze}]),X(Te=>P0(Te,o,T))}catch(ze){De({kind:"error",message:zn(ze)})}}function On(){const o=Q0(yl,P);Qa.current=o,al(o),ke(String(o))}function kl(o){if(o===nl)return;P>1&&(Qa.current=P);const y=G0(o,Qa.current);al(y),ke(String(y))}function ut(o){k(o?{...mf,timestep_fs:x.timestep_fs??mf.timestep_fs,temperature_k:x.temperature_k??mf.temperature_k}:null)}function Jl(o){k(y=>y&&{...y,...o})}function Rl(o){X(y=>({...y,preset_id:null,ensemble:o,thermostat:o==="NVE"?null:y.thermostat??"velocity_rescaling",manostat:o==="NPT"?y.manostat??"stochastic_rescaling":null,pressure_bar:o==="NPT"?y.pressure_bar??1.01325:null,moldescriptor_file:o==="NPT"?y.moldescriptor_file??ot("moldescriptor"):y.moldescriptor_file}))}function $e(o){X(y=>({...y,preset_id:null,ensemble:y.ensemble==="NVE"?"NVT":y.ensemble,thermostat:o}))}function Ou(o){X(y=>({...y,preset_id:null,ensemble:"NPT",thermostat:y.thermostat??"velocity_rescaling",manostat:o,pressure_bar:y.pressure_bar??1.01325}))}function je(o,y){R(o),y&&window.setTimeout(()=>{window.requestAnimationFrame(()=>{const Q=document.getElementById(y),xe=Q==null?void 0:Q.closest("details");xe instanceof HTMLDetailsElement&&(xe.open=!0),Q==null||Q.scrollIntoView({block:"center",behavior:"smooth"}),(Q instanceof HTMLInputElement||Q instanceof HTMLSelectElement||Q instanceof HTMLButtonElement||Q instanceof HTMLTextAreaElement)&&Q.focus({preventScroll:!0})})},0)}const it=V0((f==null?void 0:f.pq)??null);return i.jsxs("div",{className:"app-shell",children:[i.jsxs("header",{className:"app-header",children:[i.jsxs("div",{className:"brand",children:[i.jsx("img",{src:"/pq-logo.png",alt:"PQ"}),i.jsxs("div",{children:[i.jsx("strong",{children:"PQSetup"}),i.jsx("span",{children:"Simulation input"})]})]}),i.jsxs("button",{type:"button",className:"command-trigger","aria-label":`Search setup, ${dt}`,onClick:()=>qe(!0),children:[i.jsx(Rm,{size:16,"aria-hidden":"true"}),i.jsx("span",{children:"Search setup"}),i.jsx("kbd",{children:dt})]}),i.jsxs("div",{className:"header-status",children:[i.jsxs("a",{className:"header-docs-link",href:Tm,target:"_blank",rel:"noopener noreferrer","aria-label":"Open PQSetup documentation",title:"Open documentation",children:[i.jsx(s0,{size:15,"aria-hidden":"true"}),i.jsx("span",{children:"Docs"})]}),f?i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:f.pq.found?"status-ready":"status-missing","aria-label":`PQ ${f.pq.found?f.pq.version??"detected":"not found"}`,title:`PQ ${f.pq.found?f.pq.version??"detected":"not found"}`,children:[i.jsx("span",{className:"status-dot","aria-hidden":"true"}),i.jsxs("span",{className:"status-text",children:["PQ"," ",f.pq.found?f.pq.version??"detected":"not found"]})]}),i.jsxs("span",{className:"version",children:["Input target ",f.target_pq_release]})]}):_?i.jsxs("span",{className:"status-missing","aria-label":"Backend unavailable",title:"Backend unavailable",children:[i.jsx("span",{className:"status-dot","aria-hidden":"true"}),i.jsx("span",{className:"status-text",children:"Backend unavailable"})]}):i.jsxs("span",{className:"loading-label","aria-label":"Checking system",title:"Checking system",children:[i.jsx(Ua,{size:15,className:"spin"}),i.jsx("span",{className:"status-text",children:"Checking system"})]})]})]}),i.jsxs("div",{className:"workspace",children:[i.jsxs("nav",{ref:Ba,className:"workflow","aria-label":"Setup workflow",children:[i.jsxs("div",{className:"workflow-title",children:[i.jsx("span",{children:"Workflow"}),i.jsx(d0,{size:16,"aria-label":"Keyboard accessible"})]}),i.jsx("ol",{children:Il.map((o,y)=>i.jsx("li",{children:i.jsxs("button",{ref:Q=>{zu.current[o.id]=Q},type:"button",className:D===o.id?"active":"","aria-current":D===o.id?"step":void 0,onClick:()=>R(o.id),children:[i.jsx("span",{className:`step-marker ${La[o.id]}`,children:La[o.id]==="ok"?i.jsx(yf,{size:13}):y+1}),i.jsxs("span",{className:"step-copy",children:[i.jsx("strong",{children:o.label}),i.jsx("small",{children:o.hint})]}),i.jsx(cf,{size:15,"aria-hidden":"true"})]})},o.id))}),i.jsxs("div",{className:"workflow-tip",children:[i.jsx("span",{children:"Alt 1–5"}),"Jump between steps"]})]}),i.jsxs("main",{className:"setup-main",ref:En,children:[Rt&&i.jsxs("div",{className:`notice ${Rt.kind}`,role:"status",children:[Rt.kind==="error"?i.jsx(Ra,{size:17}):i.jsx(gf,{size:17}),i.jsx("span",{children:Rt.message}),i.jsx("button",{type:"button",onClick:()=>De(null),children:"Dismiss"})]}),D==="system"&&i.jsxs("section",{className:"step-panel",children:[i.jsx(_u,{eyebrow:"01 · System",title:"Choose the structure",description:"PQSetup checks coordinates, the periodic cell, elements, and close contacts before a run is created."}),i.jsx("input",{ref:Ha,className:"visually-hidden",type:"file",accept:".rst,.xyz,.cif,.pdb,.mol,.sdf,.traj,.extxyz",onChange:ll}),i.jsxs("button",{type:"button",className:"drop-zone",onClick:ga,onDragOver:o=>o.preventDefault(),onDrop:o=>{o.preventDefault();const y=o.dataTransfer.files[0];y&&Kl(y)},children:[$?i.jsx(Ua,{className:"spin",size:25}):i.jsx(ff,{size:25}),i.jsxs("span",{children:[i.jsx("strong",{children:$?"Checking structure…":"Drop a structure here"}),i.jsx("small",{children:"or choose RST, CIF, XYZ, PDB, MOL, or trajectory"})]}),i.jsx("span",{className:"choose-file",children:"Choose file"})]}),i.jsxs("div",{className:"current-file",children:[i.jsx("div",{className:"file-icon",children:i.jsx(sf,{size:20})}),i.jsxs("div",{children:[i.jsx("span",{className:"eyebrow",children:ee?"Example":"Current"}),i.jsx("strong",{children:q.structure.source_name}),i.jsxs("small",{children:[i.jsx(Qm,{formula:q.summary.formula})," ·"," ",q.summary.atom_count.toLocaleString()," atoms"]})]}),i.jsx("span",{className:q.valid?"file-valid":"file-invalid",children:q.valid?"Valid":"Review"})]}),i.jsxs("div",{className:"inline-note",children:[i.jsx("strong",{children:"PQ cell convention"}),i.jsx("p",{children:"Periodic coordinates are wrapped around the cell center, from −L/2 to +L/2. The original file remains unchanged."})]})]}),D==="method"&&i.jsxs("section",{className:"step-panel",children:[i.jsx(_u,{eyebrow:"02 · Method",title:"Choose the interaction model",description:"Use one electronic-structure calculator or one molecular-mechanics model for the run sequence."}),f&&i.jsxs("div",{className:"compatibility-line","aria-label":"PQ compatibility",children:[i.jsxs("span",{children:["Installed ",i.jsx("strong",{children:f.pq.version??"unknown"})]}),i.jsx("span",{"aria-hidden":"true",children:"·"}),i.jsxs("span",{children:["Input target ",i.jsx("strong",{children:f.target_pq_release})]})]}),i.jsxs("fieldset",{className:"interaction-model-fieldset",children:[i.jsx("legend",{children:"Interaction model"}),i.jsxs("div",{className:"interaction-model-options",children:[i.jsxs("label",{className:ce?"":"selected",children:[i.jsx("input",{type:"radio",name:"interaction-model",checked:!ce,onChange:()=>Za("qm")}),i.jsxs("span",{children:[i.jsx("strong",{children:"Quantum mechanics"}),i.jsx("small",{children:"External electronic-structure calculator"})]})]}),i.jsxs("label",{className:ce?"selected":"",children:[i.jsx("input",{type:"radio",name:"interaction-model",checked:ce,onChange:()=>Za("mm")}),i.jsxs("span",{children:[i.jsx("strong",{children:"Molecular mechanics"}),i.jsx("small",{children:"GUFF or a classical force field"})]})]})]})]}),ce?i.jsxs("div",{className:"method-content",children:[i.jsxs("div",{className:"method-principle",children:[i.jsx("strong",{children:"Force-field model"}),i.jsx("span",{children:"PQSetup packages supplied parameters unchanged. It does not infer a force field from coordinates."})]}),i.jsxs("fieldset",{className:"mm-mode-fieldset",children:[i.jsx("legend",{children:"Interaction terms"}),i.jsx("div",{className:"mm-mode-list",children:vf.map(o=>i.jsxs("label",{className:x.mm_force_field===o.value?"selected":"",children:[i.jsx("input",{type:"radio",name:"mm-force-field",checked:x.mm_force_field===o.value,onChange:()=>An(o.value)}),i.jsxs("span",{children:[i.jsx("strong",{children:o.label}),i.jsx("small",{children:o.description})]})]},o.value))})]}),i.jsxs("div",{className:"form-grid mm-settings",children:[q.structure.cell_generated&&i.jsx(Ue,{label:"System density",unit:"g cm⁻³",controlId:"mm-density",help:"Required because the imported structure has no physical periodic cell. PQ uses the equivalent kg L⁻¹ value.",children:i.jsx("input",{type:"number",min:"0.000001",step:"0.01",value:x.density_g_cm3??"",onChange:o=>X(y=>({...y,density_g_cm3:o.target.value?Number(o.target.value):null}))})}),i.jsx(Ue,{label:"Coulomb cutoff",unit:"Å",controlId:"mm-cutoff",help:q.structure.cell_generated?"Must be below half the box length derived from the density.":"Must fit inside half the shortest periodic box length.",children:i.jsx("input",{type:"number",min:"0",step:"0.1",value:x.coulomb_cutoff_angstrom,onChange:o=>X(y=>({...y,coulomb_cutoff_angstrom:Number(o.target.value)}))})})]}),!Gt&&i.jsxs("div",{className:"inline-warning",role:"alert",children:[i.jsx(Ra,{size:15,"aria-hidden":"true"}),"Import a PQ restart with molecule type IDs for molecular mechanics."]}),i.jsxs("section",{className:"setup-files","aria-labelledby":"setup-files-title",children:[i.jsxs("div",{className:"section-rule-heading",children:[i.jsx("strong",{id:"setup-files-title",children:"Force-field files"}),i.jsx("span",{children:"Included in the package"})]}),i.jsx("div",{className:"setup-file-list",children:mt.map(o=>{const y=W.find(Q=>Q.role===o.role);return i.jsxs("label",{className:y?"selected":"",children:[i.jsx("input",{className:"setup-file-input",type:"file",onChange:Q=>void Lt(o.role,Q)}),i.jsx(ff,{size:16,"aria-hidden":"true"}),i.jsxs("span",{children:[i.jsx("strong",{children:o.label}),i.jsx("small",{children:(y==null?void 0:y.name)??o.defaultName})]}),i.jsx("span",{className:y?"file-added":o.optional?"file-optional":"file-required",children:y?"Added":o.optional?"Optional":"Required"})]},o.role)})})]})]}):i.jsxs("div",{className:"method-content",children:[i.jsxs("div",{className:"method-principle",children:[i.jsx("strong",{children:"Calculator"}),i.jsx("span",{children:"Select the calculator required by the study. Missing local software is reported but does not prevent setup."})]}),i.jsxs("div",{className:"calculator-list",role:"radiogroup","aria-label":"Calculator",children:[((f==null?void 0:f.runners)??[]).filter(o=>o.supported).map(o=>{const y=x.runner===o.id,Q=o.available_in_pq===!1?"incomplete":o.ready?"ready":o.installed?"incomplete":"missing";return i.jsxs("div",{className:`calculator-option ${y?"selected":""}`,children:[i.jsxs("label",{children:[i.jsx("input",{type:"radio",name:"calculator",checked:y,onChange:()=>Xa(o.id)}),i.jsx("span",{className:"calculator-radio","aria-hidden":"true",children:y&&i.jsx("span",{})}),i.jsxs("span",{className:"runner-name",children:[i.jsx("strong",{children:o.label}),i.jsx("small",{children:o.version?`Version ${o.version}`:o.detail})]}),i.jsx("span",{className:`runner-state ${Q}`,children:o.available_in_pq===!1?"PQ build mismatch":o.ready?"Ready":o.installed?"Setup incomplete":"Not detected"})]}),y&&(!o.ready||o.available_in_pq===!1)&&i.jsxs("div",{className:"calculator-warning",role:"status",children:[i.jsx(Ra,{size:14,"aria-hidden":"true"}),i.jsxs("span",{children:[o.available_in_pq===!1?`Selected PQ build does not include ${o.label}. `:`${o.detail} `,"Inputs can still be created."]})]})]},o.id)}),!f&&i.jsxs("div",{className:"runner-loading",children:[i.jsx(Ua,{className:"spin",size:18}),"Detecting calculators"]})]}),!x.runner&&i.jsxs("div",{className:"inline-warning",role:"alert",children:[i.jsx(Ra,{size:15,"aria-hidden":"true"}),"Select a calculator."]}),Qt.length>0&&(Qt.length>1||!(Yt!=null&&Yt.recommended_script))&&i.jsxs("fieldset",{className:"electronic-method-fieldset",children:[i.jsx("legend",{children:"Electronic method"}),i.jsx("div",{className:"electronic-method-options",role:"radiogroup","aria-label":"Electronic method",children:Qt.map(o=>i.jsxs("label",{className:x.runner_script===o.name?"selected":"",children:[i.jsx("input",{type:"radio",name:"electronic-method",checked:x.runner_script===o.name,onChange:()=>Au(o.name)}),i.jsx("span",{children:o.label})]},o.name))}),i.jsx("p",{children:"Used for equilibration and sampling."}),!lt&&i.jsxs("div",{className:"inline-warning",role:"alert",children:[i.jsx(Ra,{size:15,"aria-hidden":"true"}),"Choose an electronic method."]})]}),mt.length>0&&i.jsxs("section",{className:"setup-files","aria-labelledby":"qm-setup-files-title",children:[i.jsxs("div",{className:"section-rule-heading",children:[i.jsx("strong",{id:"qm-setup-files-title",children:"Required files"}),i.jsx("span",{children:"Included in the package"})]}),i.jsx("div",{className:"setup-file-list",children:mt.map(o=>{const y=W.find(Q=>Q.role===o.role);return i.jsxs("label",{className:y?"selected":"",children:[i.jsx("input",{className:"setup-file-input",type:"file",onChange:Q=>void Lt(o.role,Q)}),i.jsx(ff,{size:16,"aria-hidden":"true"}),i.jsxs("span",{children:[i.jsx("strong",{children:o.label}),i.jsx("small",{children:(y==null?void 0:y.name)??o.defaultName})]}),i.jsx("span",{className:y?"file-added":"file-required",children:y?"Added":"Required"})]},o.role)})})]})]})]}),D==="conditions"&&i.jsxs("section",{className:"step-panel",children:[i.jsx(_u,{eyebrow:"03 · Conditions",title:"Build the run protocol",description:"Optionally equilibrate, then create one or more linked sampling files."}),i.jsxs("div",{className:"stage-timeline",children:[i.jsxs("section",{className:`optional-stage ${V?"enabled":""}`,"aria-label":"Equilibration",children:[i.jsxs("header",{className:"optional-stage-heading",children:[i.jsx("span",{className:"stage-number stage-code",children:"eq"}),i.jsxs("span",{className:"stage-summary",children:[i.jsx("strong",{children:"Equilibration"}),i.jsx("small",{children:"Optional NVT preparation"})]}),i.jsxs("label",{className:"stage-toggle",children:[i.jsx("span",{children:V?"Included":"Skip"}),i.jsx("input",{type:"checkbox","aria-label":"Include equilibration stage",checked:!!V,onChange:o=>ut(o.target.checked)}),i.jsx("span",{className:"stage-toggle-track","aria-hidden":"true",children:i.jsx("span",{})})]})]}),V&&i.jsxs("details",{className:"stage-settings",children:[i.jsxs("summary",{children:[i.jsxs("span",{children:[i.jsx("strong",{children:"Equilibration settings"}),i.jsx("small",{children:"NVT · fixed cell"})]}),i.jsx("span",{className:"stage-duration",children:pf(V.steps,V.timestep_fs)}),i.jsx(qm,{size:17,"aria-hidden":"true"})]}),i.jsxs("div",{className:"stage-body",children:[i.jsxs("div",{className:"form-grid stage-primary-grid",children:[i.jsx(Ue,{label:"Target temperature",unit:"K",children:i.jsx("input",{type:"number",min:"0.000001",step:"0.01",value:V.temperature_k,onChange:o=>Jl({temperature_k:Number(o.target.value)})})}),i.jsx(Ue,{label:"Timestep",unit:"fs",children:i.jsx("input",{type:"number",min:"0.000001",step:"0.1",value:V.timestep_fs,onChange:o=>Jl({timestep_fs:Number(o.target.value)})})}),i.jsx(Ue,{label:"Steps",children:i.jsx("input",{type:"number",min:"1",step:"1",value:V.steps,onChange:o=>Jl({steps:Number(o.target.value)})})})]}),i.jsx(Om,{value:V,onChange:o=>Jl({...o,thermostat:o.thermostat??V.thermostat,thermostat_relaxation_ps:o.thermostat_relaxation_ps??V.thermostat_relaxation_ps})}),i.jsx(Dm,{value:V,onChange:Jl})]})]})]}),V&&i.jsx(i.Fragment,{children:i.jsxs("div",{className:"stage-connection",children:[i.jsx(m0,{size:14,"aria-hidden":"true"}),"eq restart continues into sampling 01"]})}),i.jsxs("section",{className:"protocol-stage sampling-stage",children:[i.jsxs("header",{className:"sampling-heading",children:[i.jsx("span",{className:`stage-number ${P>1?"stage-range":""}`,children:P>1?`01–${ju(P)}`:"01"}),i.jsxs("span",{className:"stage-summary",children:[i.jsx("strong",{children:"Sampling"}),i.jsxs("small",{children:[X0(P,!!V)," ","· ",x.ensemble]})]}),i.jsx("span",{className:"stage-duration",children:pf(Tu,x.timestep_fs)})]}),i.jsxs("div",{className:"stage-body",children:[i.jsxs("section",{className:"sampling-plan","aria-labelledby":"sampling-files-title",children:[i.jsxs("div",{className:"section-rule-heading",children:[i.jsx("strong",{id:"sampling-files-title",children:"Sampling files"}),i.jsx("span",{children:"Run layout"})]}),i.jsxs("fieldset",{className:"sampling-output-fieldset",children:[i.jsx("legend",{children:"Write sampling as"}),i.jsxs("div",{className:"sampling-output-modes",children:[i.jsxs("label",{className:nl==="single"?"selected":"",children:[i.jsx("input",{type:"radio",name:"sampling-output-mode",value:"single",checked:nl==="single",onChange:()=>kl("single")}),i.jsxs("span",{children:[i.jsx("strong",{children:"Single input"}),i.jsx("small",{children:"One run-01.in"})]})]}),i.jsxs("label",{className:nl==="continued"?"selected":"",children:[i.jsx("input",{type:"radio",name:"sampling-output-mode",value:"continued",checked:nl==="continued",onChange:()=>kl("continued")}),i.jsxs("span",{children:[i.jsx("strong",{children:"Split into continued inputs"}),i.jsx("small",{children:"Numbered 01, 02, 03…"})]})]})]})]}),i.jsx("p",{className:"sampling-output-description","aria-live":"polite",children:nl==="single"?"Create one sampling input.":`Create ${P} linked inputs. Each later input reads the previous restart.`}),i.jsxs("div",{className:`form-grid sampling-length-grid ${nl}`,children:[i.jsx(Ue,{label:nl==="single"?"Steps":"Steps per input",controlId:"sampling-steps",children:i.jsx("input",{type:"number",min:"1",step:"1",value:x.steps??"",onChange:o=>X(y=>({...y,steps:o.target.value?Number(o.target.value):null}))})}),nl==="continued"&&i.jsx(Ue,{label:"Number of inputs",controlId:"sampling-run-count",help:`Linked inputs are numbered automatically. Maximum ${Su}.`,children:i.jsx("input",{type:"number",min:"2",max:Su,step:"1",inputMode:"numeric",value:yl,onChange:o=>{const y=o.target.value;ke(y);const Q=H0(y);Q!==null&&(Qa.current=Q,al(Q))},onBlur:On,onKeyDown:o=>{o.key==="Enter"&&o.currentTarget.blur()}})})]}),i.jsxs("div",{className:"sampling-total","aria-live":"polite",children:[i.jsxs("span",{children:[i.jsx("strong",{children:P}),P===1?"input file":"input files"]}),i.jsxs("span",{children:[i.jsx("strong",{children:((gt=x.steps)==null?void 0:gt.toLocaleString())??"—"}),nl==="single"?"steps":"steps per input"]}),i.jsxs("span",{children:[i.jsx("strong",{children:pf(Tu,x.timestep_fs)}),"total sampling time"]})]}),i.jsxs("div",{className:"filename-chain","aria-label":`Run order: ${Ga.join(" then ")}`,children:[i.jsx("span",{children:"Run order"}),i.jsx("div",{children:Ga.map((o,y)=>i.jsxs("span",{children:[y>0&&i.jsx(Zi,{size:12,"aria-hidden":"true"}),o==="…"?i.jsx("b",{children:"…"}):i.jsx("code",{children:o})]},`${o}-${y}`))})]})]}),i.jsxs("fieldset",{className:"ensemble-fieldset",children:[i.jsx("legend",{children:"Sampling ensemble"}),i.jsx("div",{role:"radiogroup","aria-label":"Sampling ensemble",children:[["NVE","Energy"],["NVT","Temperature"],["NPT","Temperature + pressure"]].map(([o,y])=>i.jsxs("button",{type:"button",role:"radio","aria-checked":x.ensemble===o,className:x.ensemble===o?"selected":"",onClick:()=>Rl(o),children:[i.jsx("strong",{children:o}),i.jsx("small",{children:y})]},o))}),i.jsx("p",{children:x.ensemble==="NVE"?"Fixed particle number, volume, and total energy.":x.ensemble==="NVT"?"Fixed particle number and volume with temperature coupling.":"Fixed particle number with temperature and pressure coupling."})]}),i.jsxs("div",{className:"form-grid sampling-condition-grid",children:[i.jsx(Ue,{label:x.ensemble==="NVE"?"Initial temperature":"Target temperature",unit:"K",controlId:"sampling-temperature",children:i.jsx("input",{type:"number",min:"0.000001",step:"0.01",value:x.temperature_k??"",onChange:o=>X(y=>({...y,temperature_k:o.target.value?Number(o.target.value):null}))})}),x.ensemble==="NPT"&&i.jsx(Ue,{label:"Target pressure",unit:"bar",controlId:"sampling-pressure",help:"1 atm = 1.01325 bar; negative values model tension.",children:i.jsx("input",{type:"number",step:"0.00001",value:x.pressure_bar??"",onChange:o=>X(y=>({...y,pressure_bar:o.target.value?Number(o.target.value):null}))})}),i.jsx(Ue,{label:"Timestep",unit:"fs",controlId:"sampling-timestep",children:i.jsx("input",{type:"number",min:"0.000001",step:"0.1",value:x.timestep_fs??"",onChange:o=>X(y=>({...y,timestep_fs:o.target.value?Number(o.target.value):null}))})})]}),(x.ensemble==="NVT"||x.ensemble==="NPT")&&i.jsxs(i.Fragment,{children:[i.jsx(Om,{value:x,controlId:"sampling-thermostat",onChange:o=>X(y=>({...y,preset_id:null,...o}))}),i.jsx(Dm,{value:x,onChange:o=>X(y=>({...y,preset_id:null,...o}))})]}),x.ensemble==="NPT"&&i.jsx(ly,{value:x,controlId:"sampling-manostat",onChange:o=>X(y=>({...y,preset_id:null,...o}))})]})]})]})]}),D==="prepare"&&i.jsxs("section",{className:"step-panel",children:[i.jsx(_u,{eyebrow:"04 · Prepare",title:"Prepare the coordinates",description:"Optional perturbation can break perfect crystal symmetry. Every prepared structure is revalidated."}),i.jsxs("div",{className:"prepare-row locked",children:[i.jsx("div",{className:"prepare-icon",children:i.jsx(yf,{size:18})}),i.jsxs("div",{children:[i.jsx("strong",{children:"Wrap into the centered cell"}),i.jsx("p",{children:"Periodic atoms use PQ’s −L/2 to +L/2 convention."})]}),i.jsx("span",{children:"Applied"})]}),i.jsxs("div",{className:`prepare-option ${Z?"enabled":""}`,children:[i.jsxs("label",{className:"switch-row",children:[i.jsx("span",{className:"prepare-icon",children:i.jsx(Sm,{size:18})}),i.jsxs("span",{children:[i.jsx("strong",{children:"Break perfect symmetry"}),i.jsx("small",{children:"Add a small seeded Gaussian position offset."})]}),i.jsx("input",{type:"checkbox",checked:Z,disabled:!te,onChange:o=>{le(o.target.checked),o.target.checked||nt()}}),i.jsx("span",{className:"switch","aria-hidden":"true"})]}),Z&&i.jsxs("div",{className:"prepare-fields",children:[i.jsx(Ue,{label:"Position σ",unit:"Å",controlId:"position-sigma",help:"0.01 Å is a conservative starting point.",children:i.jsx("input",{type:"number",min:"0",max:"0.2",step:"0.001",value:ue,onChange:o=>{nt(),ge(Number(o.target.value))}})}),i.jsx(Ue,{label:"Random seed",controlId:"position-seed",help:"The same seed reproduces the same coordinates.",children:i.jsx("input",{type:"number",min:"0",max:"4294967295",step:"1",value:x.random_seed,onChange:o=>{nt(),X(y=>({...y,random_seed:Number(o.target.value)}))}})}),i.jsxs("button",{type:"button",className:"secondary-action",disabled:ye||!te,onClick:()=>void ol(),children:[ye?i.jsx(Ua,{className:"spin",size:16}):i.jsx(Sm,{size:16}),"Apply to original"]})]}),we&&i.jsxs("div",{className:"preparation-applied",children:[i.jsx(gf,{size:15}),"Applied · σ ",we.sigma_angstrom," Å · seed"," ",we.seed]}),!te&&i.jsx("p",{className:"example-limit",children:"Import a structure to enable reproducible preparation."})]}),i.jsxs("div",{className:"velocity-note",children:[i.jsxs("div",{children:[i.jsx("strong",{children:"Velocities are generated by PQ"}),i.jsxs("p",{children:["PQ samples the mass-dependent Maxwell–Boltzmann distribution at ",x.temperature_k??"the target"," K and removes net motion. PQSetup writes the temperature and seed."]})]}),i.jsx("span",{children:"Recommended"})]})]}),D==="review"&&i.jsxs("section",{className:"step-panel review-panel",children:[i.jsx(_u,{eyebrow:"05 · Review",title:"Review the inputs",description:"Check the input sequence before creating the run package."}),i.jsxs("div",{className:"form-grid review-fields",children:[i.jsx(Ue,{label:"Run name",controlId:"run-name",children:i.jsx("input",{value:x.file_prefix,onChange:o=>X(y=>({...y,file_prefix:o.target.value}))})}),i.jsx(Ue,{label:"Start file",controlId:"start-file",children:i.jsx("input",{value:x.start_file,onChange:o=>X(y=>({...y,start_file:o.target.value}))})})]}),i.jsxs("div",{className:"review-summary","aria-live":"polite",children:[i.jsxs("span",{children:[i.jsx("strong",{children:(C==null?void 0:C.files.length)??0})," ",(C==null?void 0:C.files.length)===1?"input file":"input files"]}),i.jsxs("span",{children:[i.jsx("strong",{children:ma})," method"]}),i.jsxs("span",{children:[i.jsx("strong",{children:P})," sampling"," ",P===1?"file":"files",V?" + eq":""]})]}),i.jsxs("section",{className:"run-launcher","aria-labelledby":"run-launcher-title",children:[i.jsxs("div",{children:[i.jsx("strong",{id:"run-launcher-title",children:"Run the package"}),i.jsx("span",{children:it.detail})]}),i.jsx("pre",{children:i.jsx("code",{children:it.command})}),i.jsxs("p",{children:["Stops at the first failed input or when PQ does not report"," ",i.jsx("code",{children:"PQ ended normally"}),"."]})]}),C&&C.files.length>0&&i.jsxs("section",{className:"generated-inputs","aria-labelledby":"generated-inputs-title",children:[i.jsxs("header",{children:[i.jsxs("span",{children:[i.jsx("strong",{id:"generated-inputs-title",children:"Generated inputs"}),i.jsx("small",{children:ma})]}),i.jsxs("span",{children:[C.files.length," ",C.files.length===1?"file":"files"]})]}),C.files.length===1?i.jsxs("div",{className:"single-input-file",children:[i.jsx(sf,{size:16,"aria-hidden":"true"}),i.jsxs("span",{children:[i.jsx("strong",{children:Se==null?void 0:Se.name}),i.jsx("small",{children:Se==null?void 0:Se.stage_label})]})]}):i.jsxs("div",{className:"input-navigator",children:[i.jsx("button",{type:"button","aria-label":"Previous input","aria-controls":"generated-input-preview",disabled:Ge<=0,onClick:()=>{Ge<=0||Je(C.files[Ge-1].name)},children:i.jsx(f0,{size:16,"aria-hidden":"true"})}),i.jsxs("label",{htmlFor:Pl,children:[i.jsx("span",{className:"visually-hidden",children:"Generated input"}),i.jsxs("select",{id:Pl,"aria-label":"Generated input","aria-controls":"generated-input-preview",value:(Se==null?void 0:Se.name)??"",onChange:o=>Je(o.target.value),children:[Vl.length>0&&i.jsx("optgroup",{label:"Equilibration",children:Vl.map(o=>i.jsx("option",{value:o.name,children:Em(o,C.files.length)},o.name))}),rl.length>0&&i.jsx("optgroup",{label:"Sampling",children:rl.map(o=>i.jsx("option",{value:o.name,children:Em(o,C.files.length)},o.name))})]})]}),i.jsxs("output",{"aria-live":"polite",children:[Ge+1," of ",C.files.length]}),i.jsx("button",{type:"button","aria-label":"Next input","aria-controls":"generated-input-preview",disabled:Ge<0||Ge>=C.files.length-1,onClick:()=>{Ge<0||Ge>=C.files.length-1||Je(C.files[Ge+1].name)},children:i.jsx(cf,{size:16,"aria-hidden":"true"})})]})]}),i.jsxs("div",{className:"input-preview",id:"generated-input-preview",role:"region","aria-label":`Input preview: ${(Se==null?void 0:Se.name)??"preparing inputs"}`,children:[i.jsxs("div",{className:"preview-title",children:[i.jsxs("span",{children:[i.jsx(sf,{size:16}),(Se==null?void 0:Se.name)??"Preparing inputs…"]}),N&&i.jsx(Ua,{className:"spin",size:15})]}),Se&&i.jsxs("div",{className:"preview-continuation",children:[i.jsxs("span",{children:["Starts from ",i.jsx("strong",{children:Se.start_file})]}),i.jsx(Zi,{size:13,"aria-hidden":"true"}),i.jsxs("span",{children:["writes ",i.jsx("strong",{children:Se.restart_file})]})]}),i.jsx("pre",{children:i.jsx("code",{children:(Se==null?void 0:Se.input_text)||((Du=C==null?void 0:C.diagnostics[0])==null?void 0:Du.message)||"Preparing inputs…"})})]}),i.jsxs("button",{type:"button",className:"create-run large",disabled:!Nl||j,onClick:()=>void yt(),children:[j?i.jsx(Ua,{className:"spin",size:18}):i.jsx(_m,{size:18}),j?"Creating package…":`Create package · ${(C==null?void 0:C.files.length)??0} ${(C==null?void 0:C.files.length)===1?"input":"inputs"}`,i.jsx("span",{children:"Ctrl Enter"})]})]}),i.jsxs("footer",{className:"step-footer",children:[i.jsxs("span",{children:["Step ",Il.findIndex(o=>o.id===D)+1," of"," ",Il.length]}),D!=="review"&&i.jsxs("button",{type:"button",onClick:()=>{const o=Il.findIndex(y=>y.id===D);R(Il[Math.min(o+1,Il.length-1)].id)},children:["Continue",i.jsx(Zi,{size:16})]})]})]}),i.jsxs("aside",{className:"inspector",children:[i.jsx(F0,{analysis:q,example:ee,generatedCellTreatment:ce?"density":"padding",densityGcm3:x.density_g_cm3}),i.jsxs("section",{className:"preflight","aria-labelledby":"preflight-title",children:[i.jsxs("div",{className:"preflight-heading",children:[i.jsxs("div",{children:[i.jsx("span",{className:"eyebrow",children:"Preflight"}),i.jsx("h2",{id:"preflight-title",children:Nl?"Ready to create":"Check the run"})]}),i.jsx("span",{className:`preflight-score ${Nl?"ready":""}`,children:Mn})]}),i.jsxs("ul",{className:"preflight-list",children:[i.jsxs("li",{className:f!=null&&f.pq.found?"ok":"warn",children:[i.jsx(Xi,{status:f!=null&&f.pq.found?"ok":"warn"}),i.jsxs("span",{children:[i.jsx("strong",{children:"PQ executable"}),i.jsx("small",{children:(f==null?void 0:f.pq.detail)??"Checking…"})]})]}),i.jsxs("li",{className:q.valid?"ok":"warn",children:[i.jsx(Xi,{status:q.valid?"ok":"warn"}),i.jsxs("span",{children:[i.jsx("strong",{children:"Structure"}),i.jsx("small",{children:q.valid?"Coordinates and cell are valid.":"Structure errors need attention."})]})]}),i.jsxs("li",{className:Ul&&!at&&!zl?"ok":"warn",children:[i.jsx(Xi,{status:Ul&&!at&&!zl?"ok":Ul||ce?"warn":"idle"}),i.jsxs("span",{children:[i.jsx("strong",{children:"Method"}),i.jsx("small",{children:ce?Gt?tt.length?`Add ${tt.length} required force-field ${tt.length===1?"file":"files"}.`:ha?`${ma} is ready.`:"Set the system density.":"Import a PQ restart with molecule type IDs.":x.runner?Yt&&!lt?"Choose an electronic method.":tt.length?`Add ${tt.length} required ${tt.length===1?"file":"files"}.`:zl?`Selected PQ build does not include ${Tn}.`:at?`${ma} was not detected.`:`${ma} is ready.`:"Choose a calculator."})]})]}),i.jsxs("li",{className:C!=null&&C.valid?"ok":"warn",children:[i.jsx(Xi,{status:C!=null&&C.valid?"ok":C?"warn":"idle"}),i.jsxs("span",{children:[i.jsx("strong",{children:"PQ inputs"}),i.jsx("small",{children:C!=null&&C.valid?Ya?`${C.files.length} input ${C.files.length===1?"file":"files"} ready for PQ validation.`:`${C.files.length} input ${C.files.length===1?"file":"files"} generated locally; PQ validation is unavailable.`:N?"Validating…":"Input settings need attention."})]})]})]}),ya.length>0&&i.jsx("div",{className:"diagnostics",children:ya.slice(0,4).map((o,y)=>o.severity==="info"?i.jsxs("div",{className:"diagnostic-row info",children:[i.jsx(Um,{size:14,"aria-hidden":"true"}),i.jsx("span",{children:o.message})]},`${o.code}-${y}`):i.jsxs("button",{type:"button",className:o.severity,onClick:()=>R(xm(o.code)),children:[i.jsx(Ra,{size:14,"aria-hidden":"true"}),i.jsx("span",{children:o.message}),i.jsx(cf,{size:14,"aria-hidden":"true"})]},`${o.code}-${y}`))}),i.jsxs("button",{type:"button",className:"create-run",disabled:!Nl||j,onClick:()=>void yt(),children:[j?i.jsx(Ua,{className:"spin",size:17}):i.jsx(_m,{size:17}),"Create package"]})]})]})]}),i.jsx(z0,{open:el,commands:Mu,onClose:()=>qe(!1)})]})}n0.createRoot(document.getElementById("root")).render(i.jsx(U.StrictMode,{children:i.jsx(ty,{})})); diff --git a/pqsetup/static/assets/index-DYUebUkg.js b/pqsetup/static/assets/index-DYUebUkg.js deleted file mode 100644 index 45f161a..0000000 --- a/pqsetup/static/assets/index-DYUebUkg.js +++ /dev/null @@ -1,184 +0,0 @@ -(function(){const b=document.createElement("link").relList;if(b&&b.supports&&b.supports("modulepreload"))return;for(const D of document.querySelectorAll('link[rel="modulepreload"]'))r(D);new MutationObserver(D=>{for(const H of D)if(H.type==="childList")for(const q of H.addedNodes)q.tagName==="LINK"&&q.rel==="modulepreload"&&r(q)}).observe(document,{childList:!0,subtree:!0});function _(D){const H={};return D.integrity&&(H.integrity=D.integrity),D.referrerPolicy&&(H.referrerPolicy=D.referrerPolicy),D.crossOrigin==="use-credentials"?H.credentials="include":D.crossOrigin==="anonymous"?H.credentials="omit":H.credentials="same-origin",H}function r(D){if(D.ep)return;D.ep=!0;const H=_(D);fetch(D.href,H)}})();var Ps={exports:{}},bu={};/** - * @license React - * react-jsx-runtime.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var fm;function kp(){if(fm)return bu;fm=1;var f=Symbol.for("react.transitional.element"),b=Symbol.for("react.fragment");function _(r,D,H){var q=null;if(H!==void 0&&(q=""+H),D.key!==void 0&&(q=""+D.key),"key"in D){H={};for(var F in D)F!=="key"&&(H[F]=D[F])}else H=D;return D=H.ref,{$$typeof:f,type:r,key:q,ref:D!==void 0?D:null,props:H}}return bu.Fragment=b,bu.jsx=_,bu.jsxs=_,bu}var rm;function Jp(){return rm||(rm=1,Ps.exports=kp()),Ps.exports}var i=Jp(),ef={exports:{}},ae={};/** - * @license React - * react.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var om;function $p(){if(om)return ae;om=1;var f=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),H=Symbol.for("react.consumer"),q=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),T=Symbol.for("react.memo"),ee=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),te=Symbol.iterator;function oe(d){return d===null||typeof d!="object"?null:(d=te&&d[te]||d["@@iterator"],typeof d=="function"?d:null)}var Be={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},se=Object.assign,we={};function Ye(d,j,Y){this.props=d,this.context=j,this.refs=we,this.updater=Y||Be}Ye.prototype.isReactComponent={},Ye.prototype.setState=function(d,j){if(typeof d!="object"&&typeof d!="function"&&d!=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,d,j,"setState")},Ye.prototype.forceUpdate=function(d){this.updater.enqueueForceUpdate(this,d,"forceUpdate")};function x(){}x.prototype=Ye.prototype;function X(d,j,Y){this.props=d,this.context=j,this.refs=we,this.updater=Y||Be}var W=X.prototype=new x;W.constructor=X,se(W,Ye.prototype),W.isPureReactComponent=!0;var G=Array.isArray;function V(){}var k={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function al(d,j,Y){var Z=Y.ref;return{$$typeof:f,type:d,key:j,ref:Z!==void 0?Z:null,props:Y}}function yl(d,j){return al(d.type,j,d.props)}function ke(d){return typeof d=="object"&&d!==null&&d.$$typeof===f}function C(d){var j={"=":"=0",":":"=2"};return"$"+d.replace(/[=:]/g,function(Y){return j[Y]})}var Cl=/\/+/g;function jl(d,j){return typeof d=="object"&&d!==null&&d.key!=null?C(""+d.key):j.toString(36)}function Je(d){switch(d.status){case"fulfilled":return d.value;case"rejected":throw d.reason;default:switch(typeof d.status=="string"?d.then(V,V):(d.status="pending",d.then(function(j){d.status==="pending"&&(d.status="fulfilled",d.value=j)},function(j){d.status==="pending"&&(d.status="rejected",d.reason=j)})),d.status){case"fulfilled":return d.value;case"rejected":throw d.reason}}throw d}function N(d,j,Y,Z,le){var ue=typeof d;(ue==="undefined"||ue==="boolean")&&(d=null);var ge=!1;if(d===null)ge=!0;else switch(ue){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(d.$$typeof){case f:case b:ge=!0;break;case ee:return ge=d._init,N(ge(d._payload),j,Y,Z,le)}}if(ge)return le=le(d),ge=Z===""?"."+jl(d,0):Z,G(le)?(Y="",ge!=null&&(Y=ge.replace(Cl,"$&/")+"/"),N(le,j,Y,"",function(dt){return dt})):le!=null&&(ke(le)&&(le=yl(le,Y+(le.key==null||d&&d.key===le.key?"":(""+le.key).replace(Cl,"$&/")+"/")+ge)),j.push(le)),1;ge=0;var el=Z===""?".":Z+":";if(G(d))for(var De=0;De>>1,ye=N[pe];if(0>>1;peD(Y,$))ZD(le,Y)?(N[pe]=le,N[Z]=$,pe=Z):(N[pe]=Y,N[j]=$,pe=j);else if(ZD(le,$))N[pe]=le,N[Z]=$,pe=Z;else break e}}return Q}function D(N,Q){var $=N.sortIndex-Q.sortIndex;return $!==0?$:N.id-Q.id}if(f.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var H=performance;f.unstable_now=function(){return H.now()}}else{var q=Date,F=q.now();f.unstable_now=function(){return q.now()-F}}var B=[],T=[],ee=1,L=null,te=3,oe=!1,Be=!1,se=!1,we=!1,Ye=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function W(N){for(var Q=_(T);Q!==null;){if(Q.callback===null)r(T);else if(Q.startTime<=N)r(T),Q.sortIndex=Q.expirationTime,b(B,Q);else break;Q=_(T)}}function G(N){if(se=!1,W(N),!Be)if(_(B)!==null)Be=!0,V||(V=!0,C());else{var Q=_(T);Q!==null&&Je(G,Q.startTime-N)}}var V=!1,k=-1,P=5,al=-1;function yl(){return we?!0:!(f.unstable_now()-alN&&yl());){var pe=L.callback;if(typeof pe=="function"){L.callback=null,te=L.priorityLevel;var ye=pe(L.expirationTime<=N);if(N=f.unstable_now(),typeof ye=="function"){L.callback=ye,W(N),Q=!0;break l}L===_(B)&&r(B),W(N)}else r(B);L=_(B)}if(L!==null)Q=!0;else{var d=_(T);d!==null&&Je(G,d.startTime-N),Q=!1}}break e}finally{L=null,te=$,oe=!1}Q=void 0}}finally{Q?C():V=!1}}}var C;if(typeof X=="function")C=function(){X(ke)};else if(typeof MessageChannel<"u"){var Cl=new MessageChannel,jl=Cl.port2;Cl.port1.onmessage=ke,C=function(){jl.postMessage(null)}}else C=function(){Ye(ke,0)};function Je(N,Q){k=Ye(function(){N(f.unstable_now())},Q)}f.unstable_IdlePriority=5,f.unstable_ImmediatePriority=1,f.unstable_LowPriority=4,f.unstable_NormalPriority=3,f.unstable_Profiling=null,f.unstable_UserBlockingPriority=2,f.unstable_cancelCallback=function(N){N.callback=null},f.unstable_forceFrameRate=function(N){0>N||125pe?(N.sortIndex=$,b(T,N),_(B)===null&&N===_(T)&&(se?(x(k),k=-1):se=!0,Je(G,$-pe))):(N.sortIndex=ye,b(B,N),Be||oe||(Be=!0,V||(V=!0,C()))),N},f.unstable_shouldYield=yl,f.unstable_wrapCallback=function(N){var Q=te;return function(){var $=te;te=Q;try{return N.apply(this,arguments)}finally{te=$}}}})(af)),af}var hm;function Fp(){return hm||(hm=1,tf.exports=Wp()),tf.exports}var nf={exports:{}},ml={};/** - * @license React - * react-dom.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var pm;function Ip(){if(pm)return ml;pm=1;var f=bf();function b(B){var T="https://react.dev/errors/"+B;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f)}catch(b){console.error(b)}}return f(),nf.exports=Ip(),nf.exports}/** - * @license React - * react-dom-client.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var gm;function e0(){if(gm)return Su;gm=1;var f=Fp(),b=bf(),_=Pp();function r(e){var l="https://react.dev/errors/"+e;if(1ye||(e.current=pe[ye],pe[ye]=null,ye--)}function Y(e,l){ye++,pe[ye]=e.current,e.current=l}var Z=d(null),le=d(null),ue=d(null),ge=d(null);function el(e,l){switch(Y(ue,l),Y(le,e),Y(Z,null),l.nodeType){case 9:case 11:e=(e=l.documentElement)&&(e=e.namespaceURI)?Cd(e):0;break;default:if(e=l.tagName,l=l.namespaceURI)l=Cd(l),e=qd(l,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}j(Z),Y(Z,e)}function De(){j(Z),j(le),j(ue)}function dt(e){e.memoizedState!==null&&Y(ge,e);var l=Z.current,t=qd(l,e.type);l!==t&&(Y(le,e),Y(Z,t))}function ma(e){le.current===e&&(j(Z),j(le)),ge.current===e&&(j(ge),pu._currentValue=$)}var Rt,Ae;function Il(e){if(Rt===void 0)try{throw Error()}catch(t){var l=t.stack.trim().match(/\n( *(at )?)/);Rt=l&&l[1]||"",Ae=-1)":-1n||m[a]!==v[n]){var E=` -`+m[a].replace(" at new "," at ");return e.displayName&&E.includes("")&&(E=E.replace("",e.displayName)),E}while(1<=a&&0<=n);break}}}finally{Ba=!1,Error.prepareStackTrace=t}return(t=e?e.displayName||e.name:"")?Il(t):""}function Nu(e,l){switch(e.tag){case 26:case 27:case 5:return Il(e.type);case 16:return Il("Lazy");case 13:return e.child!==l&&l!==null?Il("Suspense Fallback"):Il("Suspense");case 19:return Il("SuspenseList");case 0:case 15:return Ya(e.type,!1);case 11:return Ya(e.type.render,!1);case 1:return Ya(e.type,!0);case 31:return Il("Activity");default:return""}}function Nn(e){try{var l="",t=null;do l+=Nu(e,t),t=e,e=e.return;while(e);return l}catch(a){return` -Error generating stack: `+a.message+` -`+a.stack}}var Ht=Object.prototype.hasOwnProperty,Bt=f.unstable_scheduleCallback,Pl=f.unstable_cancelCallback,Eu=f.unstable_shouldYield,Qa=f.unstable_requestPaint,ce=f.unstable_now,hl=f.unstable_getCurrentPriorityLevel,Yt=f.unstable_ImmediatePriority,Qt=f.unstable_UserBlockingPriority,et=f.unstable_NormalPriority,mt=f.unstable_LowPriority,ht=f.unstable_IdlePriority,Tu=f.log,ql=f.unstable_setDisableYieldValue,_e=null,Ge=null;function wl(e){if(typeof Tu=="function"&&ql(e),Ge&&typeof Ge.setStrictMode=="function")try{Ge.setStrictMode(_e,e)}catch{}}var dl=Math.clz32?Math.clz32:lt,Mu=Math.log,ha=Math.LN2;function lt(e){return e>>>=0,e===0?32:31-(Mu(e)/ha|0)|0}var Gt=256,pa=262144,tt=4194304;function pt(e){var l=e&42;if(l!==0)return l;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 Vl(e,l,t){var a=e.pendingLanes;if(a===0)return 0;var n=0,u=e.suspendedLanes,c=e.pingedLanes;e=e.warmLanes;var s=a&134217727;return s!==0?(a=s&~u,a!==0?n=pt(a):(c&=s,c!==0?n=pt(c):t||(t=s&~e,t!==0&&(n=pt(t))))):(s=a&~u,s!==0?n=pt(s):c!==0?n=pt(c):t||(t=a&~e,t!==0&&(n=pt(t)))),n===0?0:l!==0&&l!==n&&(l&u)===0&&(u=n&-n,t=l&-l,u>=t||u===32&&(t&4194048)!==0)?l:n}function Lt(e,l){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&l)===0}function cl(e,l){switch(e){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 En(){var e=tt;return tt<<=1,(tt&62914560)===0&&(tt=4194304),e}function ya(e){for(var l=[],t=0;31>t;t++)l.push(e);return l}function Kl(e,l){e.pendingLanes|=l,l!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ga(e,l,t,a,n,u){var c=e.pendingLanes;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=t,e.entangledLanes&=t,e.errorRecoveryDisabledLanes&=t,e.shellSuspendCounter=0;var s=e.entanglements,m=e.expirationTimes,v=e.hiddenUpdates;for(t=c&~t;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Lm=/[\n"\\]/g;function Rl(e){return e.replace(Lm,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function ki(e,l,t,a,n,u,c,s){e.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?e.type=c:e.removeAttribute("type"),l!=null?c==="number"?(l===0&&e.value===""||e.value!=l)&&(e.value=""+ul(l)):e.value!==""+ul(l)&&(e.value=""+ul(l)):c!=="submit"&&c!=="reset"||e.removeAttribute("value"),l!=null?Ji(e,c,ul(l)):t!=null?Ji(e,c,ul(t)):a!=null&&e.removeAttribute("value"),n==null&&u!=null&&(e.defaultChecked=!!u),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.name=""+ul(s):e.removeAttribute("name")}function Nf(e,l,t,a,n,u,c,s){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),l!=null||t!=null){if(!(u!=="submit"&&u!=="reset"||l!=null)){Ki(e);return}t=t!=null?""+ul(t):"",l=l!=null?""+ul(l):t,s||l===e.value||(e.value=l),e.defaultValue=l}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=s?e.checked:!!a,e.defaultChecked=!!a,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.name=c),Ki(e)}function Ji(e,l,t){l==="number"&&Du(e.ownerDocument)===e||e.defaultValue===""+t||(e.defaultValue=""+t)}function Za(e,l,t,a){if(e=e.options,l){l={};for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Pi=!1;if(bt)try{var qn={};Object.defineProperty(qn,"passive",{get:function(){Pi=!0}}),window.addEventListener("test",qn,qn),window.removeEventListener("test",qn,qn)}catch{Pi=!1}var wt=null,ec=null,qu=null;function Cf(){if(qu)return qu;var e,l=ec,t=l.length,a,n="value"in wt?wt.value:wt.textContent,u=n.length;for(e=0;e=Hn),Yf=" ",Qf=!1;function Gf(e,l){switch(e){case"keyup":return ph.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ka=!1;function gh(e,l){switch(e){case"compositionend":return Lf(l);case"keypress":return l.which!==32?null:(Qf=!0,Yf);case"textInput":return e=l.data,e===Yf&&Qf?null:e;default:return null}}function vh(e,l){if(ka)return e==="compositionend"||!uc&&Gf(e,l)?(e=Cf(),qu=ec=wt=null,ka=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:t,offset:l-e};e=a}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=$f(t)}}function Ff(e,l){return e&&l?e===l?!0:e&&e.nodeType===3?!1:l&&l.nodeType===3?Ff(e,l.parentNode):"contains"in e?e.contains(l):e.compareDocumentPosition?!!(e.compareDocumentPosition(l)&16):!1:!1}function If(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var l=Du(e.document);l instanceof e.HTMLIFrameElement;){try{var t=typeof l.contentWindow.location.href=="string"}catch{t=!1}if(t)e=l.contentWindow;else break;l=Du(e.document)}return l}function sc(e){var l=e&&e.nodeName&&e.nodeName.toLowerCase();return l&&(l==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||l==="textarea"||e.contentEditable==="true")}var Eh=bt&&"documentMode"in document&&11>=document.documentMode,Ja=null,fc=null,Gn=null,rc=!1;function Pf(e,l,t){var a=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;rc||Ja==null||Ja!==Du(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}),Gn&&Qn(Gn,a)||(Gn=a,a=Ei(fc,"onSelect"),0>=c,n-=c,ct=1<<32-dl(l)+n|t<ie?(me=K,K=null):me=K.sibling;var be=S(p,K,g[ie],M);if(be===null){K===null&&(K=me);break}e&&K&&be.alternate===null&&l(p,K),h=u(be,h,ie),ve===null?J=be:ve.sibling=be,ve=be,K=me}if(ie===g.length)return t(p,K),he&&_t(p,ie),J;if(K===null){for(;ieie?(me=K,K=null):me=K.sibling;var da=S(p,K,be.value,M);if(da===null){K===null&&(K=me);break}e&&K&&da.alternate===null&&l(p,K),h=u(da,h,ie),ve===null?J=da:ve.sibling=da,ve=da,K=me}if(be.done)return t(p,K),he&&_t(p,ie),J;if(K===null){for(;!be.done;ie++,be=g.next())be=A(p,be.value,M),be!==null&&(h=u(be,h,ie),ve===null?J=be:ve.sibling=be,ve=be);return he&&_t(p,ie),J}for(K=a(K);!be.done;ie++,be=g.next())be=z(K,p,ie,be.value,M),be!==null&&(e&&be.alternate!==null&&K.delete(be.key===null?ie:be.key),h=u(be,h,ie),ve===null?J=be:ve.sibling=be,ve=be);return e&&K.forEach(function(Kp){return l(p,Kp)}),he&&_t(p,ie),J}function Me(p,h,g,M){if(typeof g=="object"&&g!==null&&g.type===se&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case oe:e:{for(var J=g.key;h!==null;){if(h.key===J){if(J=g.type,J===se){if(h.tag===7){t(p,h.sibling),M=n(h,g.props.children),M.return=p,p=M;break e}}else if(h.elementType===J||typeof J=="object"&&J!==null&&J.$$typeof===P&&Ma(J)===h.type){t(p,h.sibling),M=n(h,g.props),Kn(M,g),M.return=p,p=M;break e}t(p,h);break}else l(p,h);h=h.sibling}g.type===se?(M=ja(g.props.children,p.mode,M,g.key),M.return=p,p=M):(M=Zu(g.type,g.key,g.props,null,p.mode,M),Kn(M,g),M.return=p,p=M)}return c(p);case Be:e:{for(J=g.key;h!==null;){if(h.key===J)if(h.tag===4&&h.stateNode.containerInfo===g.containerInfo&&h.stateNode.implementation===g.implementation){t(p,h.sibling),M=n(h,g.children||[]),M.return=p,p=M;break e}else{t(p,h);break}else l(p,h);h=h.sibling}M=gc(g,p.mode,M),M.return=p,p=M}return c(p);case P:return g=Ma(g),Me(p,h,g,M)}if(Je(g))return w(p,h,g,M);if(C(g)){if(J=C(g),typeof J!="function")throw Error(r(150));return g=J.call(g),I(p,h,g,M)}if(typeof g.then=="function")return Me(p,h,Wu(g),M);if(g.$$typeof===X)return Me(p,h,Ku(p,g),M);Fu(p,g)}return typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint"?(g=""+g,h!==null&&h.tag===6?(t(p,h.sibling),M=n(h,g),M.return=p,p=M):(t(p,h),M=yc(g,p.mode,M),M.return=p,p=M),c(p)):t(p,h)}return function(p,h,g,M){try{Vn=0;var J=Me(p,h,g,M);return un=null,J}catch(K){if(K===nn||K===Ju)throw K;var ve=El(29,K,null,p.mode);return ve.lanes=M,ve.return=p,ve}finally{}}}var Oa=xr(!0),jr=xr(!1),$t=!1;function Ac(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Oc(e,l){e=e.updateQueue,l.updateQueue===e&&(l.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Wt(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ft(e,l,t){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Se&2)!==0){var n=a.pending;return n===null?l.next=l:(l.next=n.next,n.next=l),a.pending=l,l=Xu(e),ir(e,null,t),l}return Lu(e,a,l,t),Xu(e)}function kn(e,l,t){if(l=l.updateQueue,l!==null&&(l=l.shared,(t&4194048)!==0)){var a=l.lanes;a&=e.pendingLanes,t|=a,l.lanes=t,zl(e,t)}}function Dc(e,l){var t=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,t===a)){var n=null,u=null;if(t=t.firstBaseUpdate,t!==null){do{var c={lane:t.lane,tag:t.tag,payload:t.payload,callback:null,next:null};u===null?n=u=c:u=u.next=c,t=t.next}while(t!==null);u===null?n=u=l:u=u.next=l}else n=u=l;t={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},e.updateQueue=t;return}e=t.lastBaseUpdate,e===null?t.firstBaseUpdate=l:e.next=l,t.lastBaseUpdate=l}var Cc=!1;function Jn(){if(Cc){var e=an;if(e!==null)throw e}}function $n(e,l,t,a){Cc=!1;var n=e.updateQueue;$t=!1;var u=n.firstBaseUpdate,c=n.lastBaseUpdate,s=n.shared.pending;if(s!==null){n.shared.pending=null;var m=s,v=m.next;m.next=null,c===null?u=v:c.next=v,c=m;var E=e.alternate;E!==null&&(E=E.updateQueue,s=E.lastBaseUpdate,s!==c&&(s===null?E.firstBaseUpdate=v:s.next=v,E.lastBaseUpdate=m))}if(u!==null){var A=n.baseState;c=0,E=v=m=null,s=u;do{var S=s.lane&-536870913,z=S!==s.lane;if(z?(de&S)===S:(a&S)===S){S!==0&&S===tn&&(Cc=!0),E!==null&&(E=E.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var w=e,I=s;S=l;var Me=t;switch(I.tag){case 1:if(w=I.payload,typeof w=="function"){A=w.call(Me,A,S);break e}A=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=I.payload,S=typeof w=="function"?w.call(Me,A,S):w,S==null)break e;A=L({},A,S);break e;case 2:$t=!0}}S=s.callback,S!==null&&(e.flags|=64,z&&(e.flags|=8192),z=n.callbacks,z===null?n.callbacks=[S]:z.push(S))}else z={lane:S,tag:s.tag,payload:s.payload,callback:s.callback,next:null},E===null?(v=E=z,m=A):E=E.next=z,c|=S;if(s=s.next,s===null){if(s=n.shared.pending,s===null)break;z=s,s=z.next,z.next=null,n.lastBaseUpdate=z,n.shared.pending=null}}while(!0);E===null&&(m=A),n.baseState=m,n.firstBaseUpdate=v,n.lastBaseUpdate=E,u===null&&(n.shared.lanes=0),ta|=c,e.lanes=c,e.memoizedState=A}}function zr(e,l){if(typeof e!="function")throw Error(r(191,e));e.call(l)}function Nr(e,l){var t=e.callbacks;if(t!==null)for(e.callbacks=null,e=0;eu?u:8;var c=N.T,s={};N.T=s,Fc(e,!1,l,t);try{var m=n(),v=N.S;if(v!==null&&v(s,m),m!==null&&typeof m=="object"&&typeof m.then=="function"){var E=Rh(m,a);In(e,l,E,Dl(e))}else In(e,l,a,Dl(e))}catch(A){In(e,l,{then:function(){},status:"rejected",reason:A},Dl())}finally{Q.p=u,c!==null&&s.types!==null&&(c.types=s.types),N.T=c}}function Lh(){}function $c(e,l,t,a){if(e.tag!==5)throw Error(r(476));var n=ao(e).queue;to(e,n,l,$,t===null?Lh:function(){return no(e),t(a)})}function ao(e){var l=e.memoizedState;if(l!==null)return l;l={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nt,lastRenderedState:$},next:null};var t={};return l.next={memoizedState:t,baseState:t,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nt,lastRenderedState:t},next:null},e.memoizedState=l,e=e.alternate,e!==null&&(e.memoizedState=l),l}function no(e){var l=ao(e);l.next===null&&(l=e.alternate.memoizedState),In(e,l.next.queue,{},Dl())}function Wc(){return fl(pu)}function uo(){return Ke().memoizedState}function io(){return Ke().memoizedState}function Xh(e){for(var l=e.return;l!==null;){switch(l.tag){case 24:case 3:var t=Dl();e=Wt(t);var a=Ft(l,e,t);a!==null&&(xl(a,l,t),kn(a,l,t)),l={cache:Nc()},e.payload=l;return}l=l.return}}function Zh(e,l,t){var a=Dl();t={lane:a,revertLane:0,gesture:null,action:t,hasEagerState:!1,eagerState:null,next:null},ci(e)?so(l,t):(t=hc(e,l,t,a),t!==null&&(xl(t,e,a),fo(t,l,a)))}function co(e,l,t){var a=Dl();In(e,l,t,a)}function In(e,l,t,a){var n={lane:a,revertLane:0,gesture:null,action:t,hasEagerState:!1,eagerState:null,next:null};if(ci(e))so(l,n);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=l.lastRenderedReducer,u!==null))try{var c=l.lastRenderedState,s=u(c,t);if(n.hasEagerState=!0,n.eagerState=s,Nl(s,c))return Lu(e,l,n,0),Oe===null&&Gu(),!1}catch{}finally{}if(t=hc(e,l,n,a),t!==null)return xl(t,e,a),fo(t,l,a),!0}return!1}function Fc(e,l,t,a){if(a={lane:2,revertLane:As(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ci(e)){if(l)throw Error(r(479))}else l=hc(e,t,a,2),l!==null&&xl(l,e,2)}function ci(e){var l=e.alternate;return e===ne||l!==null&&l===ne}function so(e,l){sn=ei=!0;var t=e.pending;t===null?l.next=l:(l.next=t.next,t.next=l),e.pending=l}function fo(e,l,t){if((t&4194048)!==0){var a=l.lanes;a&=e.pendingLanes,t|=a,l.lanes=t,zl(e,t)}}var Pn={readContext:fl,use:ai,useCallback:Xe,useContext:Xe,useEffect:Xe,useImperativeHandle:Xe,useLayoutEffect:Xe,useInsertionEffect:Xe,useMemo:Xe,useReducer:Xe,useRef:Xe,useState:Xe,useDebugValue:Xe,useDeferredValue:Xe,useTransition:Xe,useSyncExternalStore:Xe,useId:Xe,useHostTransitionStatus:Xe,useFormState:Xe,useActionState:Xe,useOptimistic:Xe,useMemoCache:Xe,useCacheRefresh:Xe};Pn.useEffectEvent=Xe;var ro={readContext:fl,use:ai,useCallback:function(e,l){return pl().memoizedState=[e,l===void 0?null:l],e},useContext:fl,useEffect:kr,useImperativeHandle:function(e,l,t){t=t!=null?t.concat([e]):null,ui(4194308,4,Fr.bind(null,l,e),t)},useLayoutEffect:function(e,l){return ui(4194308,4,e,l)},useInsertionEffect:function(e,l){ui(4,2,e,l)},useMemo:function(e,l){var t=pl();l=l===void 0?null:l;var a=e();if(Da){wl(!0);try{e()}finally{wl(!1)}}return t.memoizedState=[a,l],a},useReducer:function(e,l,t){var a=pl();if(t!==void 0){var n=t(l);if(Da){wl(!0);try{t(l)}finally{wl(!1)}}}else n=l;return a.memoizedState=a.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},a.queue=e,e=e.dispatch=Zh.bind(null,ne,e),[a.memoizedState,e]},useRef:function(e){var l=pl();return e={current:e},l.memoizedState=e},useState:function(e){e=wc(e);var l=e.queue,t=co.bind(null,ne,l);return l.dispatch=t,[e.memoizedState,t]},useDebugValue:kc,useDeferredValue:function(e,l){var t=pl();return Jc(t,e,l)},useTransition:function(){var e=wc(!1);return e=to.bind(null,ne,e.queue,!0,!1),pl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,l,t){var a=ne,n=pl();if(he){if(t===void 0)throw Error(r(407));t=t()}else{if(t=l(),Oe===null)throw Error(r(349));(de&127)!==0||Dr(a,l,t)}n.memoizedState=t;var u={value:t,getSnapshot:l};return n.queue=u,kr(qr.bind(null,a,u,e),[e]),a.flags|=2048,rn(9,{destroy:void 0},Cr.bind(null,a,u,t,l),null),t},useId:function(){var e=pl(),l=Oe.identifierPrefix;if(he){var t=st,a=ct;t=(a&~(1<<32-dl(a)-1)).toString(32)+t,l="_"+l+"R_"+t,t=li++,0<\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?c.createElement("select",{is:a.is}):c.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?c.createElement(n,{is:a.is}):c.createElement(n)}}u[ll]=l,u[nl]=a;e:for(c=l.child;c!==null;){if(c.tag===5||c.tag===6)u.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break e;for(;c.sibling===null;){if(c.return===null||c.return===l)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}l.stateNode=u;e:switch(ol(u,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&&Tt(l)}}return He(l),os(l,l.type,e===null?null:e.memoizedProps,l.pendingProps,t),null;case 6:if(e&&l.stateNode!=null)e.memoizedProps!==a&&Tt(l);else{if(typeof a!="string"&&l.stateNode===null)throw Error(r(166));if(e=ue.current,en(l)){if(e=l.stateNode,t=l.memoizedProps,a=null,n=sl,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}e[ll]=l,e=!!(e.nodeValue===t||a!==null&&a.suppressHydrationWarning===!0||Od(e.nodeValue,t)),e||kt(l,!0)}else e=Ti(e).createTextNode(a),e[ll]=l,l.stateNode=e}return He(l),null;case 31:if(t=l.memoizedState,e===null||e.memoizedState!==null){if(a=en(l),t!==null){if(e===null){if(!a)throw Error(r(318));if(e=l.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[ll]=l}else za(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;He(l),e=!1}else t=_c(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=t),e=!0;if(!e)return l.flags&256?(Ml(l),l):(Ml(l),null);if((l.flags&128)!==0)throw Error(r(558))}return He(l),null;case 13:if(a=l.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=en(l),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(r(318));if(n=l.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));n[ll]=l}else za(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;He(l),n=!1}else n=_c(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return l.flags&256?(Ml(l),l):(Ml(l),null)}return Ml(l),(l.flags&128)!==0?(l.lanes=t,l):(t=a!==null,e=e!==null&&e.memoizedState!==null,t&&(a=l.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==n&&(a.flags|=2048)),t!==e&&t&&(l.child.flags|=8192),di(l,l.updateQueue),He(l),null);case 4:return De(),e===null&&qs(l.stateNode.containerInfo),He(l),null;case 10:return jt(l.type),He(l),null;case 19:if(j(Ve),a=l.memoizedState,a===null)return He(l),null;if(n=(l.flags&128)!==0,u=a.rendering,u===null)if(n)lu(a,!1);else{if(Ze!==0||e!==null&&(e.flags&128)!==0)for(e=l.child;e!==null;){if(u=Pu(e),u!==null){for(l.flags|=128,lu(a,!1),e=u.updateQueue,l.updateQueue=e,di(l,e),l.subtreeFlags=0,e=t,t=l.child;t!==null;)cr(t,e),t=t.sibling;return Y(Ve,Ve.current&1|2),he&&_t(l,a.treeForkCount),l.child}e=e.sibling}a.tail!==null&&ce()>gi&&(l.flags|=128,n=!0,lu(a,!1),l.lanes=4194304)}else{if(!n)if(e=Pu(u),e!==null){if(l.flags|=128,n=!0,e=e.updateQueue,l.updateQueue=e,di(l,e),lu(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!he)return He(l),null}else 2*ce()-a.renderingStartTime>gi&&t!==536870912&&(l.flags|=128,n=!0,lu(a,!1),l.lanes=4194304);a.isBackwards?(u.sibling=l.child,l.child=u):(e=a.last,e!==null?e.sibling=u:l.child=u,a.last=u)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=ce(),e.sibling=null,t=Ve.current,Y(Ve,n?t&1|2:t&1),he&&_t(l,a.treeForkCount),e):(He(l),null);case 22:case 23:return Ml(l),Uc(),a=l.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(l.flags|=8192):a&&(l.flags|=8192),a?(t&536870912)!==0&&(l.flags&128)===0&&(He(l),l.subtreeFlags&6&&(l.flags|=8192)):He(l),t=l.updateQueue,t!==null&&di(l,t.retryQueue),t=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),a=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(a=l.memoizedState.cachePool.pool),a!==t&&(l.flags|=2048),e!==null&&j(Ta),null;case 24:return t=null,e!==null&&(t=e.memoizedState.cache),l.memoizedState.cache!==t&&(l.flags|=2048),jt(We),He(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function Jh(e,l){switch(bc(l),l.tag){case 1:return e=l.flags,e&65536?(l.flags=e&-65537|128,l):null;case 3:return jt(We),De(),e=l.flags,(e&65536)!==0&&(e&128)===0?(l.flags=e&-65537|128,l):null;case 26:case 27:case 5:return ma(l),null;case 31:if(l.memoizedState!==null){if(Ml(l),l.alternate===null)throw Error(r(340));za()}return e=l.flags,e&65536?(l.flags=e&-65537|128,l):null;case 13:if(Ml(l),e=l.memoizedState,e!==null&&e.dehydrated!==null){if(l.alternate===null)throw Error(r(340));za()}return e=l.flags,e&65536?(l.flags=e&-65537|128,l):null;case 19:return j(Ve),null;case 4:return De(),null;case 10:return jt(l.type),null;case 22:case 23:return Ml(l),Uc(),e!==null&&j(Ta),e=l.flags,e&65536?(l.flags=e&-65537|128,l):null;case 24:return jt(We),null;case 25:return null;default:return null}}function Ro(e,l){switch(bc(l),l.tag){case 3:jt(We),De();break;case 26:case 27:case 5:ma(l);break;case 4:De();break;case 31:l.memoizedState!==null&&Ml(l);break;case 13:Ml(l);break;case 19:j(Ve);break;case 10:jt(l.type);break;case 22:case 23:Ml(l),Uc(),e!==null&&j(Ta);break;case 24:jt(We)}}function tu(e,l){try{var t=l.updateQueue,a=t!==null?t.lastEffect:null;if(a!==null){var n=a.next;t=n;do{if((t.tag&e)===e){a=void 0;var u=t.create,c=t.inst;a=u(),c.destroy=a}t=t.next}while(t!==n)}}catch(s){Ne(l,l.return,s)}}function ea(e,l,t){try{var a=l.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var u=n.next;a=u;do{if((a.tag&e)===e){var c=a.inst,s=c.destroy;if(s!==void 0){c.destroy=void 0,n=l;var m=t,v=s;try{v()}catch(E){Ne(n,m,E)}}}a=a.next}while(a!==u)}}catch(E){Ne(l,l.return,E)}}function Ho(e){var l=e.updateQueue;if(l!==null){var t=e.stateNode;try{Nr(l,t)}catch(a){Ne(e,e.return,a)}}}function Bo(e,l,t){t.props=Ca(e.type,e.memoizedProps),t.state=e.memoizedState;try{t.componentWillUnmount()}catch(a){Ne(e,l,a)}}function au(e,l){try{var t=e.ref;if(t!==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 t=="function"?e.refCleanup=t(a):t.current=a}}catch(n){Ne(e,l,n)}}function ft(e,l){var t=e.ref,a=e.refCleanup;if(t!==null)if(typeof a=="function")try{a()}catch(n){Ne(e,l,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof t=="function")try{t(null)}catch(n){Ne(e,l,n)}else t.current=null}function Yo(e){var l=e.type,t=e.memoizedProps,a=e.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":t.autoFocus&&a.focus();break e;case"img":t.src?a.src=t.src:t.srcSet&&(a.srcset=t.srcSet)}}catch(n){Ne(e,e.return,n)}}function ds(e,l,t){try{var a=e.stateNode;yp(a,e.type,t,l),a[nl]=l}catch(n){Ne(e,e.return,n)}}function Qo(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ca(e.type)||e.tag===4}function ms(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Qo(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 hs(e,l,t){var a=e.tag;if(a===5||a===6)e=e.stateNode,l?(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t).insertBefore(e,l):(l=t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.appendChild(e),t=t._reactRootContainer,t!=null||l.onclick!==null||(l.onclick=vt));else if(a!==4&&(a===27&&ca(e.type)&&(t=e.stateNode,l=null),e=e.child,e!==null))for(hs(e,l,t),e=e.sibling;e!==null;)hs(e,l,t),e=e.sibling}function mi(e,l,t){var a=e.tag;if(a===5||a===6)e=e.stateNode,l?t.insertBefore(e,l):t.appendChild(e);else if(a!==4&&(a===27&&ca(e.type)&&(t=e.stateNode),e=e.child,e!==null))for(mi(e,l,t),e=e.sibling;e!==null;)mi(e,l,t),e=e.sibling}function Go(e){var l=e.stateNode,t=e.memoizedProps;try{for(var a=e.type,n=l.attributes;n.length;)l.removeAttributeNode(n[0]);ol(l,a,t),l[ll]=e,l[nl]=t}catch(u){Ne(e,e.return,u)}}var Mt=!1,Pe=!1,ps=!1,Lo=typeof WeakSet=="function"?WeakSet:Set,il=null;function $h(e,l){if(e=e.containerInfo,Hs=Ui,e=If(e),sc(e)){if("selectionStart"in e)var t={start:e.selectionStart,end:e.selectionEnd};else e:{t=(t=e.ownerDocument)&&t.defaultView||window;var a=t.getSelection&&t.getSelection();if(a&&a.rangeCount!==0){t=a.anchorNode;var n=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{t.nodeType,u.nodeType}catch{t=null;break e}var c=0,s=-1,m=-1,v=0,E=0,A=e,S=null;l:for(;;){for(var z;A!==t||n!==0&&A.nodeType!==3||(s=c+n),A!==u||a!==0&&A.nodeType!==3||(m=c+a),A.nodeType===3&&(c+=A.nodeValue.length),(z=A.firstChild)!==null;)S=A,A=z;for(;;){if(A===e)break l;if(S===t&&++v===n&&(s=c),S===u&&++E===a&&(m=c),(z=A.nextSibling)!==null)break;A=S,S=A.parentNode}A=z}t=s===-1||m===-1?null:{start:s,end:m}}else t=null}t=t||{start:0,end:0}}else t=null;for(Bs={focusedElem:e,selectionRange:t},Ui=!1,il=l;il!==null;)if(l=il,e=l.child,(l.subtreeFlags&1028)!==0&&e!==null)e.return=l,il=e;else for(;il!==null;){switch(l=il,u=l.alternate,e=l.flags,l.tag){case 0:if((e&4)!==0&&(e=l.updateQueue,e=e!==null?e.events:null,e!==null))for(t=0;t title"))),ol(u,a,t),u[ll]=e,$e(u),a=u;break e;case"link":var c=kd("link","href",n).get(a+(t.href||""));if(c){for(var s=0;sMe&&(c=Me,Me=I,I=c);var p=Wf(s,I),h=Wf(s,Me);if(p&&h&&(z.rangeCount!==1||z.anchorNode!==p.node||z.anchorOffset!==p.offset||z.focusNode!==h.node||z.focusOffset!==h.offset)){var g=A.createRange();g.setStart(p.node,p.offset),z.removeAllRanges(),I>Me?(z.addRange(g),z.extend(h.node,h.offset)):(g.setEnd(h.node,h.offset),z.addRange(g))}}}}for(A=[],z=s;z=z.parentNode;)z.nodeType===1&&A.push({element:z,left:z.scrollLeft,top:z.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;st?32:t,N.T=null,t=xs,xs=null;var u=na,c=qt;if(tl=0,pn=na=null,qt=0,(Se&6)!==0)throw Error(r(331));var s=Se;if(Se|=4,Io(u.current),$o(u,u.current,c,t),Se=s,fu(0,!1),Ge&&typeof Ge.onPostCommitFiberRoot=="function")try{Ge.onPostCommitFiberRoot(_e,u)}catch{}return!0}finally{Q.p=n,N.T=a,yd(e,l)}}function vd(e,l,t){l=Bl(t,l),l=ls(e.stateNode,l,2),e=Ft(e,l,2),e!==null&&(Kl(e,2),rt(e))}function Ne(e,l,t){if(e.tag===3)vd(e,e,t);else for(;l!==null;){if(l.tag===3){vd(l,e,t);break}else if(l.tag===1){var a=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(aa===null||!aa.has(a))){e=Bl(t,e),t=bo(2),a=Ft(l,t,2),a!==null&&(So(t,a,l,e),Kl(a,2),rt(a));break}}l=l.return}}function Es(e,l,t){var a=e.pingCache;if(a===null){a=e.pingCache=new Ih;var n=new Set;a.set(l,n)}else n=a.get(l),n===void 0&&(n=new Set,a.set(l,n));n.has(t)||(vs=!0,n.add(t),e=ap.bind(null,e,l,t),l.then(e,e))}function ap(e,l,t){var a=e.pingCache;a!==null&&a.delete(l),e.pingedLanes|=e.suspendedLanes&t,e.warmLanes&=~t,Oe===e&&(de&t)===t&&(Ze===4||Ze===3&&(de&62914560)===de&&300>ce()-yi?(Se&2)===0&&yn(e,0):bs|=t,hn===de&&(hn=0)),rt(e)}function bd(e,l){l===0&&(l=En()),e=xa(e,l),e!==null&&(Kl(e,l),rt(e))}function np(e){var l=e.memoizedState,t=0;l!==null&&(t=l.retryLane),bd(e,t)}function up(e,l){var t=0;switch(e.tag){case 31:case 13:var a=e.stateNode,n=e.memoizedState;n!==null&&(t=n.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(r(314))}a!==null&&a.delete(l),bd(e,t)}function ip(e,l){return Bt(e,l)}var ji=null,vn=null,Ts=!1,zi=!1,Ms=!1,ia=0;function rt(e){e!==vn&&e.next===null&&(vn===null?ji=vn=e:vn=vn.next=e),zi=!0,Ts||(Ts=!0,sp())}function fu(e,l){if(!Ms&&zi){Ms=!0;do for(var t=!1,a=ji;a!==null;){if(e!==0){var n=a.pendingLanes;if(n===0)var u=0;else{var c=a.suspendedLanes,s=a.pingedLanes;u=(1<<31-dl(42|e)+1)-1,u&=n&~(c&~s),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(t=!0,jd(a,u))}else u=de,u=Vl(a,a===Oe?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||Lt(a,u)||(t=!0,jd(a,u));a=a.next}while(t);Ms=!1}}function cp(){Sd()}function Sd(){zi=Ts=!1;var e=0;ia!==0&&vp()&&(e=ia);for(var l=ce(),t=null,a=ji;a!==null;){var n=a.next,u=_d(a,l);u===0?(a.next=null,t===null?ji=n:t.next=n,n===null&&(vn=t)):(t=a,(e!==0||(u&3)!==0)&&(zi=!0)),a=n}tl!==0&&tl!==5||fu(e),ia!==0&&(ia=0)}function _d(e,l){for(var t=e.suspendedLanes,a=e.pingedLanes,n=e.expirationTimes,u=e.pendingLanes&-62914561;0s)break;var E=m.transferSize,A=m.initiatorType;E&&Dd(A)&&(m=m.responseEnd,c+=E*(m"u"?null:document;function Zd(e,l,t){var a=bn;if(a&&typeof l=="string"&&l){var n=Rl(l);n='link[rel="'+e+'"][href="'+n+'"]',typeof t=="string"&&(n+='[crossorigin="'+t+'"]'),Xd.has(n)||(Xd.add(n),e={rel:e,crossOrigin:t,href:l},a.querySelector(n)===null&&(l=a.createElement("link"),ol(l,"link",e),$e(l),a.head.appendChild(l)))}}function Tp(e){Ut.D(e),Zd("dns-prefetch",e,null)}function Mp(e,l){Ut.C(e,l),Zd("preconnect",e,l)}function Ap(e,l,t){Ut.L(e,l,t);var a=bn;if(a&&e&&l){var n='link[rel="preload"][as="'+Rl(l)+'"]';l==="image"&&t&&t.imageSrcSet?(n+='[imagesrcset="'+Rl(t.imageSrcSet)+'"]',typeof t.imageSizes=="string"&&(n+='[imagesizes="'+Rl(t.imageSizes)+'"]')):n+='[href="'+Rl(e)+'"]';var u=n;switch(l){case"style":u=Sn(e);break;case"script":u=_n(e)}Zl.has(u)||(e=L({rel:"preload",href:l==="image"&&t&&t.imageSrcSet?void 0:e,as:l},t),Zl.set(u,e),a.querySelector(n)!==null||l==="style"&&a.querySelector(mu(u))||l==="script"&&a.querySelector(hu(u))||(l=a.createElement("link"),ol(l,"link",e),$e(l),a.head.appendChild(l)))}}function Op(e,l){Ut.m(e,l);var t=bn;if(t&&e){var a=l&&typeof l.as=="string"?l.as:"script",n='link[rel="modulepreload"][as="'+Rl(a)+'"][href="'+Rl(e)+'"]',u=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=_n(e)}if(!Zl.has(u)&&(e=L({rel:"modulepreload",href:e},l),Zl.set(u,e),t.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(t.querySelector(hu(u)))return}a=t.createElement("link"),ol(a,"link",e),$e(a),t.head.appendChild(a)}}}function Dp(e,l,t){Ut.S(e,l,t);var a=bn;if(a&&e){var n=Zt(a).hoistableStyles,u=Sn(e);l=l||"default";var c=n.get(u);if(!c){var s={loading:0,preload:null};if(c=a.querySelector(mu(u)))s.loading=5;else{e=L({rel:"stylesheet",href:e,"data-precedence":l},t),(t=Zl.get(u))&&ws(e,t);var m=c=a.createElement("link");$e(m),ol(m,"link",e),m._p=new Promise(function(v,E){m.onload=v,m.onerror=E}),m.addEventListener("load",function(){s.loading|=1}),m.addEventListener("error",function(){s.loading|=2}),s.loading|=4,Ai(c,l,a)}c={type:"stylesheet",instance:c,count:1,state:s},n.set(u,c)}}}function Cp(e,l){Ut.X(e,l);var t=bn;if(t&&e){var a=Zt(t).hoistableScripts,n=_n(e),u=a.get(n);u||(u=t.querySelector(hu(n)),u||(e=L({src:e,async:!0},l),(l=Zl.get(n))&&Vs(e,l),u=t.createElement("script"),$e(u),ol(u,"link",e),t.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function qp(e,l){Ut.M(e,l);var t=bn;if(t&&e){var a=Zt(t).hoistableScripts,n=_n(e),u=a.get(n);u||(u=t.querySelector(hu(n)),u||(e=L({src:e,async:!0,type:"module"},l),(l=Zl.get(n))&&Vs(e,l),u=t.createElement("script"),$e(u),ol(u,"link",e),t.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function wd(e,l,t,a){var n=(n=ue.current)?Mi(n):null;if(!n)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof t.precedence=="string"&&typeof t.href=="string"?(l=Sn(t.href),t=Zt(n).hoistableStyles,a=t.get(l),a||(a={type:"style",instance:null,count:0,state:null},t.set(l,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(t.rel==="stylesheet"&&typeof t.href=="string"&&typeof t.precedence=="string"){e=Sn(t.href);var u=Zt(n).hoistableStyles,c=u.get(e);if(c||(n=n.ownerDocument||n,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,c),(u=n.querySelector(mu(e)))&&!u._p&&(c.instance=u,c.state.loading=5),Zl.has(e)||(t={rel:"preload",as:"style",href:t.href,crossOrigin:t.crossOrigin,integrity:t.integrity,media:t.media,hrefLang:t.hrefLang,referrerPolicy:t.referrerPolicy},Zl.set(e,t),u||Up(n,e,t,c.state))),l&&a===null)throw Error(r(528,""));return c}if(l&&a!==null)throw Error(r(529,""));return null;case"script":return l=t.async,t=t.src,typeof t=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=_n(t),t=Zt(n).hoistableScripts,a=t.get(l),a||(a={type:"script",instance:null,count:0,state:null},t.set(l,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Sn(e){return'href="'+Rl(e)+'"'}function mu(e){return'link[rel="stylesheet"]['+e+"]"}function Vd(e){return L({},e,{"data-precedence":e.precedence,precedence:null})}function Up(e,l,t,a){e.querySelector('link[rel="preload"][as="style"]['+l+"]")?a.loading=1:(l=e.createElement("link"),a.preload=l,l.addEventListener("load",function(){return a.loading|=1}),l.addEventListener("error",function(){return a.loading|=2}),ol(l,"link",t),$e(l),e.head.appendChild(l))}function _n(e){return'[src="'+Rl(e)+'"]'}function hu(e){return"script[async]"+e}function Kd(e,l,t){if(l.count++,l.instance===null)switch(l.type){case"style":var a=e.querySelector('style[data-href~="'+Rl(t.href)+'"]');if(a)return l.instance=a,$e(a),a;var n=L({},t,{"data-href":t.href,"data-precedence":t.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),$e(a),ol(a,"style",n),Ai(a,t.precedence,e),l.instance=a;case"stylesheet":n=Sn(t.href);var u=e.querySelector(mu(n));if(u)return l.state.loading|=4,l.instance=u,$e(u),u;a=Vd(t),(n=Zl.get(n))&&ws(a,n),u=(e.ownerDocument||e).createElement("link"),$e(u);var c=u;return c._p=new Promise(function(s,m){c.onload=s,c.onerror=m}),ol(u,"link",a),l.state.loading|=4,Ai(u,t.precedence,e),l.instance=u;case"script":return u=_n(t.src),(n=e.querySelector(hu(u)))?(l.instance=n,$e(n),n):(a=t,(n=Zl.get(u))&&(a=L({},t),Vs(a,n)),e=e.ownerDocument||e,n=e.createElement("script"),$e(n),ol(n,"link",a),e.head.appendChild(n),l.instance=n);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(a=l.instance,l.state.loading|=4,Ai(a,t.precedence,e));return l.instance}function Ai(e,l,t){for(var a=t.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,u=n,c=0;c title"):null)}function Rp(e,l,t){if(t===1||l.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return e=l.disabled,typeof l.precedence=="string"&&e==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function $d(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Hp(e,l,t,a){if(t.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var n=Sn(a.href),u=l.querySelector(mu(n));if(u){l=u._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(e.count++,e=Di.bind(e),l.then(e,e)),t.state.loading|=4,t.instance=u,$e(u);return}u=l.ownerDocument||l,a=Vd(a),(n=Zl.get(n))&&ws(a,n),u=u.createElement("link"),$e(u);var c=u;c._p=new Promise(function(s,m){c.onload=s,c.onerror=m}),ol(u,"link",a),t.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(t,l),(l=t.state.preload)&&(t.state.loading&3)===0&&(e.count++,t=Di.bind(e),l.addEventListener("load",t),l.addEventListener("error",t))}}var Ks=0;function Bp(e,l){return e.stylesheets&&e.count===0&&qi(e,e.stylesheets),0Ks?50:800)+l);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function Di(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)qi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ci=null;function qi(e,l){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ci=new Map,l.forEach(Yp,e),Ci=null,Di.call(e))}function Yp(e,l){if(!(l.state.loading&4)){var t=Ci.get(e);if(t)var a=t.get(null);else{t=new Map,Ci.set(e,t);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f)}catch(b){console.error(b)}}return f(),lf.exports=e0(),lf.exports}var t0=l0();/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const a0=f=>f.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Om=(...f)=>f.filter((b,_,r)=>!!b&&b.trim()!==""&&r.indexOf(b)===_).join(" ").trim();/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var n0={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"};/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const u0=R.forwardRef(({color:f="currentColor",size:b=24,strokeWidth:_=2,absoluteStrokeWidth:r,className:D="",children:H,iconNode:q,...F},B)=>R.createElement("svg",{ref:B,...n0,width:b,height:b,stroke:f,strokeWidth:r?Number(_)*24/Number(b):_,className:Om("lucide",D),...F},[...q.map(([T,ee])=>R.createElement(T,ee)),...Array.isArray(H)?H:[H]]));/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Le=(f,b)=>{const _=R.forwardRef(({className:r,...D},H)=>R.createElement(u0,{ref:H,iconNode:b,className:Om(`lucide-${a0(f)}`,r),...D}));return _.displayName=`${f}`,_};/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Xi=Le("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const i0=Le("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const bm=Le("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"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pf=Le("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Dm=Le("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const c0=Le("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const uf=Le("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ha=Le("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"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yf=Le("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const s0=Le("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Cm=Le("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Sm=Le("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"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const cf=Le("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const f0=Le("Focus",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const r0=Le("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const o0=Le("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ra=Le("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const d0=Le("Move3d",[["path",{d:"M5 3v16h16",key:"1mqmf9"}],["path",{d:"m5 19 6-6",key:"jh6hbb"}],["path",{d:"m2 6 3-3 3 3",key:"tkyvxa"}],["path",{d:"m18 16 3 3-3 3",key:"1d4glt"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const m0=Le("Rotate3d",[["path",{d:"M16.466 7.5C15.643 4.237 13.952 2 12 2 9.239 2 7 6.477 7 12s2.239 10 5 10c.342 0 .677-.069 1-.2",key:"10n0gc"}],["path",{d:"m15.194 13.707 3.814 1.86-1.86 3.814",key:"16shm9"}],["path",{d:"M19 15.57c-1.804.885-4.274 1.43-7 1.43-5.523 0-10-2.239-10-5s4.477-5 10-5c4.838 0 8.873 1.718 9.8 4",key:"1lxi77"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qm=Le("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const _m=Le("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const sf=Le("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const h0=Le("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Um(f,b){if(typeof f=="string")return f;if(Array.isArray(f)){const _=f.map(r=>{if(typeof r=="object"&&r!==null){if("msg"in r&&typeof r.msg=="string")return r.msg;if("message"in r&&typeof r.message=="string"){const D="file"in r&&typeof r.file=="string"?r.file:null,H="line"in r&&typeof r.line=="number"?r.line:null,q=D?`${D}${H==null?"":`:${H}`}`:null;return q?`${r.message} · ${q}`:r.message}}return null}).filter(r=>!!r);if(_.length)return _.join(" ")}return b}async function Vi(f){if(!f.ok){const b=await f.json().catch(()=>null);throw new Error(Um(b==null?void 0:b.detail,`Request failed (${f.status})`))}return f.json()}async function p0(){return Vi(await fetch("/api/bootstrap"))}async function y0(f){const b=new FormData;return b.append("file",f),Vi(await fetch("/api/structure/analyze",{method:"POST",body:b}))}async function g0(f,b,_){const r=new FormData;return r.append("file",f),r.append("sigma_angstrom",String(b)),r.append("seed",String(_)),Vi(await fetch("/api/structure/perturb",{method:"POST",body:r}))}async function v0(f,b,_,r,D){return Vi(await fetch("/api/plan/render",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({setup:f,equilibration:b,sampling_run_count:_,setup_files:r,structure:D})}))}async function b0(f,b,_,r,D,H,q){const F=await fetch("/api/project/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({setup:f,structure:b,project_name:_,preparation:r,equilibration:D,sampling_run_count:H,setup_files:q})});if(!F.ok){const B=await F.json().catch(()=>null);throw new Error(Um(B==null?void 0:B.detail,`Export failed (${F.status})`))}return F.blob()}const Rm=["Suggested","Problems","Workflow","Scientific setup","Parameters","Inputs","Actions"];function Zi(f){return f.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/[^a-z0-9]+/g," ").trim()}function ff(f){return Zi(f).split(/\s+/).filter(Boolean)}function S0(f,b){const _=Zi(b);if(!_)return f.featured?0:null;const r=Zi(f.label),D=Zi([f.detail,f.hint,...f.keywords??[]].filter(Boolean).join(" ")),H=ff(f.label),q=ff(`${f.label} ${D}`),F=ff(_);let B=0;r===_?B+=160:r.startsWith(_)?B+=110:r.includes(_)&&(B+=70);for(const T of F){const ee=H.includes(T),L=q.includes(T),te=H.some(se=>se.startsWith(T)),oe=q.some(se=>se.startsWith(T)),Be=T.length>=3&&q.some(se=>se.includes(T));if(ee)B+=48;else if(L)B+=38;else if(te)B+=28;else if(oe)B+=20;else if(Be)B+=10;else return null}return f.current&&(B+=4),f.featured&&(B+=2),B}function _0(f,b){const _=new Map(Rm.map((r,D)=>[r,D]));return f.map((r,D)=>({command:r,index:D,score:S0(r,b)})).filter(r=>r.score!==null).sort((r,D)=>D.score-r.score||(_.get(r.command.group)??99)-(_.get(D.command.group)??99)||r.index-D.index).map(({command:r})=>r)}function x0({open:f,commands:b,onClose:_}){const[r,D]=R.useState(""),[H,q]=R.useState(0),F=R.useRef(null),B=R.useRef(null),T=R.useRef(null),ee=R.useRef(null),L=R.useMemo(()=>_0(b,r),[b,r]),te=R.useMemo(()=>{const x=new Map;return L.forEach((X,W)=>{const G=x.get(X.group)??[];G.push({command:X,index:W}),x.set(X.group,G)}),Rm.flatMap(X=>{const W=x.get(X);return W!=null&&W.length?[{group:X,items:W}]:[]})},[L]),oe=R.useMemo(()=>te.flatMap(({items:x})=>x.map(({command:X})=>X)),[te]),Be=R.useMemo(()=>new Map(oe.map((x,X)=>[x.id,X])),[oe]),se=oe[H]?`command-option-${oe[H].id}`:void 0;if(R.useEffect(()=>{if(!f)return;ee.current=document.activeElement;const x=document.querySelectorAll(".app-header, .workspace");x.forEach(W=>{W.inert=!0});const X=document.body.style.overflow;return document.body.style.overflow="hidden",D(""),q(0),requestAnimationFrame(()=>{var W;return(W=F.current)==null?void 0:W.focus()}),()=>{var W;x.forEach(G=>{G.inert=!1}),document.body.style.overflow=X,(W=ee.current)==null||W.focus()}},[f]),R.useEffect(()=>{q(0)},[r]),R.useEffect(()=>{q(x=>Math.min(x,Math.max(oe.length-1,0)))},[oe.length]),R.useEffect(()=>{var x;(x=T.current)==null||x.scrollIntoView({block:"nearest"})},[r,H]),R.useEffect(()=>{if(!f)return;function x(X){X.key==="Escape"&&_()}return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[_,f]),!f)return null;function we(x){x.disabledReason||(_(),x.run())}function Ye(x){if(x.key!=="Tab"||!B.current)return;const X=Array.from(B.current.querySelectorAll("button:not([disabled]), input:not([disabled])"));if(!X.length)return;const W=X[0],G=X[X.length-1];x.shiftKey&&document.activeElement===W?(x.preventDefault(),G.focus()):!x.shiftKey&&document.activeElement===G&&(x.preventDefault(),W.focus())}return i.jsx("div",{className:"palette-backdrop",onMouseDown:_,children:i.jsxs("section",{ref:B,className:"command-palette",role:"dialog","aria-modal":"true","aria-label":"Search setup",onMouseDown:x=>x.stopPropagation(),onKeyDown:Ye,children:[i.jsxs("div",{className:"palette-search",children:[i.jsx(qm,{size:19,"aria-hidden":"true"}),i.jsx("input",{ref:F,value:r,onChange:x=>D(x.target.value),onKeyDown:x=>{x.key==="ArrowDown"&&(x.preventDefault(),q(X=>oe.length?(X+1)%oe.length:0)),x.key==="ArrowUp"&&(x.preventDefault(),q(X=>oe.length?(X-1+oe.length)%oe.length:0)),x.key==="Home"&&(x.preventDefault(),q(0)),x.key==="End"&&(x.preventDefault(),q(Math.max(oe.length-1,0))),x.key==="Enter"&&oe[H]&&(x.preventDefault(),we(oe[H]))},placeholder:"Search settings, methods, or actions","aria-label":"Search setup",role:"combobox","aria-expanded":"true","aria-controls":"command-results","aria-activedescendant":se,"aria-autocomplete":"list"}),i.jsx("button",{type:"button",onClick:_,"aria-label":"Close search",children:i.jsx(h0,{size:18})})]}),i.jsx("span",{className:"visually-hidden","aria-live":"polite",children:L.length?`${L.length} result${L.length===1?"":"s"}`:"No results"}),i.jsx("div",{className:"palette-results",id:"command-results",role:"listbox","aria-label":"Search results",children:L.length?te.map(({group:x,items:X})=>i.jsxs("section",{className:"command-group",children:[i.jsx("h2",{children:x}),X.map(({command:W})=>{const G=Be.get(W.id)??0;return i.jsxs("button",{type:"button",role:"option",id:`command-option-${W.id}`,ref:H===G?T:void 0,className:H===G?"selected":"","aria-selected":H===G,"aria-disabled":!!W.disabledReason,onMouseMove:()=>q(G),onClick:()=>we(W),children:[i.jsxs("span",{className:"command-copy",children:[i.jsx("strong",{children:W.label}),(W.disabledReason||W.detail)&&i.jsx("small",{children:W.disabledReason??W.detail})]}),i.jsxs("span",{className:"command-hint",children:[W.current&&i.jsx(pf,{size:15,"aria-label":"Current"}),W.hint,!W.current&&i.jsx(Xi,{size:15,"aria-hidden":"true"})]})]},W.id)})]},x)):i.jsxs("div",{className:"palette-empty",children:[i.jsx("strong",{children:"No matching setting"}),i.jsx("span",{children:"Try temperature, barostat, calculator, eq, or xyz."})]})}),i.jsxs("footer",{children:[i.jsxs("span",{children:[i.jsx("kbd",{children:"↑↓"})," navigate"]}),i.jsxs("span",{children:[i.jsx("kbd",{children:"Enter"})," select"]}),i.jsxs("span",{children:[i.jsx("kbd",{children:"Esc"})," close"]})]})]})})}function Hm({formula:f,fallback:b="—"}){return f?i.jsx("span",{className:"chemical-formula","aria-label":f,children:f.split(/(\d+)/).map((_,r)=>/^\d+$/.test(_)?i.jsx("sub",{"aria-hidden":"true",children:_},`${_}-${r}`):i.jsx("span",{"aria-hidden":"true",children:_},`${_}-${r}`))}):i.jsx(i.Fragment,{children:b})}const Sf=[{value:"berendsen",label:"Berendsen",description:"Fast equilibration; does not sample the canonical ensemble."},{value:"velocity_rescaling",label:"Stochastic velocity rescaling",description:"Canonical temperature sampling with stochastic rescaling."},{value:"langevin",label:"Langevin",description:"Stochastic coupling through friction and random forces."},{value:"nh-chain",label:"Nosé–Hoover chain",description:"Deterministic canonical sampling with an extended chain."}],_f=[{value:"berendsen",label:"Berendsen",description:"Weak pressure coupling for equilibration."},{value:"stochastic_rescaling",label:"Stochastic cell rescaling",description:"Stochastic pressure coupling through cell rescaling."}],j0=[{value:"isotropic",label:"Isotropic"},{value:"xy",label:"Semi-isotropic · xy"},{value:"xz",label:"Semi-isotropic · xz"},{value:"yz",label:"Semi-isotropic · yz"},{value:"anisotropic",label:"Anisotropic"},{value:"full_anisotropic",label:"Fully anisotropic"}];function xm(f){return f.startsWith("structure.")||f.startsWith("cell.")?"system":f.startsWith("method.")||f.startsWith("mm.")||f.startsWith("qm.")||f.startsWith("runner.")||f.startsWith("calculator.")||f.startsWith("pq.")||f.startsWith("environment.pq")?"method":"conditions"}const gf=[{value:"off",label:"GUFF",description:"Nonbonded interactions from a GUFF table."},{value:"bonded",label:"Bonded + GUFF",description:"Bonded terms from topology and parameters; GUFF nonbonded terms."},{value:"on",label:"Classical force field",description:"All interactions from topology and parameter files."}],wi={moldescriptor:{role:"moldescriptor",label:"Molecule descriptor",defaultName:"moldescriptor.dat"},guff:{role:"guff",label:"GUFF table",defaultName:"guff.dat"},topology:{role:"topology",label:"Topology",defaultName:"topology.dat"},parameter:{role:"parameter",label:"Parameters",defaultName:"parameter.dat"},intra_nonbonded:{role:"intra_nonbonded",label:"Intramolecular nonbonded",defaultName:"intra-nonbonded.dat"},dftb_template:{role:"dftb_template",label:"DFTB+ template",defaultName:"dftb_in.template"},turbomole_define_template:{role:"turbomole_define_template",label:"Turbomole define template",defaultName:"tm_define.template"}},z0={programs:{dftbplus:{recommended_script:"dftbplus_periodic_stress",scripts:[{name:"dftbplus_periodic_stress",label:"DFTB+ periodic stress",required_file_keywords:["dftb_file"],required_working_files:[]}]},pyscf:{recommended_script:"pyscf_hf.py",scripts:[{name:"pyscf_hf.py",label:"UHF / STO-3G",required_file_keywords:[],required_working_files:[]},{name:"pyscf_mp2.py",label:"UMP2 / 6-311++G**",required_file_keywords:[],required_working_files:[]}]},turbomole:{recommended_script:"turbomole_rimp2",scripts:[{name:"turbomole_rimp2",label:"RI-MP2",required_file_keywords:[],required_working_files:["tm_define.template"]}]}}},N0={dftb_file:"dftb_template"},E0={"tm_define.template":"turbomole_define_template"},T0={turbomole_define_template:"tm_define.template"};function M0(f){var b;return((b=gf.find(_=>_.value===f))==null?void 0:b.label)??"GUFF"}function A0(f){return[...(f==="off"?["moldescriptor","guff"]:f==="bonded"?["moldescriptor","guff","topology","parameter"]:["moldescriptor","topology","parameter"]).map(_=>({...wi[_],optional:!1})),...f==="off"?[]:[{...wi.intra_nonbonded,optional:!0}]]}function rf(f,b,_=null,r=null){const D=new Set;b==="NPT"&&D.add("moldescriptor");const H=Bm(r,f,_);return H==null||H.required_file_keywords.forEach(q=>{const F=N0[q];F&&D.add(F)}),H==null||H.required_working_files.forEach(q=>{const F=E0[q];F&&D.add(F)}),[...D].map(q=>({...wi[q],optional:!1}))}function ju(f,b){return b?(f??z0).programs[b]??null:null}function jm(f,b){var _;return((_=ju(f,b))==null?void 0:_.scripts)??[]}function O0(f,b){var _;return((_=ju(f,b))==null?void 0:_.recommended_script)??null}function Bm(f,b,_){const r=ju(f,b),D=_??(r==null?void 0:r.recommended_script);return(r==null?void 0:r.scripts.find(H=>H.name===D))??null}function D0(f,b){const _=new Set(f.map(r=>r.role));return b.filter(r=>_.has(r.role))}function C0(f,b){const _=new Set(b.filter(r=>r.name.trim()&&r.content.length>0).map(r=>r.role));return f.filter(r=>!r.optional&&!_.has(r.role)).map(r=>r.role)}function ot(f){return wi[f].defaultName}function q0(f,b){return T0[f]??b}const vf=1,xu=999,xf=2,Ym=3;function zn(f){return Number.isFinite(f)?Math.min(xu,Math.max(vf,Math.trunc(f))):vf}function U0(f){if(!/^\d+$/.test(f))return null;const b=Number(f);return bxu?null:b}function R0(f){const b=U0(f);return b===null||bH.name===f)?f:r}function L0(f,b){const _=zn(f),r=_===1?"file":"files";if(b)return`${_} sampling ${r} · from eq`;if(_===1)return"1 sampling file";const D=_===2?"02 continued":`02–${zu(_)} continued`;return`${_} sampling files · ${D}`}function X0(f,b){const _=zn(b),r=f?["run-eq.in"]:[],D=_<=4?Array.from({length:_},(H,q)=>q+1):[1,2];return r.push(...D.map(H=>`run-${zu(H)}.in`)),_>4&&r.push("…",`run-${zu(_)}.in`),r}function Z0(f){return/^[A-Za-z0-9_@%+=:,./-]+$/.test(f)?f:`'${f.replaceAll("'",`'"'"'`)}'`}function w0(f){return f!=null&&f.found&&f.executable?{command:`./run.sh ${Z0(f.executable)}`,detail:`Detected ${f.version??"PQ"}`}:{command:"./run.sh /path/to/PQ",detail:"PQ not detected · replace the path below"}}const V0={H:"#f7f7f4",C:"#4b5560",N:"#315fbc",O:"#d94a42",F:"#55a65c",P:"#de8d31",S:"#d7b52f",Cl:"#4c9a59",Zn:"#6d79a8"},of={H:.31,C:.76,N:.71,O:.66,F:.57,P:1.07,S:1.05,Cl:1.02,Zn:1.22};function K0(f,b,_){const[r,D,H]=f,q=Math.cos(_),F=Math.sin(_),B=r*q+H*F,T=-r*F+H*q,ee=Math.cos(b),L=Math.sin(b);return[B,D*ee-T*L,D*L+T*ee]}function k0(f,b){return Math.hypot(f.position[0]-b.position[0],f.position[1]-b.position[1],f.position[2]-b.position[2])}function J0(f){const[b,_,r]=f,D=[];for(const H of[-.5,.5])for(const q of[-.5,.5])for(const F of[-.5,.5])D.push([H*b[0]+q*_[0]+F*r[0],H*b[1]+q*_[1]+F*r[1],H*b[2]+q*_[2]+F*r[2]]);return D}const $0=[[0,1],[0,2],[0,4],[1,3],[1,5],[2,3],[2,6],[3,7],[4,5],[4,6],[5,7],[6,7]];function W0({analysis:f,example:b,generatedCellTreatment:_,densityGcm3:r}){const[D,H]=R.useState([-.42,.58]),[q,F]=R.useState(1),[B,T]=R.useState(!1),ee=R.useRef(null),L=R.useRef(null);R.useEffect(()=>{const G=ee.current;if(!G)return;function V(k){k.preventDefault(),F(P=>Math.min(2.5,Math.max(.45,P*(k.deltaY>0?.9:1.1))))}return G.addEventListener("wheel",V,{passive:!1}),()=>G.removeEventListener("wheel",V)},[]),R.useEffect(()=>{T(!1)},[f.structure,_]);const te=f.structure.cell_generated,oe=!!(f.structure.cell&&(!te||B)),Be=f.structure.cell_padding_angstrom??6,se=R.useMemo(()=>{const G=f.structure.atoms,V=Math.max(1,Math.ceil(G.length/1200)),k=G.map((d,j)=>({atom:d,index:j})).filter((d,j)=>j%V===0),P=k.map(({atom:d})=>d.position),al=oe&&f.structure.cell?J0(f.structure.cell):[],yl=oe&&f.structure.cell?[0,0,0]:P.length?[0,1,2].map(d=>{const j=P.map(Y=>Y[d]);return(Math.min(...j)+Math.max(...j))/2}):[0,0,0],ke=P.map(d=>d.map((j,Y)=>j-yl[Y])),C=al.map(d=>d.map((j,Y)=>j-yl[Y])),Cl=[...ke,...C],Je=155/Math.max(1,...Cl.map(d=>Math.hypot(d[0],d[1],d[2])))*q,N=d=>{const j=K0(d,D[0],D[1]);return{x:300+j[0]*Je,y:205-j[1]*Je,z:j[2]}},Q=k.map(({atom:d,index:j},Y)=>({atom:d,index:j,...N(ke[Y])})).sort((d,j)=>d.z-j.z),$=C.map(N),pe=[];if(G.length<=280)for(let d=0;d.2&&Z<=Y&&pe.push({left:d,right:j})}const ye=new Map(Q.map(d=>[d.index,d]));return{atoms:Q,bonds:pe,positionMap:ye,cell:$,sampled:V>1}},[f,oe,D,q]),we=R.useMemo(()=>new Set(f.collisions.flatMap(G=>[G.atom_i,G.atom_j])),[f.collisions]);function Ye(G){const V={free:[-.42,.58],xy:[0,0],xz:[Math.PI/2,0],yz:[0,Math.PI/2]};H(V[G]),F(1)}function x(G){G.currentTarget.setPointerCapture(G.pointerId),L.current={x:G.clientX,y:G.clientY,rx:D[0],ry:D[1]}}function X(G){L.current&&H([L.current.rx+(G.clientY-L.current.y)*.008,L.current.ry+(G.clientX-L.current.x)*.008])}function W(G){G.currentTarget.hasPointerCapture(G.pointerId)&&G.currentTarget.releasePointerCapture(G.pointerId),L.current=null}return i.jsxs("section",{className:"viewer","aria-labelledby":"viewer-title",children:[i.jsxs("div",{className:"viewer-heading",children:[i.jsxs("div",{children:[i.jsx("div",{className:"eyebrow",children:b?"Example":f.structure.source_format??"Structure"}),i.jsx("h2",{id:"viewer-title",children:f.structure.source_name??"Untitled structure"})]}),i.jsxs("div",{className:"viewer-count",children:[f.summary.atom_count.toLocaleString()," atoms"]})]}),i.jsxs("div",{className:"viewer-stage",children:[i.jsxs("svg",{ref:ee,viewBox:"0 0 600 420",role:"img","aria-label":`Interactive view of ${f.summary.formula||"the structure"}${te?`. Generated cell ${B?"shown":"hidden"}`:""}`,onPointerDown:x,onPointerMove:X,onPointerUp:W,onPointerCancel:W,children:[i.jsx("rect",{width:"600",height:"420",className:"viewer-background"}),se.cell.length===8&&$0.map(([G,V])=>i.jsx("line",{x1:se.cell[G].x,y1:se.cell[G].y,x2:se.cell[V].x,y2:se.cell[V].y,className:`cell-edge ${te?"generated-cell-edge":""}`},`cell-${G}-${V}`)),se.bonds.map(({left:G,right:V})=>{const k=se.positionMap.get(G),P=se.positionMap.get(V);return!k||!P?null:i.jsx("line",{x1:k.x,y1:k.y,x2:P.x,y2:P.y,className:"bond"},`bond-${G}-${V}`)}),f.collisions.map(G=>{const V=se.positionMap.get(G.atom_i),k=se.positionMap.get(G.atom_j);return!V||!k?null:i.jsx("line",{x1:V.x,y1:V.y,x2:k.x,y2:k.y,className:"collision-link"},`collision-${G.atom_i}-${G.atom_j}`)}),se.atoms.map(({atom:G,index:V,x:k,y:P,z:al})=>{const yl=Math.max(.72,Math.min(1.22,1+al*.012)),ke=Math.max(8,Math.min(18,(of[G.symbol]??.8)*14))*yl;return i.jsxs("g",{children:[we.has(V)&&i.jsx("circle",{cx:k,cy:P,r:ke+5,className:"collision-halo"}),i.jsx("circle",{cx:k,cy:P,r:ke,fill:V0[G.symbol]??"#8c6db0",className:`atom ${G.symbol==="H"?"atom-light":""}`})]},`atom-${V}`)}),i.jsxs("g",{className:"axis",transform:"translate(42 368)",children:[i.jsx("line",{x1:"0",y1:"0",x2:"28",y2:"0",className:"axis-x"}),i.jsx("line",{x1:"0",y1:"0",x2:"0",y2:"-28",className:"axis-y"}),i.jsx("line",{x1:"0",y1:"0",x2:"16",y2:"16",className:"axis-z"}),i.jsx("text",{x:"33",y:"4",children:"x"}),i.jsx("text",{x:"-4",y:"-34",children:"y"}),i.jsx("text",{x:"19",y:"25",children:"z"})]})]}),i.jsxs("div",{className:"viewer-help",children:[i.jsx(d0,{size:14,"aria-hidden":"true"}),"Drag to rotate · Scroll to zoom"]}),se.sampled&&i.jsx("div",{className:"sample-label",children:"Preview sampled for speed"}),te&&B&&i.jsx("div",{className:"generated-cell-label",children:"Generated preview box"})]}),i.jsxs("div",{className:"view-controls","aria-label":"View orientation",children:[i.jsxs("button",{type:"button",onClick:()=>Ye("free"),children:[i.jsx(m0,{size:15,"aria-hidden":"true"}),"3D"]}),i.jsx("button",{type:"button",onClick:()=>Ye("xy"),children:"XY"}),i.jsx("button",{type:"button",onClick:()=>Ye("xz"),children:"XZ"}),i.jsx("button",{type:"button",onClick:()=>Ye("yz"),children:"YZ"}),i.jsxs("button",{type:"button",className:"fit-view",onClick:()=>{F(1),H(G=>[...G])},children:[i.jsx(f0,{size:15,"aria-hidden":"true"}),"Fit"]})]}),te&&i.jsxs("div",{className:"generated-cell-note",children:[i.jsxs("span",{children:[i.jsx("strong",{children:"No periodic cell in source"}),i.jsx("small",{children:_==="density"?r?`PQ derives the run cell from ${r} g cm⁻³. The optional box is a ${Be} Å preview envelope.`:`PQ derives the run cell from density. The optional box is a ${Be} Å preview envelope.`:`PQSetup adds a centered run cell with ${Be} Å padding. The uploaded file is unchanged.`})]}),i.jsxs("button",{type:"button","aria-pressed":B,onClick:()=>T(G=>!G),children:[i.jsx(bm,{size:14,"aria-hidden":"true"}),B?"Hide box":"Show box"]})]}),i.jsxs("dl",{className:"structure-facts",children:[i.jsxs("div",{children:[i.jsx("dt",{children:"Formula"}),i.jsx("dd",{children:i.jsx(Hm,{formula:f.summary.formula})})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Cell"}),i.jsx("dd",{children:f.structure.cell?i.jsxs(i.Fragment,{children:[i.jsx(bm,{size:14,"aria-hidden":"true"}),te?_==="density"?"Density-derived":"Generated":"Imported"]}):"None"})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Min. distance"}),i.jsx("dd",{children:f.summary.minimum_distance_angstrom==null?"—":`${f.summary.minimum_distance_angstrom.toFixed(3)} Å`})]})]})]})}const Nm="https://molarverse.github.io/PQSetup/",Fl=[{id:"system",label:"System",hint:"Structure"},{id:"method",label:"Method",hint:"Interaction"},{id:"conditions",label:"Conditions",hint:"Run plan"},{id:"prepare",label:"Prepare",hint:"Coordinates"},{id:"review",label:"Review",hint:"Inputs"}],Em={structure:{atoms:[{symbol:"O",position:[0,0,0],molecule_type:0,velocity:null,force:null},{symbol:"H",position:[.9572,0,0],molecule_type:0,velocity:null,force:null},{symbol:"H",position:[-.239987,.927297,0],molecule_type:0,velocity:null,force:null}],cell:[[12,0,0],[0,12,0],[0,0,12]],periodic:[!0,!0,!0],source_name:"water-example.rst",source_format:"pq-restart",wrapped_centered:!0,cell_generated:!1,cell_padding_angstrom:null},summary:{atom_count:3,formula:"H2O",volume_angstrom3:1728,density_g_cm3:.0173,minimum_distance_angstrom:.9572},diagnostics:[],collisions:[],collisions_truncated:!1,valid:!0},F0={preset_id:"ambient-nvt",job_type:"qm-md",ensemble:"NVT",start_file:"water-example.rst",restart_file:null,file_prefix:"water-nvt",timestep_fs:.5,steps:1e3,temperature_k:298.15,start_temperature_k:null,temperature_ramp_steps:null,temperature_ramp_frequency:1,pressure_bar:null,thermostat:"velocity_rescaling",thermostat_relaxation_ps:.1,thermostat_friction_ps_inverse:.1,nh_chain_length:3,coupling_frequency_cm_inverse:1e3,manostat:null,manostat_relaxation_ps:1,compressibility_bar_inverse:4591e-8,pressure_isotropy:"isotropic",initialize_velocities:!0,random_seed:238917,runner:"ase_xtb",runner_script:null,mm_force_field:"off",density_g_cm3:null,coulomb_cutoff_angstrom:12.5,moldescriptor_file:null,guff_file:null,topology_file:null,parameter_file:null,intra_nonbonded_file:null,dftb_template_file:null,turbomole_define_template_file:null,overwrite_output:!1,extra_settings:{}},df={enabled:!0,steps:5e3,timestep_fs:.5,temperature_k:298.15,start_temperature_k:null,temperature_ramp_steps:null,temperature_ramp_frequency:1,thermostat:"berendsen",thermostat_relaxation_ps:.1,thermostat_friction_ps_inverse:.1,nh_chain_length:3,coupling_frequency_cm_inverse:1e3};function mf(f){return f.job_type==="mm-md"||f.job_type==="mm-opt"}function Tm(f,b){return{...f,mm_force_field:b,moldescriptor_file:f.moldescriptor_file??ot("moldescriptor"),guff_file:b==="off"||b==="bonded"?f.guff_file??ot("guff"):f.guff_file,topology_file:b==="on"||b==="bonded"?f.topology_file??ot("topology"):f.topology_file,parameter_file:b==="on"||b==="bonded"?f.parameter_file??ot("parameter"):f.parameter_file}}function I0(f,b,_){return b==="moldescriptor"?{...f,moldescriptor_file:_}:b==="guff"?{...f,guff_file:_}:b==="topology"?{...f,topology_file:_}:b==="parameter"?{...f,parameter_file:_}:b==="intra_nonbonded"?{...f,intra_nonbonded_file:_}:b==="dftb_template"?{...f,dftb_template_file:_}:{...f,turbomole_define_template_file:_}}function jn(f){return f instanceof Error?f.message:"Something went wrong."}function hf(f,b){if(!f||!b)return"Duration incomplete";const _=f*b;return _>=1e3?`${(_/1e3).toLocaleString(void 0,{maximumFractionDigits:3})} ps`:`${_.toLocaleString()} fs`}function Qm(f){var b;return((b=Sf.find(_=>_.value===f))==null?void 0:b.description)??"Choose how temperature is coupled."}function P0(f){var b;return((b=_f.find(_=>_.value===f))==null?void 0:b.description)??"Choose how pressure is coupled."}function Ce({label:f,unit:b,help:_,info:r,controlId:D,children:H}){const q=R.useId(),F=D??q,B=R.useId();return i.jsxs("div",{className:"field",children:[i.jsxs("span",{className:"field-label",children:[i.jsx("label",{htmlFor:F,children:f}),i.jsxs("span",{className:"field-label-tools",children:[b&&i.jsx("span",{className:"unit",children:b}),r&&i.jsxs("button",{type:"button",className:"info-affordance","aria-label":r,"aria-describedby":B,children:[i.jsx(Cm,{size:14,"aria-hidden":"true"}),i.jsx("span",{className:"info-tooltip",id:B,role:"tooltip",children:r})]})]})]}),R.cloneElement(H,{id:F}),_&&i.jsx("span",{className:"field-help",children:_})]})}function Mm({value:f,onChange:b,controlId:_}){return i.jsxs("section",{className:"coupling-section","aria-label":"Temperature coupling",children:[i.jsxs("div",{className:"section-rule-heading",children:[i.jsx("strong",{children:"Temperature coupling"}),i.jsx("span",{children:"Thermostat"})]}),i.jsxs("div",{className:"form-grid coupling-grid",children:[i.jsx(Ce,{label:"Thermostat",controlId:_,children:i.jsx("select",{value:f.thermostat??"velocity_rescaling",onChange:r=>b({thermostat:r.target.value}),children:Sf.map(r=>i.jsx("option",{value:r.value,children:r.label},r.value))})}),(f.thermostat==="berendsen"||f.thermostat==="velocity_rescaling")&&i.jsx(Ce,{label:"Relaxation time",unit:"ps",help:"PQ default: 0.1 ps.",children:i.jsx("input",{type:"number",min:"0.000001",step:"0.01",value:f.thermostat_relaxation_ps??"",onChange:r=>b({thermostat_relaxation_ps:r.target.value?Number(r.target.value):null})})}),f.thermostat==="langevin"&&i.jsx(Ce,{label:"Friction",unit:"ps⁻¹",help:"PQ default: 0.1 ps⁻¹.",children:i.jsx("input",{type:"number",min:"0",step:"0.01",value:f.thermostat_friction_ps_inverse,onChange:r=>b({thermostat_friction_ps_inverse:Number(r.target.value)})})}),f.thermostat==="nh-chain"&&i.jsxs(i.Fragment,{children:[i.jsx(Ce,{label:"Chain length",help:"PQ default: 3.",children:i.jsx("input",{type:"number",min:"1",step:"1",value:f.nh_chain_length,onChange:r=>b({nh_chain_length:Number(r.target.value)})})}),i.jsx(Ce,{label:"Coupling frequency",unit:"cm⁻¹",help:"PQ default: 1000 cm⁻¹.",children:i.jsx("input",{type:"number",min:"0",step:"1",value:f.coupling_frequency_cm_inverse,onChange:r=>b({coupling_frequency_cm_inverse:Number(r.target.value)})})})]})]}),i.jsx("p",{className:"coupling-description",children:Qm(f.thermostat)})]})}function Am({value:f,onChange:b}){return i.jsxs("details",{className:"schedule-settings",children:[i.jsxs("summary",{children:[i.jsxs("span",{children:[i.jsx("strong",{children:"Temperature schedule"}),i.jsx("small",{children:f.start_temperature_k==null?"Constant target temperature":`${f.start_temperature_k} K → target`})]}),i.jsx(Dm,{size:16,"aria-hidden":"true"})]}),i.jsxs("div",{className:"form-grid schedule-grid",children:[i.jsx(Ce,{label:"Start temperature",unit:"K",help:"Leave blank to start at the target temperature.",children:i.jsx("input",{type:"number",min:"0",step:"0.01",value:f.start_temperature_k??"",onChange:_=>b({start_temperature_k:_.target.value?Number(_.target.value):null})})}),i.jsx(Ce,{label:"Ramp steps",help:"0 uses the full stage.",children:i.jsx("input",{type:"number",min:"0",step:"1",value:f.temperature_ramp_steps??"",onChange:_=>b({temperature_ramp_steps:_.target.value?Number(_.target.value):null})})}),i.jsx(Ce,{label:"Ramp frequency",unit:"steps",children:i.jsx("input",{type:"number",min:"1",step:"1",value:f.temperature_ramp_frequency,onChange:_=>b({temperature_ramp_frequency:Number(_.target.value)})})})]})]})}function ey({value:f,onChange:b,controlId:_}){return i.jsxs("section",{className:"coupling-section","aria-label":"Pressure coupling",children:[i.jsxs("div",{className:"section-rule-heading",children:[i.jsx("strong",{children:"Pressure coupling"}),i.jsx("span",{children:"Manostat"})]}),i.jsxs("div",{className:"form-grid coupling-grid pressure-grid",children:[i.jsx(Ce,{label:"Manostat",controlId:_,info:"PQ calls this a manostat. It is essentially a barostat: the pressure-coupling method that adjusts the simulation cell.",children:i.jsx("select",{value:f.manostat??"stochastic_rescaling",onChange:r=>b({manostat:r.target.value}),children:_f.map(r=>i.jsx("option",{value:r.value,children:r.label},r.value))})}),i.jsx(Ce,{label:"Relaxation time",unit:"ps",help:"PQ default: 1 ps.",children:i.jsx("input",{type:"number",min:"0.000001",step:"0.01",value:f.manostat_relaxation_ps??"",onChange:r=>b({manostat_relaxation_ps:r.target.value?Number(r.target.value):null})})}),i.jsx(Ce,{label:"Compressibility",unit:"bar⁻¹",help:"PQ water default: 4.591 × 10⁻⁵ bar⁻¹; adjust for the material.",children:i.jsx("input",{type:"number",min:"0",step:"0.000001",value:f.compressibility_bar_inverse,onChange:r=>b({compressibility_bar_inverse:Number(r.target.value)})})}),i.jsx(Ce,{label:"Cell response",help:"PQ default: isotropic.",children:i.jsx("select",{value:f.pressure_isotropy,onChange:r=>b({pressure_isotropy:r.target.value}),children:j0.map(r=>i.jsx("option",{value:r.value,children:r.label},r.value))})})]}),i.jsx("p",{className:"coupling-description",children:P0(f.manostat)})]})}function _u({eyebrow:f,title:b,description:_}){return i.jsxs("header",{className:"step-heading",children:[i.jsx("span",{className:"eyebrow",children:f}),i.jsx("h1",{children:b}),i.jsx("p",{children:_})]})}function Li({status:f}){return f==="ok"?i.jsx(yf,{"aria-hidden":"true"}):f==="warn"?i.jsx(Ha,{"aria-hidden":"true"}):i.jsx(s0,{"aria-hidden":"true"})}function ly(){var it,gt;const[f,b]=R.useState(null),[_,r]=R.useState(null),[D,H]=R.useState("system"),[q,F]=R.useState(Em),[B,T]=R.useState(Em),[ee,L]=R.useState(!0),[te,oe]=R.useState(null),[Be,se]=R.useState("water-example.rst"),[we,Ye]=R.useState(null),[x,X]=R.useState(F0),[W,G]=R.useState([]),[V,k]=R.useState(null),[P,al]=R.useState(1),[yl,ke]=R.useState("1"),[C,Cl]=R.useState(null),[jl,Je]=R.useState(null),[N,Q]=R.useState(!1),[$,pe]=R.useState(!1),[ye,d]=R.useState(!1),[j,Y]=R.useState(!1),[Z,le]=R.useState(!1),[ue,ge]=R.useState(.01),[el,De]=R.useState(!1),dt=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform)?"⌘ K":"Ctrl K",ma=dt.startsWith("⌘")?"⌘ Enter":"Ctrl Enter",[Rt,Ae]=R.useState(null),Il=R.useId(),Ba=R.useRef(null),Ya=R.useRef(null),Nu=R.useRef({}),Nn=R.useRef(null),Ht=R.useRef(0),Bt=R.useRef(0),Pl=R.useRef(0),Eu=R.useRef(null),Qa=R.useRef(Ym),ce=mf(x),hl=(f==null?void 0:f.pq.external_qm)??null,Yt=R.useMemo(()=>jm(hl,x.runner),[hl,x.runner]),Qt=R.useMemo(()=>ju(hl,x.runner),[hl,x.runner]),et=R.useMemo(()=>Bm(hl,x.runner,x.runner_script),[hl,x.runner,x.runner_script]),mt=R.useMemo(()=>ce?A0(x.mm_force_field):rf(x.runner,x.ensemble,x.runner_script,hl),[hl,ce,x.ensemble,x.mm_force_field,x.runner,x.runner_script]),ht=R.useMemo(()=>D0(mt,W),[mt,W]),Tu=R.useMemo(()=>ht.map(({role:o,name:y,content:U})=>({role:o,name:y,content:o==="moldescriptor"?U:null})),[ht]);R.useEffect(()=>{var o;(o=Nn.current)==null||o.scrollTo({top:0,left:0})},[D]),R.useEffect(()=>{function o(){window.matchMedia("(max-width: 720px)").matches&&window.requestAnimationFrame(()=>{const y=Ya.current,U=Nu.current[D];if(!y||!U)return;const xe=U.offsetLeft+U.offsetWidth/2-y.clientWidth/2;y.scrollTo({left:Math.max(0,xe),behavior:"smooth"})})}return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[D]),R.useEffect(()=>{let o=!0;return p0().then(y=>{if(!o)return;b(y);const U=y.runners.find(xe=>xe.id==="ase_xtb")??y.runners.find(xe=>xe.supported);U&&X(xe=>mf(xe)||xe.runner?xe:{...xe,runner:U.id})}).catch(y=>{o&&r(jn(y))}),()=>{o=!1}},[]),R.useEffect(()=>{const o=++Ht.current;Q(!0);const y=window.setTimeout(()=>{v0(x,V,P,Tu,q.structure).then(U=>{var qe;if(o!==Ht.current)return;const xe=Eu.current;Eu.current=((qe=U.files[0])==null?void 0:qe.name)??null,Cl(U),Je(O=>G0(O,xe,U.files))}).catch(U=>{o===Ht.current&&Cl({files:[],valid:!1,diagnostics:[{code:"api.render",severity:"error",message:jn(U),atom_indices:[]}]})}).finally(()=>{o===Ht.current&&Q(!1)})},120);return()=>window.clearTimeout(y)},[q.structure,V,P,x,Tu]);const ql=R.useMemo(()=>(f==null?void 0:f.runners.find(o=>o.id===x.runner))??null,[f,x.runner]),_e=R.useMemo(()=>(C==null?void 0:C.files.find(o=>o.name===jl))??(C==null?void 0:C.files[0])??null,[C,jl]),Ge=(C==null?void 0:C.files.findIndex(o=>o.name===(_e==null?void 0:_e.name)))??-1,wl=R.useMemo(()=>(C==null?void 0:C.files.filter(o=>o.stage_id==="equilibration"))??[],[C]),dl=R.useMemo(()=>(C==null?void 0:C.files.filter(o=>o.stage_id==="sampling"))??[],[C]),Mu=(ql==null?void 0:ql.label)??x.runner??"Not selected",ha=ce?`Molecular mechanics · ${M0(x.mm_force_field)}`:et?`${Mu} · ${et.label}`:Mu,lt=R.useMemo(()=>C0(mt,ht),[mt,ht]),Gt=q.structure.atoms.some(o=>o.molecule_type>0),pa=!q.structure.cell_generated||!!(x.density_g_cm3&&x.density_g_cm3>0),tt=!!(!ce&&f&&x.runner&&!(ql!=null&&ql.ready)),pt=!!(f!=null&&f.pq.validation_scopes.includes("portable")),Vl=ce?Gt&&pa&<.length===0:!!x.runner&&(!Qt||!!et)&<.length===0,Lt=x.steps==null?null:x.steps*P,cl=Y0(P),En=R.useMemo(()=>X0(!!V,P),[V,P]),ya=!ce&&q.structure.cell_generated&&x.ensemble==="NPT",Kl=R.useMemo(()=>[...q.diagnostics,...(C==null?void 0:C.diagnostics)??[],...ya?[{code:"conditions.generated_cell_npt",severity:"error",message:"NPT needs a physical periodic cell, not a generated vacuum cell.",atom_indices:[]}]:[]],[q.diagnostics,ya,C==null?void 0:C.diagnostics]),Ga=R.useMemo(()=>Kl.filter(o=>o.code!=="structure.cell_generated"),[Kl]),Tn=Kl.filter(o=>o.severity==="error").length,zl=!!(q.valid&&!ya&&(C!=null&&C.valid)&&Vl&&Tn===0),Mn=R.useMemo(()=>({system:q.valid?"ok":"warn",method:!Vl||tt?"warn":"ok",conditions:Kl.some(o=>o.severity==="error"&&(o.code.startsWith("conditions.")||o.code.startsWith("run.")||o.code.startsWith("plan.")))?"warn":C?"ok":"idle",prepare:q.collisions.length?"warn":"ok",review:zl?"ok":C?"warn":"idle"}),[q,tt,Kl,Vl,zl,C]),ga=R.useCallback(()=>{var o;return(o=Ba.current)==null?void 0:o.click()},[]),at=R.useCallback(async()=>{if(!zl||j){H("review");return}Y(!0),Ae(null);try{const o=await b0(x,q.structure,x.file_prefix,we,V,P,ht),y=URL.createObjectURL(o),U=document.createElement("a");U.href=y,U.download=`${x.file_prefix}.zip`,U.click(),URL.revokeObjectURL(y),Ae({kind:"success",message:`${x.file_prefix}.zip is ready.`})}catch(o){Ae({kind:"error",message:jn(o)})}finally{Y(!1)}},[q.structure,V,j,ht,we,zl,P,x]),Au=R.useMemo(()=>{var qe;const o=Fl.findIndex(O=>O.id===D),y=oO.severity!=="info").filter(O=>{const Ue=`${O.code}:${O.message}`;return U.has(Ue)?!1:(U.add(Ue),!0)}).map((O,Ue)=>({id:`problem-${O.code}-${Ue}`,group:"Problems",label:O.severity==="error"?"Fix input error":"Review warning",detail:O.message,keywords:[O.code,O.message,"preflight","diagnostic"],featured:Ue<2,run:()=>je(xm(O.code))}));return[...y?[{id:"continue",group:"Suggested",label:`Continue to ${y.label}`,detail:y.hint,keywords:["next","continue","workflow"],featured:!0,run:()=>je(y.id)}]:[],...xe,...Fl.map((O,Ue)=>({id:`step-${O.id}`,group:"Workflow",label:O.label,detail:O.hint,hint:`Alt ${Ue+1}`,keywords:["go","open",O.id==="system"?"structure atoms cell":"",O.id==="method"?"calculator engine force field":"",O.id==="conditions"?"protocol ensemble sampling thermostat manostat":"",O.id==="prepare"?"coordinates jitter perturb symmetry":"",O.id==="review"?"inputs files preview package":""],current:D===O.id,run:()=>je(O.id)})),{id:"model-qm",group:"Scientific setup",label:"Use quantum mechanics",detail:"External electronic-structure calculator",keywords:["qm","quantum","electronic structure","calculator"],current:!ce,run:()=>{Xa("qm"),je("method"),Ae({kind:"success",message:"Quantum mechanics selected."})}},{id:"model-mm",group:"Scientific setup",label:"Use molecular mechanics",detail:"GUFF or classical force field",keywords:["mm","molecular mechanics","force field","classical"],current:ce,run:()=>{Xa("mm"),je("method"),Ae({kind:"success",message:"Molecular mechanics selected."})}},...((f==null?void 0:f.runners)??[]).filter(O=>O.supported).map(O=>({id:`calculator-${O.id}`,group:"Scientific setup",label:O.label,detail:O.ready?"Calculator ready":`${O.detail} Inputs can still be created.`,keywords:["calculator","runner","engine",O.id,O.label],current:!ce&&x.runner===O.id,run:()=>{yt(O.id),je("method"),Ae({kind:O.ready?"success":"info",message:O.ready?`${O.label} selected.`:`${O.label} selected but was not detected.`})}})),...Yt.map(O=>({id:`electronic-method-${O.name}`,group:"Scientific setup",label:O.label,detail:`${(ql==null?void 0:ql.label)??x.runner} electronic method`,keywords:["electronic method","basis","pyscf",O.name,O.label],current:x.runner_script===O.name,run:()=>{La(O.name),je("method"),Ae({kind:"success",message:`${O.label} selected.`})}})),...gf.map(O=>({id:`mm-mode-${O.value}`,group:"Scientific setup",label:O.label,detail:O.description,keywords:["molecular mechanics","force field","guff"],current:ce&&x.mm_force_field===O.value,run:()=>{Ou(O.value),je("method"),Ae({kind:"success",message:`${O.label} selected.`})}})),...["NVE","NVT","NPT"].map(O=>({id:`ensemble-${O.toLowerCase()}`,group:"Scientific setup",label:`Use ${O} sampling`,detail:O==="NVE"?"Fixed energy and volume":O==="NVT"?"Fixed temperature and volume":"Fixed temperature and pressure",keywords:O==="NVE"?["microcanonical","energy","fixed volume"]:O==="NVT"?["canonical","temperature","fixed volume"]:["isobaric","pressure","barostat","manostat","pressure coupling"],current:x.ensemble===O,disabledReason:O==="NPT"&&!ce&&q.structure.cell_generated?"NPT needs a physical periodic cell.":void 0,run:()=>{kl(O),je("conditions"),Ae({kind:"success",message:`Sampling ensemble set to ${O}.`})}})),{id:"protocol-equilibration",group:"Scientific setup",label:"Include NVT equilibration",detail:"Write run-eq.in before sampling",keywords:["eq","equilibrate","warmup","prepare"],current:!!V,run:()=>{ut(!0),je("conditions"),Ae({kind:"success",message:"Equilibration included."})}},{id:"protocol-no-equilibration",group:"Scientific setup",label:"Skip equilibration",detail:"Start directly with sampling",keywords:["no eq","sampling only"],current:!V,run:()=>{ut(!1),je("conditions"),Ae({kind:"success",message:"Equilibration skipped."})}},{id:"sampling-single",group:"Scientific setup",label:"Use one sampling input",detail:"Write a single run-01.in",keywords:["single","one file","sampling output"],current:cl==="single",run:()=>{Xt("single"),je("conditions","sampling-steps"),Ae({kind:"success",message:"One sampling input selected."})}},{id:"sampling-continued",group:"Scientific setup",label:"Split into continued inputs",detail:"Write linked 01, 02, 03… inputs",keywords:["multiple","continued","continuation","split","segments","number of inputs"],current:cl==="continued",run:()=>{Xt("continued"),je("conditions","sampling-run-count"),Ae({kind:"success",message:"Continued sampling inputs selected."})}},...Sf.map(O=>({id:`thermostat-${O.value}`,group:"Scientific setup",label:O.label,detail:O.description,keywords:["thermostat","temperature coupling",O.value,O.value==="nh-chain"?"nose hoover":"",O.value==="velocity_rescaling"?"svr stochastic velocity rescaling":""],current:x.ensemble!=="NVE"&&x.thermostat===O.value,run:()=>{Zt(O.value),je("conditions","sampling-thermostat"),Ae({kind:"success",message:`${O.label} thermostat selected.`})}})),..._f.map(O=>({id:`manostat-${O.value}`,group:"Scientific setup",label:`${O.label} manostat`,detail:O.description,keywords:["manostat","barostat","pressure coupling",O.value],current:x.ensemble==="NPT"&&x.manostat===O.value,disabledReason:!ce&&q.structure.cell_generated?"Pressure coupling needs a physical periodic cell.":void 0,run:()=>{$e(O.value),je("conditions","sampling-manostat"),Ae({kind:"success",message:`${O.label} manostat selected.`})}})),{id:"parameter-temperature",group:"Parameters",label:"Target temperature",detail:`${x.temperature_k??"Not set"} K`,keywords:["temperature","kelvin","heat","initial temperature"],run:()=>je("conditions","sampling-temperature")},{id:"parameter-pressure",group:"Parameters",label:"Target pressure",detail:`${x.pressure_bar??1.01325} bar`,keywords:["pressure","atm","bar","isobaric"],disabledReason:!ce&&q.structure.cell_generated?"Pressure needs a physical periodic cell.":void 0,run:()=>{kl("NPT"),je("conditions","sampling-pressure")}},{id:"parameter-timestep",group:"Parameters",label:"Sampling timestep",detail:`${x.timestep_fs??"Not set"} fs`,keywords:["time step","dt","integration"],run:()=>je("conditions","sampling-timestep")},{id:"parameter-steps",group:"Parameters",label:cl==="single"?"Sampling steps":"Steps per input",detail:`${((qe=x.steps)==null?void 0:qe.toLocaleString())??"Not set"} steps`,keywords:["length","duration","sampling","steps per input"],run:()=>je("conditions","sampling-steps")},...cl==="continued"?[{id:"parameter-input-count",group:"Parameters",label:"Number of sampling inputs",detail:`${P} linked inputs · maximum ${xu}`,keywords:["segments","files","split","continued","count"],run:()=>je("conditions","sampling-run-count")}]:[],{id:"parameter-thermostat",group:"Parameters",label:"Thermostat settings",detail:Qm(x.thermostat),keywords:["temperature coupling","relaxation","friction","nose hoover","svr"],run:()=>{x.ensemble==="NVE"&&kl("NVT"),je("conditions","sampling-thermostat")}},{id:"parameter-manostat",group:"Parameters",label:"Manostat settings",detail:"Pressure coupling, also called a barostat",keywords:["barostat","pressure coupling","compressibility","cell response"],disabledReason:!ce&&q.structure.cell_generated?"Pressure coupling needs a physical periodic cell.":void 0,run:()=>{kl("NPT"),je("conditions","sampling-manostat")}},{id:"parameter-density",group:"Parameters",label:"System density",detail:"Molecular mechanics cell construction",keywords:["density","g cm","box","volume"],disabledReason:ce?q.structure.cell_generated?void 0:"The imported structure already has a physical cell.":"Available for molecular mechanics.",run:()=>je("method","mm-density")},{id:"parameter-cutoff",group:"Parameters",label:"Coulomb cutoff",detail:`${x.coulomb_cutoff_angstrom} Å`,keywords:["electrostatic","nonbonded","angstrom"],disabledReason:ce?void 0:"Available for molecular mechanics.",run:()=>je("method","mm-cutoff")},{id:"parameter-jitter",group:"Parameters",label:"Position perturbation",detail:"Seeded Gaussian symmetry breaking",keywords:["jitter","sigma","gaussian","crystal","symmetry","random"],disabledReason:te?void 0:"Import a structure before perturbing coordinates.",run:()=>{le(!0),je("prepare","position-sigma")}},...((C==null?void 0:C.files)??[]).map(O=>({id:`input-${O.name}`,group:"Inputs",label:O.name,detail:O.stage_id==="equilibration"?"Equilibration input":`Sampling input ${O.segment_index}`,keywords:["generated input","preview",O.stage_id==="equilibration"?"eq equilibrium":"sampling"],run:()=>{Je(O.name),je("review","generated-input-preview")}})),{id:"import",group:"Actions",label:"Import a structure",detail:"RST, CIF, XYZ, PDB, MOL, SDF, TRAJ",keywords:["open","upload","file","rst","cif","xyz","pdb","mol","sdf","traj","extxyz"],featured:!0,run:ga},{id:"create",group:"Actions",label:"Create run package",detail:"Export inputs, run script, structure, and manifest",hint:ma,keywords:["export","zip","download","inputs","run script"],featured:!0,disabledReason:N?"Inputs are still validating.":zl?void 0:"Resolve preflight issues first.",run:()=>void at()},{id:"documentation",group:"Actions",label:"Open documentation",detail:"Guides, validation, run packages, and command line",keywords:["docs","help","manual","guide","getting started"],run:()=>window.open(Nm,"_blank","noopener,noreferrer")}]},[D,q.structure.cell_generated,f,at,Ga,Yt,V,ce,ga,zl,C==null?void 0:C.files,N,ma,cl,P,ql,x,te]);R.useEffect(()=>{function o(y){const U=y.target,xe=(U==null?void 0:U.matches("input, textarea, select, [contenteditable=true]"))??!1;if((y.metaKey||y.ctrlKey)&&y.key.toLowerCase()==="k"){y.preventDefault(),De(qe=>!qe);return}if((y.metaKey||y.ctrlKey)&&y.key==="Enter"&&!el){y.preventDefault(),at();return}if(y.altKey&&/^[1-5]$/.test(y.key)){y.preventDefault(),H(Fl[Number(y.key)-1].id);return}!xe&&y.key==="/"&&(y.preventDefault(),De(!0))}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[at,el]);async function An(o){const y=++Bt.current;Pl.current+=1,pe(!0),Ae(null);try{const U=await y0(o);if(y!==Bt.current)return;F(U),T(U),oe(o),L(!1),le(!1),Ye(null);const xe=o.name.replace(/\.[^.]+$/,"").replace(/[^a-zA-Z0-9_-]/g,"-"),qe=`${xe||"structure"}.rst`;se(qe),X(O=>({...O,start_file:qe,file_prefix:`${xe||"pq"}-run`,density_g_cm3:mf(O)&&U.structure.cell_generated?O.density_g_cm3??1:O.density_g_cm3})),Ae({kind:U.valid?"success":"info",message:U.valid?`${o.name} passed the structure checks.`:`${o.name} needs attention.`})}catch(U){y===Bt.current&&Ae({kind:"error",message:jn(U)})}finally{y===Bt.current&&pe(!1)}}function nt(o){var U;const y=(U=o.target.files)==null?void 0:U[0];o.target.value="",y&&An(y)}async function ll(){if(!te)return;const o=++Pl.current;d(!0),Ae(null);try{const y=await g0(te,ue,x.random_seed);if(o!==Pl.current)return;F(y),Ye({kind:"gaussian-position-jitter",sigma_angstrom:y.sigma_angstrom,seed:y.seed,source_sha256:y.source_sha256,prepared_sha256:y.prepared_sha256}),X(U=>({...U,start_file:y.restart_filename})),Ae({kind:y.valid?"success":"info",message:y.valid?`Prepared with σ = ${ue} Å and seed ${x.random_seed}.`:"Prepared coordinates still need attention."})}catch(y){o===Pl.current&&Ae({kind:"error",message:jn(y)})}finally{o===Pl.current&&d(!1)}}function nl(){Pl.current+=1,d(!1),we&&(F(B),Ye(null),Ae({kind:"info",message:"Original coordinates restored."}),X(o=>({...o,start_file:Be})))}function yt(o){X(y=>{const U=ju(hl,o),qe=y.runner===o&&(U==null?void 0:U.scripts.some(ul=>ul.name===y.runner_script))?y.runner_script:O0(hl,o),O=rf(o,y.ensemble,qe,hl),Ue=new Set(O.map(ul=>ul.role));return{...y,preset_id:null,job_type:"qm-md",runner:o,runner_script:qe,moldescriptor_file:Ue.has("moldescriptor")?y.moldescriptor_file??ot("moldescriptor"):y.moldescriptor_file,dftb_template_file:Ue.has("dftb_template")?y.dftb_template_file??ot("dftb_template"):y.dftb_template_file,turbomole_define_template_file:Ue.has("turbomole_define_template")?y.turbomole_define_template_file??ot("turbomole_define_template"):y.turbomole_define_template_file}})}function La(o){X(y=>{if(!jm(hl,y.runner).some(O=>O.name===o))return y;const xe=rf(y.runner,y.ensemble,o,hl),qe=new Set(xe.map(O=>O.role));return{...y,preset_id:null,runner_script:o,dftb_template_file:qe.has("dftb_template")?y.dftb_template_file??ot("dftb_template"):y.dftb_template_file,turbomole_define_template_file:qe.has("turbomole_define_template")?y.turbomole_define_template_file??ot("turbomole_define_template"):y.turbomole_define_template_file}})}function Xa(o){if(o==="mm"){X(U=>({...Tm(U,U.mm_force_field),preset_id:null,job_type:"mm-md",runner:null,density_g_cm3:q.structure.cell_generated?U.density_g_cm3??1:U.density_g_cm3}));return}const y=(f==null?void 0:f.runners.find(U=>U.id==="ase_xtb"))??(f==null?void 0:f.runners.find(U=>U.supported));X(U=>({...U,preset_id:null,job_type:"qm-md",runner:U.runner??(y==null?void 0:y.id)??null}))}function Ou(o){X(y=>({...Tm(y,o),preset_id:null,job_type:"mm-md",runner:null}))}async function On(o,y){var xe;const U=(xe=y.target.files)==null?void 0:xe[0];if(y.target.value="",!!U)try{const qe=await U.text(),O=q0(o,U.name);G(Ue=>[...Ue.filter(ul=>ul.role!==o),{role:o,name:O,content:qe}]),X(Ue=>I0(Ue,o,O))}catch(qe){Ae({kind:"error",message:jn(qe)})}}function va(){const o=B0(yl,P);Qa.current=o,al(o),ke(String(o))}function Xt(o){if(o===cl)return;P>1&&(Qa.current=P);const y=Q0(o,Qa.current);al(y),ke(String(y))}function ut(o){k(o?{...df,timestep_fs:x.timestep_fs??df.timestep_fs,temperature_k:x.temperature_k??df.temperature_k}:null)}function Ul(o){k(y=>y&&{...y,...o})}function kl(o){X(y=>({...y,preset_id:null,ensemble:o,thermostat:o==="NVE"?null:y.thermostat??"velocity_rescaling",manostat:o==="NPT"?y.manostat??"stochastic_rescaling":null,pressure_bar:o==="NPT"?y.pressure_bar??1.01325:null,moldescriptor_file:o==="NPT"?y.moldescriptor_file??ot("moldescriptor"):y.moldescriptor_file}))}function Zt(o){X(y=>({...y,preset_id:null,ensemble:y.ensemble==="NVE"?"NVT":y.ensemble,thermostat:o}))}function $e(o){X(y=>({...y,preset_id:null,ensemble:"NPT",thermostat:y.thermostat??"velocity_rescaling",manostat:o,pressure_bar:y.pressure_bar??1.01325}))}function je(o,y){H(o),y&&window.setTimeout(()=>{window.requestAnimationFrame(()=>{const U=document.getElementById(y),xe=U==null?void 0:U.closest("details");xe instanceof HTMLDetailsElement&&(xe.open=!0),U==null||U.scrollIntoView({block:"center",behavior:"smooth"}),(U instanceof HTMLInputElement||U instanceof HTMLSelectElement||U instanceof HTMLButtonElement||U instanceof HTMLTextAreaElement)&&U.focus({preventScroll:!0})})},0)}const Dn=w0((f==null?void 0:f.pq)??null);return i.jsxs("div",{className:"app-shell",children:[i.jsxs("header",{className:"app-header",children:[i.jsxs("div",{className:"brand",children:[i.jsx("img",{src:"/pq-logo.png",alt:"PQ"}),i.jsxs("div",{children:[i.jsx("strong",{children:"PQSetup"}),i.jsx("span",{children:"Simulation input"})]})]}),i.jsxs("button",{type:"button",className:"command-trigger","aria-label":`Search setup, ${dt}`,onClick:()=>De(!0),children:[i.jsx(qm,{size:16,"aria-hidden":"true"}),i.jsx("span",{children:"Search setup"}),i.jsx("kbd",{children:dt})]}),i.jsxs("div",{className:"header-status",children:[i.jsxs("a",{className:"header-docs-link",href:Nm,target:"_blank",rel:"noopener noreferrer","aria-label":"Open PQSetup documentation",title:"Open documentation",children:[i.jsx(i0,{size:15,"aria-hidden":"true"}),i.jsx("span",{children:"Docs"})]}),f?i.jsxs(i.Fragment,{children:[i.jsxs("span",{className:f.pq.found?"status-ready":"status-missing","aria-label":`PQ ${f.pq.found?f.pq.version??"detected":"not found"}`,title:`PQ ${f.pq.found?f.pq.version??"detected":"not found"}`,children:[i.jsx("span",{className:"status-dot","aria-hidden":"true"}),i.jsxs("span",{className:"status-text",children:["PQ"," ",f.pq.found?f.pq.version??"detected":"not found"]})]}),i.jsxs("span",{className:"version",children:["Schema ",f.target_pq_release]})]}):_?i.jsxs("span",{className:"status-missing","aria-label":"Backend unavailable",title:"Backend unavailable",children:[i.jsx("span",{className:"status-dot","aria-hidden":"true"}),i.jsx("span",{className:"status-text",children:"Backend unavailable"})]}):i.jsxs("span",{className:"loading-label","aria-label":"Checking system",title:"Checking system",children:[i.jsx(Ra,{size:15,className:"spin"}),i.jsx("span",{className:"status-text",children:"Checking system"})]})]})]}),i.jsxs("div",{className:"workspace",children:[i.jsxs("nav",{ref:Ya,className:"workflow","aria-label":"Setup workflow",children:[i.jsxs("div",{className:"workflow-title",children:[i.jsx("span",{children:"Workflow"}),i.jsx(r0,{size:16,"aria-label":"Keyboard accessible"})]}),i.jsx("ol",{children:Fl.map((o,y)=>i.jsx("li",{children:i.jsxs("button",{ref:U=>{Nu.current[o.id]=U},type:"button",className:D===o.id?"active":"","aria-current":D===o.id?"step":void 0,onClick:()=>H(o.id),children:[i.jsx("span",{className:`step-marker ${Mn[o.id]}`,children:Mn[o.id]==="ok"?i.jsx(pf,{size:13}):y+1}),i.jsxs("span",{className:"step-copy",children:[i.jsx("strong",{children:o.label}),i.jsx("small",{children:o.hint})]}),i.jsx(uf,{size:15,"aria-hidden":"true"})]})},o.id))}),i.jsxs("div",{className:"workflow-tip",children:[i.jsx("span",{children:"Alt 1–5"}),"Jump between steps"]})]}),i.jsxs("main",{className:"setup-main",ref:Nn,children:[Rt&&i.jsxs("div",{className:`notice ${Rt.kind}`,role:"status",children:[Rt.kind==="error"?i.jsx(Ha,{size:17}):i.jsx(yf,{size:17}),i.jsx("span",{children:Rt.message}),i.jsx("button",{type:"button",onClick:()=>Ae(null),children:"Dismiss"})]}),D==="system"&&i.jsxs("section",{className:"step-panel",children:[i.jsx(_u,{eyebrow:"01 · System",title:"Choose the structure",description:"PQSetup checks coordinates, the periodic cell, elements, and close contacts before a run is created."}),i.jsx("input",{ref:Ba,className:"visually-hidden",type:"file",accept:".rst,.xyz,.cif,.pdb,.mol,.sdf,.traj,.extxyz",onChange:nt}),i.jsxs("button",{type:"button",className:"drop-zone",onClick:ga,onDragOver:o=>o.preventDefault(),onDrop:o=>{o.preventDefault();const y=o.dataTransfer.files[0];y&&An(y)},children:[$?i.jsx(Ra,{className:"spin",size:25}):i.jsx(sf,{size:25}),i.jsxs("span",{children:[i.jsx("strong",{children:$?"Checking structure…":"Drop a structure here"}),i.jsx("small",{children:"or choose RST, CIF, XYZ, PDB, MOL, or trajectory"})]}),i.jsx("span",{className:"choose-file",children:"Choose file"})]}),i.jsxs("div",{className:"current-file",children:[i.jsx("div",{className:"file-icon",children:i.jsx(cf,{size:20})}),i.jsxs("div",{children:[i.jsx("span",{className:"eyebrow",children:ee?"Example":"Current"}),i.jsx("strong",{children:q.structure.source_name}),i.jsxs("small",{children:[i.jsx(Hm,{formula:q.summary.formula})," ·"," ",q.summary.atom_count.toLocaleString()," atoms"]})]}),i.jsx("span",{className:q.valid?"file-valid":"file-invalid",children:q.valid?"Valid":"Review"})]}),i.jsxs("div",{className:"inline-note",children:[i.jsx("strong",{children:"PQ cell convention"}),i.jsx("p",{children:"Periodic coordinates are wrapped around the cell center, from −L/2 to +L/2. The original file remains unchanged."})]})]}),D==="method"&&i.jsxs("section",{className:"step-panel",children:[i.jsx(_u,{eyebrow:"02 · Method",title:"Choose the interaction model",description:"Use one electronic-structure calculator or one molecular-mechanics model for the run sequence."}),f&&i.jsxs("div",{className:"compatibility-line","aria-label":"PQ compatibility",children:[i.jsxs("span",{children:["Installed ",i.jsx("strong",{children:f.pq.version??"unknown"})]}),i.jsx("span",{"aria-hidden":"true",children:"·"}),i.jsxs("span",{children:["Target schema ",i.jsx("strong",{children:f.target_pq_release})]})]}),i.jsxs("fieldset",{className:"interaction-model-fieldset",children:[i.jsx("legend",{children:"Interaction model"}),i.jsxs("div",{className:"interaction-model-options",children:[i.jsxs("label",{className:ce?"":"selected",children:[i.jsx("input",{type:"radio",name:"interaction-model",checked:!ce,onChange:()=>Xa("qm")}),i.jsxs("span",{children:[i.jsx("strong",{children:"Quantum mechanics"}),i.jsx("small",{children:"External electronic-structure calculator"})]})]}),i.jsxs("label",{className:ce?"selected":"",children:[i.jsx("input",{type:"radio",name:"interaction-model",checked:ce,onChange:()=>Xa("mm")}),i.jsxs("span",{children:[i.jsx("strong",{children:"Molecular mechanics"}),i.jsx("small",{children:"GUFF or a classical force field"})]})]})]})]}),ce?i.jsxs("div",{className:"method-content",children:[i.jsxs("div",{className:"method-principle",children:[i.jsx("strong",{children:"Force-field model"}),i.jsx("span",{children:"PQSetup packages supplied parameters unchanged. It does not infer a force field from coordinates."})]}),i.jsxs("fieldset",{className:"mm-mode-fieldset",children:[i.jsx("legend",{children:"Interaction terms"}),i.jsx("div",{className:"mm-mode-list",children:gf.map(o=>i.jsxs("label",{className:x.mm_force_field===o.value?"selected":"",children:[i.jsx("input",{type:"radio",name:"mm-force-field",checked:x.mm_force_field===o.value,onChange:()=>Ou(o.value)}),i.jsxs("span",{children:[i.jsx("strong",{children:o.label}),i.jsx("small",{children:o.description})]})]},o.value))})]}),i.jsxs("div",{className:"form-grid mm-settings",children:[q.structure.cell_generated&&i.jsx(Ce,{label:"System density",unit:"g cm⁻³",controlId:"mm-density",help:"Required because the imported structure has no physical periodic cell. PQ uses the equivalent kg L⁻¹ value.",children:i.jsx("input",{type:"number",min:"0.000001",step:"0.01",value:x.density_g_cm3??"",onChange:o=>X(y=>({...y,density_g_cm3:o.target.value?Number(o.target.value):null}))})}),i.jsx(Ce,{label:"Coulomb cutoff",unit:"Å",controlId:"mm-cutoff",help:q.structure.cell_generated?"Must be below half the box length derived from the density.":"Must fit inside half the shortest periodic box length.",children:i.jsx("input",{type:"number",min:"0",step:"0.1",value:x.coulomb_cutoff_angstrom,onChange:o=>X(y=>({...y,coulomb_cutoff_angstrom:Number(o.target.value)}))})})]}),!Gt&&i.jsxs("div",{className:"inline-warning",role:"alert",children:[i.jsx(Ha,{size:15,"aria-hidden":"true"}),"Import a PQ restart with molecule type IDs for molecular mechanics."]}),i.jsxs("section",{className:"setup-files","aria-labelledby":"setup-files-title",children:[i.jsxs("div",{className:"section-rule-heading",children:[i.jsx("strong",{id:"setup-files-title",children:"Force-field files"}),i.jsx("span",{children:"Included in the package"})]}),i.jsx("div",{className:"setup-file-list",children:mt.map(o=>{const y=W.find(U=>U.role===o.role);return i.jsxs("label",{className:y?"selected":"",children:[i.jsx("input",{className:"setup-file-input",type:"file",onChange:U=>void On(o.role,U)}),i.jsx(sf,{size:16,"aria-hidden":"true"}),i.jsxs("span",{children:[i.jsx("strong",{children:o.label}),i.jsx("small",{children:(y==null?void 0:y.name)??o.defaultName})]}),i.jsx("span",{className:y?"file-added":o.optional?"file-optional":"file-required",children:y?"Added":o.optional?"Optional":"Required"})]},o.role)})})]})]}):i.jsxs("div",{className:"method-content",children:[i.jsxs("div",{className:"method-principle",children:[i.jsx("strong",{children:"Calculator"}),i.jsx("span",{children:"Select the calculator required by the study. Missing local software is reported but does not prevent setup."})]}),i.jsxs("div",{className:"calculator-list",role:"radiogroup","aria-label":"Calculator",children:[((f==null?void 0:f.runners)??[]).filter(o=>o.supported).map(o=>{const y=x.runner===o.id,U=o.ready?"ready":o.installed?"incomplete":"missing";return i.jsxs("div",{className:`calculator-option ${y?"selected":""}`,children:[i.jsxs("label",{children:[i.jsx("input",{type:"radio",name:"calculator",checked:y,onChange:()=>yt(o.id)}),i.jsx("span",{className:"calculator-radio","aria-hidden":"true",children:y&&i.jsx("span",{})}),i.jsxs("span",{className:"runner-name",children:[i.jsx("strong",{children:o.label}),i.jsx("small",{children:o.version?`Version ${o.version}`:o.detail})]}),i.jsx("span",{className:`runner-state ${U}`,children:o.ready?"Ready":o.installed?"Setup incomplete":"Not detected"})]}),y&&!o.ready&&i.jsxs("div",{className:"calculator-warning",role:"status",children:[i.jsx(Ha,{size:14,"aria-hidden":"true"}),i.jsxs("span",{children:[o.detail," Inputs can still be created."]})]})]},o.id)}),!f&&i.jsxs("div",{className:"runner-loading",children:[i.jsx(Ra,{className:"spin",size:18}),"Detecting calculators"]})]}),!x.runner&&i.jsxs("div",{className:"inline-warning",role:"alert",children:[i.jsx(Ha,{size:15,"aria-hidden":"true"}),"Select a calculator."]}),Yt.length>0&&(Yt.length>1||!(Qt!=null&&Qt.recommended_script))&&i.jsxs("fieldset",{className:"electronic-method-fieldset",children:[i.jsx("legend",{children:"Electronic method"}),i.jsx("div",{className:"electronic-method-options",role:"radiogroup","aria-label":"Electronic method",children:Yt.map(o=>i.jsxs("label",{className:x.runner_script===o.name?"selected":"",children:[i.jsx("input",{type:"radio",name:"electronic-method",checked:x.runner_script===o.name,onChange:()=>La(o.name)}),i.jsx("span",{children:o.label})]},o.name))}),i.jsx("p",{children:"Used for equilibration and sampling."}),!et&&i.jsxs("div",{className:"inline-warning",role:"alert",children:[i.jsx(Ha,{size:15,"aria-hidden":"true"}),"Choose an electronic method."]})]}),mt.length>0&&i.jsxs("section",{className:"setup-files","aria-labelledby":"qm-setup-files-title",children:[i.jsxs("div",{className:"section-rule-heading",children:[i.jsx("strong",{id:"qm-setup-files-title",children:"Required files"}),i.jsx("span",{children:"Included in the package"})]}),i.jsx("div",{className:"setup-file-list",children:mt.map(o=>{const y=W.find(U=>U.role===o.role);return i.jsxs("label",{className:y?"selected":"",children:[i.jsx("input",{className:"setup-file-input",type:"file",onChange:U=>void On(o.role,U)}),i.jsx(sf,{size:16,"aria-hidden":"true"}),i.jsxs("span",{children:[i.jsx("strong",{children:o.label}),i.jsx("small",{children:(y==null?void 0:y.name)??o.defaultName})]}),i.jsx("span",{className:y?"file-added":"file-required",children:y?"Added":"Required"})]},o.role)})})]})]})]}),D==="conditions"&&i.jsxs("section",{className:"step-panel",children:[i.jsx(_u,{eyebrow:"03 · Conditions",title:"Build the run protocol",description:"Optionally equilibrate, then create one or more linked sampling files."}),i.jsxs("div",{className:"stage-timeline",children:[i.jsxs("section",{className:`optional-stage ${V?"enabled":""}`,"aria-label":"Equilibration",children:[i.jsxs("header",{className:"optional-stage-heading",children:[i.jsx("span",{className:"stage-number stage-code",children:"eq"}),i.jsxs("span",{className:"stage-summary",children:[i.jsx("strong",{children:"Equilibration"}),i.jsx("small",{children:"Optional NVT preparation"})]}),i.jsxs("label",{className:"stage-toggle",children:[i.jsx("span",{children:V?"Included":"Skip"}),i.jsx("input",{type:"checkbox","aria-label":"Include equilibration stage",checked:!!V,onChange:o=>ut(o.target.checked)}),i.jsx("span",{className:"stage-toggle-track","aria-hidden":"true",children:i.jsx("span",{})})]})]}),V&&i.jsxs("details",{className:"stage-settings",children:[i.jsxs("summary",{children:[i.jsxs("span",{children:[i.jsx("strong",{children:"Equilibration settings"}),i.jsx("small",{children:"NVT · fixed cell"})]}),i.jsx("span",{className:"stage-duration",children:hf(V.steps,V.timestep_fs)}),i.jsx(Dm,{size:17,"aria-hidden":"true"})]}),i.jsxs("div",{className:"stage-body",children:[i.jsxs("div",{className:"form-grid stage-primary-grid",children:[i.jsx(Ce,{label:"Target temperature",unit:"K",children:i.jsx("input",{type:"number",min:"0.000001",step:"0.01",value:V.temperature_k,onChange:o=>Ul({temperature_k:Number(o.target.value)})})}),i.jsx(Ce,{label:"Timestep",unit:"fs",children:i.jsx("input",{type:"number",min:"0.000001",step:"0.1",value:V.timestep_fs,onChange:o=>Ul({timestep_fs:Number(o.target.value)})})}),i.jsx(Ce,{label:"Steps",children:i.jsx("input",{type:"number",min:"1",step:"1",value:V.steps,onChange:o=>Ul({steps:Number(o.target.value)})})})]}),i.jsx(Mm,{value:V,onChange:o=>Ul({...o,thermostat:o.thermostat??V.thermostat,thermostat_relaxation_ps:o.thermostat_relaxation_ps??V.thermostat_relaxation_ps})}),i.jsx(Am,{value:V,onChange:Ul})]})]})]}),V&&i.jsx(i.Fragment,{children:i.jsxs("div",{className:"stage-connection",children:[i.jsx(o0,{size:14,"aria-hidden":"true"}),"eq restart continues into sampling 01"]})}),i.jsxs("section",{className:"protocol-stage sampling-stage",children:[i.jsxs("header",{className:"sampling-heading",children:[i.jsx("span",{className:`stage-number ${P>1?"stage-range":""}`,children:P>1?`01–${zu(P)}`:"01"}),i.jsxs("span",{className:"stage-summary",children:[i.jsx("strong",{children:"Sampling"}),i.jsxs("small",{children:[L0(P,!!V)," ","· ",x.ensemble]})]}),i.jsx("span",{className:"stage-duration",children:hf(Lt,x.timestep_fs)})]}),i.jsxs("div",{className:"stage-body",children:[i.jsxs("section",{className:"sampling-plan","aria-labelledby":"sampling-files-title",children:[i.jsxs("div",{className:"section-rule-heading",children:[i.jsx("strong",{id:"sampling-files-title",children:"Sampling files"}),i.jsx("span",{children:"Run layout"})]}),i.jsxs("fieldset",{className:"sampling-output-fieldset",children:[i.jsx("legend",{children:"Write sampling as"}),i.jsxs("div",{className:"sampling-output-modes",children:[i.jsxs("label",{className:cl==="single"?"selected":"",children:[i.jsx("input",{type:"radio",name:"sampling-output-mode",value:"single",checked:cl==="single",onChange:()=>Xt("single")}),i.jsxs("span",{children:[i.jsx("strong",{children:"Single input"}),i.jsx("small",{children:"One run-01.in"})]})]}),i.jsxs("label",{className:cl==="continued"?"selected":"",children:[i.jsx("input",{type:"radio",name:"sampling-output-mode",value:"continued",checked:cl==="continued",onChange:()=>Xt("continued")}),i.jsxs("span",{children:[i.jsx("strong",{children:"Split into continued inputs"}),i.jsx("small",{children:"Numbered 01, 02, 03…"})]})]})]})]}),i.jsx("p",{className:"sampling-output-description","aria-live":"polite",children:cl==="single"?"Create one sampling input.":`Create ${P} linked inputs. Each later input reads the previous restart.`}),i.jsxs("div",{className:`form-grid sampling-length-grid ${cl}`,children:[i.jsx(Ce,{label:cl==="single"?"Steps":"Steps per input",controlId:"sampling-steps",children:i.jsx("input",{type:"number",min:"1",step:"1",value:x.steps??"",onChange:o=>X(y=>({...y,steps:o.target.value?Number(o.target.value):null}))})}),cl==="continued"&&i.jsx(Ce,{label:"Number of inputs",controlId:"sampling-run-count",help:`Linked inputs are numbered automatically. Maximum ${xu}.`,children:i.jsx("input",{type:"number",min:"2",max:xu,step:"1",inputMode:"numeric",value:yl,onChange:o=>{const y=o.target.value;ke(y);const U=R0(y);U!==null&&(Qa.current=U,al(U))},onBlur:va,onKeyDown:o=>{o.key==="Enter"&&o.currentTarget.blur()}})})]}),i.jsxs("div",{className:"sampling-total","aria-live":"polite",children:[i.jsxs("span",{children:[i.jsx("strong",{children:P}),P===1?"input file":"input files"]}),i.jsxs("span",{children:[i.jsx("strong",{children:((it=x.steps)==null?void 0:it.toLocaleString())??"—"}),cl==="single"?"steps":"steps per input"]}),i.jsxs("span",{children:[i.jsx("strong",{children:hf(Lt,x.timestep_fs)}),"total sampling time"]})]}),i.jsxs("div",{className:"filename-chain","aria-label":`Run order: ${En.join(" then ")}`,children:[i.jsx("span",{children:"Run order"}),i.jsx("div",{children:En.map((o,y)=>i.jsxs("span",{children:[y>0&&i.jsx(Xi,{size:12,"aria-hidden":"true"}),o==="…"?i.jsx("b",{children:"…"}):i.jsx("code",{children:o})]},`${o}-${y}`))})]})]}),i.jsxs("fieldset",{className:"ensemble-fieldset",children:[i.jsx("legend",{children:"Sampling ensemble"}),i.jsx("div",{role:"radiogroup","aria-label":"Sampling ensemble",children:[["NVE","Energy"],["NVT","Temperature"],["NPT","Temperature + pressure"]].map(([o,y])=>i.jsxs("button",{type:"button",role:"radio","aria-checked":x.ensemble===o,className:x.ensemble===o?"selected":"",onClick:()=>kl(o),children:[i.jsx("strong",{children:o}),i.jsx("small",{children:y})]},o))}),i.jsx("p",{children:x.ensemble==="NVE"?"Fixed particle number, volume, and total energy.":x.ensemble==="NVT"?"Fixed particle number and volume with temperature coupling.":"Fixed particle number with temperature and pressure coupling."})]}),i.jsxs("div",{className:"form-grid sampling-condition-grid",children:[i.jsx(Ce,{label:x.ensemble==="NVE"?"Initial temperature":"Target temperature",unit:"K",controlId:"sampling-temperature",children:i.jsx("input",{type:"number",min:"0.000001",step:"0.01",value:x.temperature_k??"",onChange:o=>X(y=>({...y,temperature_k:o.target.value?Number(o.target.value):null}))})}),x.ensemble==="NPT"&&i.jsx(Ce,{label:"Target pressure",unit:"bar",controlId:"sampling-pressure",help:"1 atm = 1.01325 bar; negative values model tension.",children:i.jsx("input",{type:"number",step:"0.00001",value:x.pressure_bar??"",onChange:o=>X(y=>({...y,pressure_bar:o.target.value?Number(o.target.value):null}))})}),i.jsx(Ce,{label:"Timestep",unit:"fs",controlId:"sampling-timestep",children:i.jsx("input",{type:"number",min:"0.000001",step:"0.1",value:x.timestep_fs??"",onChange:o=>X(y=>({...y,timestep_fs:o.target.value?Number(o.target.value):null}))})})]}),(x.ensemble==="NVT"||x.ensemble==="NPT")&&i.jsxs(i.Fragment,{children:[i.jsx(Mm,{value:x,controlId:"sampling-thermostat",onChange:o=>X(y=>({...y,preset_id:null,...o}))}),i.jsx(Am,{value:x,onChange:o=>X(y=>({...y,preset_id:null,...o}))})]}),x.ensemble==="NPT"&&i.jsx(ey,{value:x,controlId:"sampling-manostat",onChange:o=>X(y=>({...y,preset_id:null,...o}))})]})]})]})]}),D==="prepare"&&i.jsxs("section",{className:"step-panel",children:[i.jsx(_u,{eyebrow:"04 · Prepare",title:"Prepare the coordinates",description:"Optional perturbation can break perfect crystal symmetry. Every prepared structure is revalidated."}),i.jsxs("div",{className:"prepare-row locked",children:[i.jsx("div",{className:"prepare-icon",children:i.jsx(pf,{size:18})}),i.jsxs("div",{children:[i.jsx("strong",{children:"Wrap into the centered cell"}),i.jsx("p",{children:"Periodic atoms use PQ’s −L/2 to +L/2 convention."})]}),i.jsx("span",{children:"Applied"})]}),i.jsxs("div",{className:`prepare-option ${Z?"enabled":""}`,children:[i.jsxs("label",{className:"switch-row",children:[i.jsx("span",{className:"prepare-icon",children:i.jsx(_m,{size:18})}),i.jsxs("span",{children:[i.jsx("strong",{children:"Break perfect symmetry"}),i.jsx("small",{children:"Add a small seeded Gaussian position offset."})]}),i.jsx("input",{type:"checkbox",checked:Z,disabled:!te,onChange:o=>{le(o.target.checked),o.target.checked||nl()}}),i.jsx("span",{className:"switch","aria-hidden":"true"})]}),Z&&i.jsxs("div",{className:"prepare-fields",children:[i.jsx(Ce,{label:"Position σ",unit:"Å",controlId:"position-sigma",help:"0.01 Å is a conservative starting point.",children:i.jsx("input",{type:"number",min:"0",max:"0.2",step:"0.001",value:ue,onChange:o=>{nl(),ge(Number(o.target.value))}})}),i.jsx(Ce,{label:"Random seed",controlId:"position-seed",help:"The same seed reproduces the same coordinates.",children:i.jsx("input",{type:"number",min:"0",max:"4294967295",step:"1",value:x.random_seed,onChange:o=>{nl(),X(y=>({...y,random_seed:Number(o.target.value)}))}})}),i.jsxs("button",{type:"button",className:"secondary-action",disabled:ye||!te,onClick:()=>void ll(),children:[ye?i.jsx(Ra,{className:"spin",size:16}):i.jsx(_m,{size:16}),"Apply to original"]})]}),we&&i.jsxs("div",{className:"preparation-applied",children:[i.jsx(yf,{size:15}),"Applied · σ ",we.sigma_angstrom," Å · seed"," ",we.seed]}),!te&&i.jsx("p",{className:"example-limit",children:"Import a structure to enable reproducible preparation."})]}),i.jsxs("div",{className:"velocity-note",children:[i.jsxs("div",{children:[i.jsx("strong",{children:"Velocities are generated by PQ"}),i.jsxs("p",{children:["PQ samples the mass-dependent Maxwell–Boltzmann distribution at ",x.temperature_k??"the target"," K and removes net motion. PQSetup writes the temperature and seed."]})]}),i.jsx("span",{children:"Recommended"})]})]}),D==="review"&&i.jsxs("section",{className:"step-panel review-panel",children:[i.jsx(_u,{eyebrow:"05 · Review",title:"Review the inputs",description:"Check the input sequence before creating the run package."}),i.jsxs("div",{className:"form-grid review-fields",children:[i.jsx(Ce,{label:"Run name",controlId:"run-name",children:i.jsx("input",{value:x.file_prefix,onChange:o=>X(y=>({...y,file_prefix:o.target.value}))})}),i.jsx(Ce,{label:"Start file",controlId:"start-file",children:i.jsx("input",{value:x.start_file,onChange:o=>X(y=>({...y,start_file:o.target.value}))})})]}),i.jsxs("div",{className:"review-summary","aria-live":"polite",children:[i.jsxs("span",{children:[i.jsx("strong",{children:(C==null?void 0:C.files.length)??0})," ",(C==null?void 0:C.files.length)===1?"input file":"input files"]}),i.jsxs("span",{children:[i.jsx("strong",{children:ha})," method"]}),i.jsxs("span",{children:[i.jsx("strong",{children:P})," sampling"," ",P===1?"file":"files",V?" + eq":""]})]}),i.jsxs("section",{className:"run-launcher","aria-labelledby":"run-launcher-title",children:[i.jsxs("div",{children:[i.jsx("strong",{id:"run-launcher-title",children:"Run the package"}),i.jsx("span",{children:Dn.detail})]}),i.jsx("pre",{children:i.jsx("code",{children:Dn.command})}),i.jsxs("p",{children:["Stops at the first failed input or when PQ does not report"," ",i.jsx("code",{children:"PQ ended normally"}),"."]})]}),C&&C.files.length>0&&i.jsxs("section",{className:"generated-inputs","aria-labelledby":"generated-inputs-title",children:[i.jsxs("header",{children:[i.jsxs("span",{children:[i.jsx("strong",{id:"generated-inputs-title",children:"Generated inputs"}),i.jsx("small",{children:ha})]}),i.jsxs("span",{children:[C.files.length," ",C.files.length===1?"file":"files"]})]}),C.files.length===1?i.jsxs("div",{className:"single-input-file",children:[i.jsx(cf,{size:16,"aria-hidden":"true"}),i.jsxs("span",{children:[i.jsx("strong",{children:_e==null?void 0:_e.name}),i.jsx("small",{children:_e==null?void 0:_e.stage_label})]})]}):i.jsxs("div",{className:"input-navigator",children:[i.jsx("button",{type:"button","aria-label":"Previous input","aria-controls":"generated-input-preview",disabled:Ge<=0,onClick:()=>{Ge<=0||Je(C.files[Ge-1].name)},children:i.jsx(c0,{size:16,"aria-hidden":"true"})}),i.jsxs("label",{htmlFor:Il,children:[i.jsx("span",{className:"visually-hidden",children:"Generated input"}),i.jsxs("select",{id:Il,"aria-label":"Generated input","aria-controls":"generated-input-preview",value:(_e==null?void 0:_e.name)??"",onChange:o=>Je(o.target.value),children:[wl.length>0&&i.jsx("optgroup",{label:"Equilibration",children:wl.map(o=>i.jsx("option",{value:o.name,children:zm(o,C.files.length)},o.name))}),dl.length>0&&i.jsx("optgroup",{label:"Sampling",children:dl.map(o=>i.jsx("option",{value:o.name,children:zm(o,C.files.length)},o.name))})]})]}),i.jsxs("output",{"aria-live":"polite",children:[Ge+1," of ",C.files.length]}),i.jsx("button",{type:"button","aria-label":"Next input","aria-controls":"generated-input-preview",disabled:Ge<0||Ge>=C.files.length-1,onClick:()=>{Ge<0||Ge>=C.files.length-1||Je(C.files[Ge+1].name)},children:i.jsx(uf,{size:16,"aria-hidden":"true"})})]})]}),i.jsxs("div",{className:"input-preview",id:"generated-input-preview",role:"region","aria-label":`Input preview: ${(_e==null?void 0:_e.name)??"preparing inputs"}`,children:[i.jsxs("div",{className:"preview-title",children:[i.jsxs("span",{children:[i.jsx(cf,{size:16}),(_e==null?void 0:_e.name)??"Preparing inputs…"]}),N&&i.jsx(Ra,{className:"spin",size:15})]}),_e&&i.jsxs("div",{className:"preview-continuation",children:[i.jsxs("span",{children:["Starts from ",i.jsx("strong",{children:_e.start_file})]}),i.jsx(Xi,{size:13,"aria-hidden":"true"}),i.jsxs("span",{children:["writes ",i.jsx("strong",{children:_e.restart_file})]})]}),i.jsx("pre",{children:i.jsx("code",{children:(_e==null?void 0:_e.input_text)||((gt=C==null?void 0:C.diagnostics[0])==null?void 0:gt.message)||"Preparing inputs…"})})]}),i.jsxs("button",{type:"button",className:"create-run large",disabled:!zl||j,onClick:()=>void at(),children:[j?i.jsx(Ra,{className:"spin",size:18}):i.jsx(Sm,{size:18}),j?"Creating package…":`Create package · ${(C==null?void 0:C.files.length)??0} ${(C==null?void 0:C.files.length)===1?"input":"inputs"}`,i.jsx("span",{children:"Ctrl Enter"})]})]}),i.jsxs("footer",{className:"step-footer",children:[i.jsxs("span",{children:["Step ",Fl.findIndex(o=>o.id===D)+1," of"," ",Fl.length]}),D!=="review"&&i.jsxs("button",{type:"button",onClick:()=>{const o=Fl.findIndex(y=>y.id===D);H(Fl[Math.min(o+1,Fl.length-1)].id)},children:["Continue",i.jsx(Xi,{size:16})]})]})]}),i.jsxs("aside",{className:"inspector",children:[i.jsx(W0,{analysis:q,example:ee,generatedCellTreatment:ce?"density":"padding",densityGcm3:x.density_g_cm3}),i.jsxs("section",{className:"preflight","aria-labelledby":"preflight-title",children:[i.jsxs("div",{className:"preflight-heading",children:[i.jsxs("div",{children:[i.jsx("span",{className:"eyebrow",children:"Preflight"}),i.jsx("h2",{id:"preflight-title",children:zl?"Ready to create":"Check the run"})]}),i.jsx("span",{className:`preflight-score ${zl?"ready":""}`,children:Tn})]}),i.jsxs("ul",{className:"preflight-list",children:[i.jsxs("li",{className:f!=null&&f.pq.found?"ok":"warn",children:[i.jsx(Li,{status:f!=null&&f.pq.found?"ok":"warn"}),i.jsxs("span",{children:[i.jsx("strong",{children:"PQ executable"}),i.jsx("small",{children:(f==null?void 0:f.pq.detail)??"Checking…"})]})]}),i.jsxs("li",{className:q.valid?"ok":"warn",children:[i.jsx(Li,{status:q.valid?"ok":"warn"}),i.jsxs("span",{children:[i.jsx("strong",{children:"Structure"}),i.jsx("small",{children:q.valid?"Coordinates and cell are valid.":"Structure errors need attention."})]})]}),i.jsxs("li",{className:Vl&&!tt?"ok":"warn",children:[i.jsx(Li,{status:Vl&&!tt?"ok":Vl||ce?"warn":"idle"}),i.jsxs("span",{children:[i.jsx("strong",{children:"Method"}),i.jsx("small",{children:ce?Gt?lt.length?`Add ${lt.length} required force-field ${lt.length===1?"file":"files"}.`:pa?`${ha} is ready.`:"Set the system density.":"Import a PQ restart with molecule type IDs.":x.runner?Qt&&!et?"Choose an electronic method.":lt.length?`Add ${lt.length} required ${lt.length===1?"file":"files"}.`:tt?`${ha} was not detected.`:`${ha} is ready.`:"Choose a calculator."})]})]}),i.jsxs("li",{className:C!=null&&C.valid?"ok":"warn",children:[i.jsx(Li,{status:C!=null&&C.valid?"ok":C?"warn":"idle"}),i.jsxs("span",{children:[i.jsx("strong",{children:"PQ inputs"}),i.jsx("small",{children:C!=null&&C.valid?pt?`${C.files.length} input ${C.files.length===1?"file":"files"} ready for PQ validation.`:`${C.files.length} input ${C.files.length===1?"file":"files"} generated locally; PQ validation is unavailable.`:N?"Validating…":"Input settings need attention."})]})]})]}),Ga.length>0&&i.jsx("div",{className:"diagnostics",children:Ga.slice(0,4).map((o,y)=>o.severity==="info"?i.jsxs("div",{className:"diagnostic-row info",children:[i.jsx(Cm,{size:14,"aria-hidden":"true"}),i.jsx("span",{children:o.message})]},`${o.code}-${y}`):i.jsxs("button",{type:"button",className:o.severity,onClick:()=>H(xm(o.code)),children:[i.jsx(Ha,{size:14,"aria-hidden":"true"}),i.jsx("span",{children:o.message}),i.jsx(uf,{size:14,"aria-hidden":"true"})]},`${o.code}-${y}`))}),i.jsxs("button",{type:"button",className:"create-run",disabled:!zl||j,onClick:()=>void at(),children:[j?i.jsx(Ra,{className:"spin",size:17}):i.jsx(Sm,{size:17}),"Create package"]})]})]})]}),i.jsx(x0,{open:el,commands:Au,onClose:()=>De(!1)})]})}t0.createRoot(document.getElementById("root")).render(i.jsx(R.StrictMode,{children:i.jsx(ly,{})})); diff --git a/pqsetup/static/index.html b/pqsetup/static/index.html index 57ddbf3..ccab423 100644 --- a/pqsetup/static/index.html +++ b/pqsetup/static/index.html @@ -9,7 +9,7 @@ /> PQSetup - + diff --git a/tests/test_api_cli.py b/tests/test_api_cli.py index 2c100b1..3b0bf2e 100644 --- a/tests/test_api_cli.py +++ b/tests/test_api_cli.py @@ -67,6 +67,45 @@ def test_bootstrap_reports_pq_runners_and_presets(monkeypatch) -> None: assert "mace_cpp" not in runner_ids +def test_bootstrap_respects_selected_pq_build_capabilities(monkeypatch) -> None: + monkeypatch.setattr( + pqsetup.api, + "discover_pq", + lambda _: PQStatus( + found=True, + executable="/tools/PQ", + version="v0.7.0", + detail="Ready.", + capabilities={ + "schema": "pq.capabilities", + "schema_version": 1, + "input": {"qm_programs": ["dftbplus", "pyscf", "turbomole"]}, + }, + ), + ) + monkeypatch.setattr( + pqsetup.api, + "detect_runners", + lambda _: [ + RunnerStatus( + id="ase_xtb", + label="ASE · xTB", + supported=True, + installed=True, + ready=True, + detail="ASE and DFTB+ detected.", + ) + ], + ) + + payload = TestClient(create_app()).get("/api/bootstrap").json() + + assert payload["runners"][0]["installed"] + assert payload["runners"][0]["ready"] + assert payload["runners"][0]["available_in_pq"] is False + assert payload["runners"][0]["detail"] == "ASE and DFTB+ detected." + + def test_untrusted_host_is_rejected() -> None: response = TestClient(create_app()).get( "/api/health", @@ -470,3 +509,31 @@ def test_doctor_reports_incomplete_setup_without_calling_it_missing(capsys) -> N assert "DFTB+ setup incomplete · DFTB+ detected." in output assert "missing" not in output assert "ready" not in output + + +def test_doctor_reports_selected_pq_build_support_separately(capsys) -> None: + _print_doctor( + DoctorReport( + pq=PQStatus( + found=True, + executable="/tools/PQ", + version="v0.7.0", + detail="Detected.", + ), + runners=[ + RunnerStatus( + id="ase_xtb", + label="ASE · xTB", + supported=True, + installed=True, + ready=True, + available_in_pq=False, + detail="ASE and DFTB+ detected.", + ) + ], + diagnostics=[], + ) + ) + + output = capsys.readouterr().out + assert "ASE · xTB calculator ready · PQ build mismatch" in output diff --git a/tests/test_plan_api_export.py b/tests/test_plan_api_export.py index b3c7200..ebec9b7 100644 --- a/tests/test_plan_api_export.py +++ b/tests/test_plan_api_export.py @@ -183,6 +183,8 @@ def test_plan_export_manifest_and_archive_are_self_consistent(monkeypatch) -> No assert manifest["environment"]["calculator"] == { "id": "ase_xtb", "detected": True, + "calculator_ready": True, + "available_in_pq": None, "ready": True, "version": "1.0", "detail": "Detected.", @@ -359,6 +361,42 @@ def test_manifest_distinguishes_detection_from_incomplete_setup(monkeypatch) -> assert "runner.not_detected" not in warnings +def test_manifest_records_selected_pq_build_mismatch(monkeypatch) -> None: + monkeypatch.setattr( + pqsetup.api, + "discover_pq", + lambda _: PQStatus( + found=True, + executable="/tools/PQ", + version="v0.7.0", + source="test", + detail="Ready.", + capabilities={ + "schema": "pq.capabilities", + "schema_version": 1, + "input": {"qm_programs": ["dftbplus", "pyscf", "turbomole"]}, + }, + ), + ) + monkeypatch.setattr(pqsetup.api, "detect_runners", lambda _: [_runner()]) + response = TestClient(create_app()).post( + "/api/project/export", + json=_project_payload(), + ) + + assert response.status_code == 200 + with zipfile.ZipFile(io.BytesIO(response.content)) as archive: + manifest = json.loads(archive.read("pqproject.json")) + calculator = manifest["environment"]["calculator"] + assert calculator["detected"] + assert calculator["calculator_ready"] + assert calculator["available_in_pq"] is False + assert not calculator["ready"] + warning_codes = [item["code"] for item in manifest["diagnostics"]] + assert warning_codes.count("environment.pq_method_unavailable") == 1 + assert "runner.incomplete" not in warning_codes + + def test_legacy_export_without_protocol_fields_remains_schema_one( monkeypatch, ) -> None: diff --git a/tests/test_run_plans.py b/tests/test_run_plans.py index 97a0ab8..a2225c1 100644 --- a/tests/test_run_plans.py +++ b/tests/test_run_plans.py @@ -198,7 +198,6 @@ def test_plan_owns_restart_filenames() -> None: ("runner_id", "script"), [ ("dftbplus", "dftbplus_periodic_stress"), - ("pyscf", "pyscf_hf.py"), ("turbomole", "turbomole_rimp2"), ], ) @@ -239,6 +238,27 @@ def test_external_calculators_use_canonical_release_scripts( assert f"qm_script = {script};" in result.files[0].input_text +def test_release_fallback_requires_an_explicit_pyscf_method() -> None: + missing = _render( + RunPlanRequest( + setup=_setup(runner="pyscf"), + ) + ) + selected = _render( + RunPlanRequest( + setup=_setup( + runner="pyscf", + runner_script="pyscf_hf.py", + ), + ) + ) + + assert not missing.valid + assert {item.code for item in missing.diagnostics} == {"runner.script"} + assert selected.valid + assert "qm_script = pyscf_hf.py;" in selected.files[0].input_text + + def test_external_calculator_rejects_an_arbitrary_script() -> None: result = _render( RunPlanRequest( diff --git a/tests/test_runners.py b/tests/test_runners.py index 2cbb2a4..bea4340 100644 --- a/tests/test_runners.py +++ b/tests/test_runners.py @@ -3,7 +3,7 @@ from pathlib import Path import pqsetup.runners as runners -from pqsetup.models import ExternalQMCapabilities +from pqsetup.models import ExternalQMCapabilities, RunnerStatus def _detect( @@ -51,6 +51,32 @@ def binary(names: tuple[str, ...]) -> str | None: } +def test_selected_pq_build_reports_method_availability_separately() -> None: + detected = RunnerStatus( + id="ase_xtb", + label="ASE · xTB", + supported=True, + installed=True, + ready=True, + detail="ASE and DFTB+ detected.", + ) + + statuses = runners.apply_pq_capabilities( + [detected], + { + "schema": "pq.capabilities", + "schema_version": 1, + "input": {"qm_programs": ["dftbplus", "pyscf", "turbomole"]}, + }, + ) + + assert statuses[0].installed + assert statuses[0].supported + assert statuses[0].ready + assert statuses[0].available_in_pq is False + assert statuses[0].detail == "ASE and DFTB+ detected." + + def test_selected_development_pq_finds_canonical_scripts( monkeypatch, tmp_path: Path,