diff --git a/.gitattributes b/.gitattributes index b3dabd4b..00408722 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,3 @@ crates/compass-cli/assets/vendor/pierre-diffs-v1.2.12.js -whitespace -crates/compass-output/assets/viewer/graph.js -whitespace +crates/compass-output/assets/viewer/graph.js -whitespace linguist-generated=true crates/compass-cli/assets/compass-skill/** text eol=lf diff --git a/CHANGELOG.md b/CHANGELOG.md index d019595d..20fa62ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ ## Unreleased +- Replace the predefined flat call-flow architecture model with the native + `compass.viewer.architecture/1` projection. Production source scope is fixed + before grouping, generated/vendor/test/documentation content cannot shape Production, + relationships have explicit classes and lenses, owner/leaf groups use + source-grounded unique names, overview overflow is exact omission metadata + rather than `Other`, and HTML plus VS Code share the same Rust semantics. + Add architecture quality diagnostics, complete-group search, compact + index-based memberships, bounded + drill-down, explicit versioned overlays, and migration guidance for direct + `compass.viewer.callflow/1` consumers. + - Hard-cut Swift, Dart, Scala, and Groovy/Gradle onto version-1 qualifying universal evidence pipelines. The bounded AST-first producer publishes declarations, scopes, bindings, occurrences, and conservative relationship diff --git a/COMPATIBILITY.md b/COMPATIBILITY.md index d06ec533..73b2e117 100644 --- a/COMPATIBILITY.md +++ b/COMPATIBILITY.md @@ -70,6 +70,18 @@ A user-visible incompatible change requires: Versioned formats use Compass-owned identifiers. Consumers should reject unknown major versions instead of attempting legacy fallback behavior. +The architecture viewer is a coordinated hard cut from +`compass.viewer.callflow/1` to `compass.viewer.architecture/1`. Capability +negotiation advertises `architecture_viewer`; consumers must reject an unknown +major. The new payload does not reinterpret old `sections` or `calls` fields: +it publishes typed nodes and relationships once plus source-specific group, +membership, route, omission, and quality projections. The `callflow-json` and +`callflow-html` command names remain available, but direct v1 callflow JSON +consumers must migrate. +Membership records are compact validated indexes into the deterministic node +and per-projection group arrays. Documentation is a first-class All-code source +scope and cannot influence Production architecture. + Before the first compatibility-stable release, Compass hard-resets active internal extraction, cache, publication, store-index, query-index/ranker, overview, qualification, and semantic-diff identities to v1. Provisional diff --git a/CONTEXT.md b/CONTEXT.md new file mode 100644 index 00000000..84f71686 --- /dev/null +++ b/CONTEXT.md @@ -0,0 +1,18 @@ +# Compass domain language + +This glossary records Compass-specific concepts whose meaning must stay stable +across extraction, projection, output, and viewer modules. + +## Language + +**Architecture projection**: +A bounded, source-scoped, relationship-typed presentation of graph communities as project owners, subsystem groups, routes, omissions, and quality evidence. It never rewrites the underlying graph or treats display names as identity. +_Avoid_: Call-flow sections, architecture inference, subsystem catalog + +**Source scope**: +The evidence-backed classification of a graph node as Production, Test, Generated, Vendor, or Unknown for one architecture projection. +_Avoid_: Visibility filter, hidden code + +**Architecture lens**: +A declared subset of typed graph relationships used to explain one aspect of project topology, such as execution, dependency, type, or structure. +_Avoid_: Edge filter, call filter diff --git a/MIGRATION.md b/MIGRATION.md index 00caf8a8..4b0b2a3f 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -27,6 +27,33 @@ candidate exports, and TypeScript scorecards likewise require their `/2` schemas and use `producer` for the language evidence identity; regenerate those audit inputs rather than trying to load the old field names. +## Architecture viewer contract + +`compass export callflow-json` now emits +`compass.viewer.architecture/1`, replacing `compass.viewer.callflow/1`. Update +direct consumers as follows: + +- negotiate `contracts.architecture_viewer` instead of `callflow_viewer`; +- read `relationships` and `relationClass` instead of treating every edge as a + call; +- select `projections[].scope` (`production` or `all_code`) and join + `memberships`, `groups`, and `routes` rather than reading flat `sections`; +- resolve each membership's `nodeIndex` against top-level `nodes` and + `groupIndex` against that projection's `groups` array; +- use `overviewGroupIds`, `overviewRouteIds`, and `omissions` instead of an + `Other` overflow section; and +- surface `quality` independently from extraction status. + +Production excludes Documentation as well as Test, Generated, Vendor, and +Unknown. Select All-code when documentation architecture is intentionally in +scope. + +The old major is rejected rather than silently translated. The CLI command +names remain compatible. Rename project section files to a versioned +`compass.architecture-overlay/1` JSON/TOML overlay and pass +`--architecture-overlay PATH`; `--sections` is temporarily retained as a +deprecated adapter. + ## Install Compass Install the latest macOS release: diff --git a/crates/compass-cli/src/capability_commands.rs b/crates/compass-cli/src/capability_commands.rs index 2c881434..893fa89e 100644 --- a/crates/compass-cli/src/capability_commands.rs +++ b/crates/compass-cli/src/capability_commands.rs @@ -25,7 +25,10 @@ pub fn command(frontend: Frontend, args: &[String]) -> Outcome { compass_version: env!("CARGO_PKG_VERSION"), contracts: BTreeMap::from([ ("graph_viewer", compass_output::GRAPH_VIEWER_SCHEMA), - ("callflow_viewer", compass_output::CALLFLOW_VIEWER_SCHEMA), + ( + "architecture_viewer", + compass_output::ARCHITECTURE_VIEWER_SCHEMA, + ), ("call_graph", compass_analysis::UNIVERSAL_CALL_GRAPH_SCHEMA), ("program_call_graph", compass_analysis::CALL_GRAPH_SCHEMA), ("progress", crate::ide_contract::PROGRESS_SCHEMA), diff --git a/crates/compass-cli/src/help.rs b/crates/compass-cli/src/help.rs index 54b03c52..f42b031a 100644 --- a/crates/compass-cli/src/help.rs +++ b/crates/compass-cli/src/help.rs @@ -555,13 +555,13 @@ const PAGES: &[Page] = &[ "export callflow-html", "Generate a sectioned call-flow report", ["compass export callflow-html [GRAPH_OR_DIR] [OPTIONS]"], - "Arguments:\n [GRAPH_OR_DIR] Graph JSON or project/output directory\n\nOptions:\n --graph Graph JSON\n --labels Community-label JSON\n --report GRAPH_REPORT.md path\n --sections JSON section definitions\n --output Output page\n --lang Report language [default: auto]\n --max-sections Maximum derived sections [default: 15]\n --diagram-scale Mermaid scale [default: 1.0]\n --max-diagram-nodes Nodes per diagram [default: 18]\n --max-diagram-edges Edges per diagram [default: 24]\n\nExamples:\n compass export callflow-html\n compass export callflow-html ./compass-out --lang en --max-sections 10\n\nNotes:\n Interactive terminals ask before opening the generated HTML; scripts never prompt or open a browser." + "Arguments:\n [GRAPH_OR_DIR] Graph JSON or project/output directory\n\nOptions:\n --graph Graph JSON\n --labels Community-label JSON\n --architecture-overlay Versioned JSON/TOML architecture overlay\n --sections Deprecated overlay/legacy-section alias\n --output Output page\n --max-sections Maximum overview groups [default: 15]\n\nExamples:\n compass export callflow-html\n compass export callflow-html ./compass-out --max-sections 10\n\nNotes:\n Produces the typed compass.viewer.architecture/1 workbench. Production is scoped before grouping, and omitted groups remain searchable rather than becoming Other. Interactive terminals ask before opening the generated HTML; scripts never prompt or open a browser." ), page!( "export callflow-json", "Export the structured call-flow report", ["compass export callflow-json [GRAPH_OR_DIR] [OPTIONS]"], - "Arguments:\n [GRAPH_OR_DIR] Graph JSON or project/output directory\n\nOptions:\n --graph Graph JSON\n --labels Community-label JSON\n --report GRAPH_REPORT.md path\n --sections JSON section definitions\n --output Atomically write the JSON document\n --lang Report language [default: auto]\n --max-sections Maximum derived sections [default: 15]\n --diagram-scale Mermaid scale [default: 1.0]\n --max-diagram-nodes Nodes per diagram [default: 18]\n --max-diagram-edges Edges per diagram [default: 24]\n\nExamples:\n compass export callflow-json\n compass export callflow-json --graph compass-out/graph.json --output callflow.json\n\nNotes:\n The JSON output is the machine-readable counterpart to callflow-html." + "Arguments:\n [GRAPH_OR_DIR] Graph JSON or project/output directory\n\nOptions:\n --graph Graph JSON\n --labels Community-label JSON\n --architecture-overlay Versioned JSON/TOML architecture overlay\n --sections Deprecated overlay/legacy-section alias\n --output Atomically write the JSON document\n --max-sections Maximum overview groups [default: 15]\n\nExamples:\n compass export callflow-json\n compass export callflow-json --graph compass-out/graph.json --output architecture.json\n\nNotes:\n Emits compass.viewer.architecture/1 with typed source scopes, relationship classes, hierarchy, omissions, and quality diagnostics." ), page!( "export obsidian", diff --git a/crates/compass-cli/src/lib.rs b/crates/compass-cli/src/lib.rs index 99868186..6800c25f 100644 --- a/crates/compass-cli/src/lib.rs +++ b/crates/compass-cli/src/lib.rs @@ -64,14 +64,15 @@ use compass_model::query_contract::{ DiscoveryQueryResponse, DiscoveryScope, DiscoveryScopeKind, DiscoveryTraversal, ImpactRequest, }; use compass_output::{ - AffectedLensOptions, AgentOrientation, ArtifactLens, CallflowOptions, CallflowSection, - CanvasOptions, HtmlOptions, ObsidianOptions, SourceNavigation, SvgOptions, TreeOptions, - WikiOptions, WorkbenchCoverage, WorkbenchCoverageStatus, WorkbenchModel, WorkbenchView, - WorkbenchViewContent, affected_lens_view_model, artifact_lens_view_model, callflow_view_model, + AffectedLensOptions, AgentOrientation, ArchitectureOverlay, ArchitectureOverlayGroup, + ArchitectureProjectionInput, ArchitectureProjectionOptions, ArtifactLens, CallflowOptions, + CallflowSection, CanvasOptions, HtmlOptions, ObsidianOptions, SourceNavigation, SvgOptions, + TreeOptions, WikiOptions, WorkbenchCoverage, WorkbenchCoverageStatus, WorkbenchModel, + WorkbenchView, WorkbenchViewContent, affected_lens_view_model, artifact_lens_view_model, export_obsidian, export_wiki, graph_artifact_identity, graph_community_view_model_document, graph_view_model_bundle_document, graph_view_model_document, node_filenames, - render_orientation_json, validate_orientation_graph_identity, write_callflow_html, - write_canvas, write_cypher, write_graphml, write_svg, write_tree_html, + project_architecture, render_orientation_json, validate_orientation_graph_identity, + write_callflow_html, write_canvas, write_cypher, write_graphml, write_svg, write_tree_html, write_workbench_html_with_source_navigation, }; use compass_prs::{ProcessRunner, SystemRunner}; @@ -2986,6 +2987,7 @@ fn validate_export_options( "--labels", "--report", "--sections", + "--architecture-overlay", "--output", "--lang", "--max-sections", @@ -2998,6 +3000,7 @@ fn validate_export_options( "--labels", "--report", "--sections", + "--architecture-overlay", "--output", "--lang", "--max-sections", @@ -3170,10 +3173,12 @@ fn command_export(frontend: Frontend, args: &[String]) -> Outcome { report_explicit = true; index += 2; } - "--sections" => { - seen_options.insert("--sections"); + "--sections" | "--architecture-overlay" => { + seen_options.insert("--architecture-overlay"); let Some(value) = next() else { - return Outcome::failure("error: --sections requires a path".to_owned()); + return Outcome::failure( + "error: --architecture-overlay requires a path".to_owned(), + ); }; sections_path = Some(PathBuf::from(value)); index += 2; @@ -3551,6 +3556,9 @@ fn command_export(frontend: Frontend, args: &[String]) -> Outcome { if let Err(error) = validate_export_options(format, &seen_options, &view_requests) { return Outcome::failure(format!("error: {error}")); } + if sections_path.is_none() && matches!(format, "callflow-html" | "callflow-json") { + sections_path = discover_architecture_overlay(&graph_path); + } graph_path = match compass_files::BuildGuard::resolve_requested_artifact(&graph_path) { Ok(path) => path, Err(error) => { @@ -3729,7 +3737,7 @@ fn command_export(frontend: Frontend, args: &[String]) -> Outcome { write_text_atomic(&path, &json) .map_err(|error| error.to_string()) .map(|()| { - ExportOutput::text(format!("Call-flow JSON written: {}", path.display())) + ExportOutput::text(format!("Architecture JSON written: {}", path.display())) }) } else { Ok(ExportOutput::text(json)) @@ -3872,7 +3880,7 @@ fn build_export_workbench( let model = architecture_view_model(inputs, graph_path, &title)?; let coverage = WorkbenchCoverage::bounded( model.statistics.nodes, - model.statistics.edges, + model.statistics.relationships, false, ); ( @@ -3880,7 +3888,7 @@ fn build_export_workbench( WorkbenchView { id: String::new(), title: "Architecture".to_owned(), - description: "Subsystems, scopes, and cross-section calls".to_owned(), + description: "Source-scoped subsystems and typed relationships".to_owned(), coverage, content: WorkbenchViewContent::Architecture { model }, }, @@ -4123,16 +4131,19 @@ fn architecture_view_model( inputs: &ExportInputs, graph_path: &Path, title: &str, -) -> Result { - callflow_view_model( - &inputs.document, - &inputs.communities, - &CallflowOptions { +) -> Result { + let overlay = load_architecture_overlay(None, graph_path)?; + project_architecture( + ArchitectureProjectionInput { + document: &inputs.document, + communities: &inputs.communities, community_labels: (!inputs.labels.is_empty()).then_some(&inputs.labels), - report: &inputs.report, + overlay: overlay.as_ref(), project_name: title, - ..CallflowOptions::default() + built_at_commit: graph_source_commit(&inputs.document), + generated_at: None, }, + &ArchitectureProjectionOptions::default(), ) .map_err(|error| { format!( @@ -4430,7 +4441,7 @@ fn export_callflow_json( max_diagram_nodes: usize, max_diagram_edges: usize, ) -> Result { - let sections = sections_path.map(load_sections).transpose()?; + let overlay = load_architecture_overlay(sections_path, graph_path)?; let project = inputs .document .graph @@ -4446,21 +4457,31 @@ fn export_callflow_json( .map(str::to_owned) }) .unwrap_or_else(|| "Project".to_owned()); - let model = callflow_view_model( - &inputs.document, - &inputs.communities, - &CallflowOptions { + let defaults = ArchitectureProjectionOptions::default(); + let options = ArchitectureProjectionOptions { + limits: compass_output::ArchitectureProjectionLimits { + max_overview_groups: max_sections.max(2), + ..defaults.limits + }, + ..defaults + }; + let _presentation_options = ( + language, + diagram_scale, + max_diagram_nodes, + max_diagram_edges, + ); + let model = project_architecture( + ArchitectureProjectionInput { + document: &inputs.document, + communities: &inputs.communities, community_labels: (!inputs.labels.is_empty()).then_some(&inputs.labels), - sections: sections.as_deref(), - report: &inputs.report, + overlay: overlay.as_ref(), project_name: &project, - language, - max_sections, - diagram_scale, - max_diagram_nodes, - max_diagram_edges, - ..CallflowOptions::default() + built_at_commit: graph_source_commit(&inputs.document), + generated_at: None, }, + &options, ) .map_err(|error| error.to_string())?; serde_json::to_string(&model).map_err(|error| error.to_string()) @@ -4561,7 +4582,7 @@ fn export_callflow( max_diagram_nodes: usize, max_diagram_edges: usize, ) -> Result { - let sections = sections_path.map(load_sections).transpose()?; + let overlay = load_architecture_overlay(sections_path, graph_path)?; let project = inputs .document .graph @@ -4589,9 +4610,11 @@ fn export_callflow( &path, &CallflowOptions { community_labels: (!inputs.labels.is_empty()).then_some(&inputs.labels), - sections: sections.as_deref(), + sections: None, + overlay: overlay.as_ref(), report: &inputs.report, project_name: &project, + built_at_commit: graph_source_commit(&inputs.document), language, max_sections, diagram_scale, @@ -4603,15 +4626,14 @@ fn export_callflow( .map_err(|error| error.to_string())?; Ok(ExportOutput::html( format!( - "Loaded: {} nodes, {} edges, {} sections\nGraph: {}\nCall-flow HTML written: {}\n Sections: {} | Mermaid diagrams: {} | Call tables: {}\n Diagrams use Mermaid init directives plus interactive zoom/pan controls.\ncallflow HTML written - open in any browser: {}", + "Loaded: {} nodes and {} relationships\nGraph: {}\nArchitecture HTML written: {}\n Groups: {} total, {} in overview | Overview routes: {}\n The export includes source scopes, relation classes, quality diagnostics, and exact omission metadata.\nArchitecture HTML written - open in any browser: {}", inputs.document.nodes.len(), inputs.document.links.len(), - result.loaded_sections, graph_path.display(), path.display(), - result.rendered_sections, - result.mermaid_diagrams, - result.call_tables, + result.groups, + result.overview_groups, + result.overview_routes, path.display(), ), path, @@ -4713,20 +4735,116 @@ fn load_usize_string_map(path: &Path) -> Result Result, String> { +const ARCHITECTURE_OVERLAY_MAX_BYTES: u64 = 1024 * 1024; + +fn discover_architecture_overlay(graph_path: &Path) -> Option { + let output_root = graph_path.parent()?; + if output_root.file_name().and_then(|value| value.to_str()) != Some("compass-out") { + return None; + } + let candidate = output_root + .parent()? + .join(".compass") + .join("architecture.toml"); + candidate.is_file().then_some(candidate) +} + +fn load_architecture_overlay( + explicit_path: Option<&Path>, + _graph_path: &Path, +) -> Result, String> { + // Discovery, when allowed, happens before immutable artifacts are resolved + // and only for the canonical project/compass-out/graph.json location. + // Explicit historical graph paths therefore never observe live config. + let path = explicit_path.map(Path::to_path_buf); + path.map(|path| parse_architecture_overlay(&path)) + .transpose() +} + +fn parse_architecture_overlay(path: &Path) -> Result { + let size = fs::metadata(path) + .map_err(|error| format!("error reading {}: {error}", path.display()))? + .len(); + if size > ARCHITECTURE_OVERLAY_MAX_BYTES { + return Err(format!( + "architecture overlay {} is {size} bytes; limit is {ARCHITECTURE_OVERLAY_MAX_BYTES}", + path.display() + )); + } let bytes = fs::read(path).map_err(|error| format!("error reading {}: {error}", path.display()))?; + if path.extension().and_then(|value| value.to_str()) == Some("toml") { + let text = std::str::from_utf8(&bytes).map_err(|error| { + format!( + "architecture overlay {} is not UTF-8: {error}", + path.display() + ) + })?; + return toml::from_str(text) + .map_err(|error| format!("invalid architecture overlay {}: {error}", path.display())); + } let value: serde_json::Value = serde_json::from_slice(&bytes) .map_err(|error| format!("invalid JSON at {}: {error}", path.display()))?; - let value = value.get("sections").cloned().unwrap_or(value); - serde_json::from_value(value).map_err(|_| { + if value.get("schema").is_some() { + return serde_json::from_value(value) + .map_err(|error| format!("invalid architecture overlay {}: {error}", path.display())); + } + let sections: Vec = serde_json::from_value( + value.get("sections").cloned().unwrap_or(value), + ) + .map_err(|error| { format!( - "ERROR: sections file must contain a JSON array: {}", + "architecture overlay {} is neither compass.architecture-overlay/1 nor legacy sections JSON: {error}", path.display() ) + })?; + let groups = sections + .into_iter() + .filter(|section| section.id != "overview") + .map(|section| { + let communities = section + .communities + .iter() + .map(|community| { + community.parse::().map_err(|error| { + format!( + "legacy section {} has invalid community {}: {error}", + section.id, community + ) + }) + }) + .collect::, _>>()?; + Ok(ArchitectureOverlayGroup { + id: section.id, + name: section.name, + path_prefixes: Vec::new(), + communities, + pin: false, + }) + }) + .collect::, String>>()?; + Ok(ArchitectureOverlay { + schema: compass_output::ARCHITECTURE_OVERLAY_SCHEMA.to_owned(), + source_rules: Vec::new(), + groups, }) } +fn graph_source_commit(document: &compass_model::GraphDocument) -> Option<&str> { + document + .graph + .get("built_at_commit") + .and_then(serde_json::Value::as_str) + .or_else(|| { + document + .graph + .get("build") + .and_then(serde_json::Value::as_object) + .and_then(|build| build.get("sourceCommit")) + .and_then(serde_json::Value::as_str) + }) +} + fn parse_usize(value: Option, _name: &str) -> Option { value?.parse().ok() } @@ -4760,7 +4878,7 @@ fn safe_output_name(value: &str) -> String { } fn export_help() -> String { - "Usage: compass export \n orientation-json [--graph PATH]\n html [--graph PATH] [--output HTML] [VIEW ...]\n json [--graph PATH] [--node-limit N] [--community ID] [VIEW ...]\n workbench-json [--graph PATH] [VIEW ...]\n callflow-html [GRAPH|DIR] [--graph PATH] [--labels PATH] [--report PATH] [--sections PATH] [--output HTML]\n callflow-json [GRAPH|DIR] [--graph PATH] [--labels PATH] [--report PATH] [--sections PATH] [--output JSON]\n obsidian [--graph PATH] [--labels PATH] [--dir PATH]\n wiki [--graph PATH] [--labels PATH]\n svg [--graph PATH] [--labels PATH]\n graphml [--graph PATH]\n neo4j [--graph PATH] [--push URI] [--user U] [--password P]\n falkordb [--graph PATH] [--push URI] [--user U] [--password P]\n\nVIEW may be repeated: --code-graph, --architecture-graph, --call-graph SYMBOL, --impact-graph SYMBOL, --affected-graph NODE, --history-graph OLD..NEW, --artifact-lens LENS, or --view SPEC.".to_owned() + "Usage: compass export \n orientation-json [--graph PATH]\n html [--graph PATH] [--output HTML] [VIEW ...]\n json [--graph PATH] [--node-limit N] [--community ID] [VIEW ...]\n workbench-json [--graph PATH] [VIEW ...]\n callflow-html [GRAPH|DIR] [--graph PATH] [--labels PATH] [--architecture-overlay PATH] [--output HTML]\n callflow-json [GRAPH|DIR] [--graph PATH] [--labels PATH] [--architecture-overlay PATH] [--output JSON]\n obsidian [--graph PATH] [--labels PATH] [--dir PATH]\n wiki [--graph PATH] [--labels PATH]\n svg [--graph PATH] [--labels PATH]\n graphml [--graph PATH]\n neo4j [--graph PATH] [--push URI] [--user U] [--password P]\n falkordb [--graph PATH] [--push URI] [--user U] [--password P]\n\nVIEW may be repeated: --code-graph, --architecture-graph, --call-graph SYMBOL, --impact-graph SYMBOL, --affected-graph NODE, --history-graph OLD..NEW, --artifact-lens LENS, or --view SPEC.".to_owned() } fn export_workbench_help(format: &str) -> String { @@ -4848,7 +4966,7 @@ fn export_json_help() -> String { } fn callflow_help() -> String { - "Usage: compass export callflow-html [GRAPH|DIR] [--graph PATH] [--labels PATH]\n --report PATH path to GRAPH_REPORT.md\n --sections PATH JSON section definitions\n --output HTML output path (default compass-out/-callflow.html)\n --lang LANG auto, zh-CN, en, etc. (default auto)\n --max-sections N maximum auto-derived sections (default 15)\n --diagram-scale N Mermaid diagram scale (default 1.0)\n --max-diagram-nodes N representative nodes per section (default 18)\n --max-diagram-edges N representative edges per section (default 24)".to_owned() + "Usage: compass export callflow-html [GRAPH|DIR] [--graph PATH] [--labels PATH]\n --architecture-overlay PATH versioned JSON/TOML architecture overlay\n --sections PATH deprecated alias; legacy section JSON is adapted\n --output HTML output path (default compass-out/-callflow.html)\n --max-sections N maximum groups in the bounded overview (default 15)\n --lang LANG accepted for CLI compatibility; the shared viewer localizes UI\n --diagram-scale N deprecated compatibility option\n --max-diagram-nodes N deprecated compatibility option\n --max-diagram-edges N deprecated compatibility option\n\nThe export uses compass.viewer.architecture/1 for both HTML and JSON. Production scope is classified before grouping; omitted groups remain searchable and are never merged into Other.".to_owned() } #[derive(Clone, Debug, Eq, PartialEq)] @@ -6150,11 +6268,6 @@ mod mcp_option_tests { assert!(load_usize_string_map(&map_path).is_err()); assert!(load_usize_string_map(&directory.path().join("missing")).is_err()); - let sections = directory.path().join("sections.json"); - fs::write(§ions, r#"{"sections":[]}"#)?; - assert!(load_sections(§ions)?.is_empty()); - fs::write(§ions, "{}")?; - assert!(load_sections(§ions).is_err()); Ok(()) } @@ -6223,6 +6336,52 @@ mod mcp_option_tests { Ok(()) } + #[test] + fn architecture_overlay_loader_accepts_versioned_toml_and_legacy_json() + -> Result<(), Box> { + let directory = tempfile::tempdir()?; + let toml_path = directory.path().join("architecture.toml"); + fs::write( + &toml_path, + "schema = \"compass.architecture-overlay/1\"\n\ + [[sourceRules]]\npathPrefix = \"generated/client\"\nscope = \"generated\"\n\ + [[groups]]\nid = \"billing\"\nname = \"Billing Ledger\"\npathPrefixes = [\"crates/billing\"]\npin = true\n", + )?; + let overlay = parse_architecture_overlay(&toml_path)?; + assert_eq!(overlay.source_rules.len(), 1); + assert_eq!(overlay.groups.len(), 1); + + let legacy_path = directory.path().join("sections.json"); + fs::write( + &legacy_path, + r#"{"sections":[{"id":"billing","name":"Billing Ledger","communities":["7"]}]}"#, + )?; + let legacy = parse_architecture_overlay(&legacy_path)?; + assert_eq!(legacy.groups[0].communities, vec![7]); + Ok(()) + } + + #[test] + fn architecture_overlay_discovery_is_limited_to_the_canonical_project_output() + -> Result<(), Box> { + let directory = tempfile::tempdir()?; + let project = directory.path(); + let configuration = project.join(".compass/architecture.toml"); + fs::create_dir_all(configuration.parent().ok_or("configuration parent")?)?; + fs::write( + &configuration, + "schema = \"compass.architecture-overlay/1\"\n", + )?; + let canonical = project.join("compass-out/graph.json"); + let historical = project.join("archive/graph.json"); + assert_eq!( + discover_architecture_overlay(&canonical), + Some(configuration) + ); + assert_eq!(discover_architecture_overlay(&historical), None); + Ok(()) + } + #[test] fn absent_worker_override_preserves_host_sized_default() { let mut options = BuildOptions::new("."); diff --git a/crates/compass-cli/tests/viewer_export_cli.rs b/crates/compass-cli/tests/viewer_export_cli.rs index 63973351..1585db74 100644 --- a/crates/compass-cli/tests/viewer_export_cli.rs +++ b/crates/compass-cli/tests/viewer_export_cli.rs @@ -812,16 +812,16 @@ fn callflow_json_exposes_the_shared_architecture_model() -> Result<(), Box= 2) + .is_some_and(|projections| projections.len() == 2) ); let output_path = directory.path().join("callflow.json"); @@ -842,8 +842,50 @@ fn callflow_json_exposes_the_shared_architecture_model() -> Result<(), Box Result<(), Box> { + let directory = tempfile::tempdir()?; + let graph = directory.path().join("graph.json"); + let overlay = directory.path().join("architecture.toml"); + let output_path = directory.path().join("architecture.json"); + std::fs::write( + &graph, + serde_json::to_vec(&json!({ + "directed": true, + "multigraph": false, + "graph": {"project_name":"Fixture"}, + "nodes": [{"id":"run","label":"run","community":0,"source_file":"src/lib.rs"}], + "links": [] + }))?, + )?; + std::fs::write( + &overlay, + "schema = \"compass.architecture-overlay/1\"\n\ + [[sourceRules]]\npathPrefix = \"src\"\nscope = \"production\"\n\ + [[sourceRules]]\npathPrefix = \"src/generated\"\nscope = \"generated\"\n", + )?; + let result = support::compass_command() + .args([ + "export", + "callflow-json", + "--graph", + graph.to_string_lossy().as_ref(), + "--architecture-overlay", + overlay.to_string_lossy().as_ref(), + "--output", + output_path.to_string_lossy().as_ref(), + ]) + .current_dir(directory.path()) + .output()?; + assert!(!result.status.success()); + assert!(String::from_utf8_lossy(&result.stderr).contains("invalid architecture overlay")); + assert!(!output_path.exists()); Ok(()) } diff --git a/crates/compass-core/src/pipeline.rs b/crates/compass-core/src/pipeline.rs index fc0eb445..df692671 100644 --- a/crates/compass-core/src/pipeline.rs +++ b/crates/compass-core/src/pipeline.rs @@ -11,7 +11,8 @@ use std::time::{Duration, Instant}; use ahash::{AHashMap, AHashSet}; use compass_files::{ BuildGuard, BuildScope, Cache, CacheOptions, DetectOptions, Detection, IgnorePolicy, Manifest, - ManifestKind, detect, write_atomic_with_digest, write_json_atomic, write_text_atomic, + ManifestKind, detect, source_is_generated, write_atomic_with_digest, write_json_atomic, + write_text_atomic, }; use compass_graph::{ BuildEvidence, ClusterOptions, EntityTiebreaker, GRAPH_DIAGNOSTICS_EXTENSION, @@ -6679,7 +6680,7 @@ fn detection_inventory( }) { ExtractionStatus::Partial - } else if source_is_generated(&absolute) { + } else if source_is_generated(root, &absolute) { ExtractionStatus::Generated } else { match category.as_str() { @@ -6798,15 +6799,6 @@ fn portable_diagnostic_reason(reason: &str, path: &Path, root: &Path) -> String sanitized.chars().take(512).collect() } -fn source_is_generated(path: &Path) -> bool { - fs::read(path).ok().is_some_and(|bytes| { - let head = String::from_utf8_lossy(&bytes[..bytes.len().min(2_048)]); - ["DO NOT EDIT", "@generated", "Generated by"] - .iter() - .any(|marker| head.contains(marker)) - }) -} - fn source_was_deleted(value: Option<&serde_json::Value>, root: &Path) -> bool { let Some(source) = value.and_then(serde_json::Value::as_str) else { return false; diff --git a/crates/compass-files/src/generated.rs b/crates/compass-files/src/generated.rs new file mode 100644 index 00000000..978f180e --- /dev/null +++ b/crates/compass-files/src/generated.rs @@ -0,0 +1,197 @@ +use std::fs; +use std::io::Read; +use std::path::{Component, Path, PathBuf}; + +use glob::Pattern; + +const GENERATED_HEADER_BYTES: usize = 2_048; +const ATTRIBUTES_FILE_BYTES: u64 = 256 * 1024; +const MAX_ATTRIBUTE_DEPTH: usize = 64; + +/// Determine whether a source is explicitly or conventionally generated. +/// +/// The decision is bounded and deterministic. It admits source headers, +/// conventional generated paths/filenames, and the `linguist-generated` +/// attribute from project-contained `.gitattributes` files. It does not infer +/// generation from line length, entropy, or formatting style. +#[must_use] +pub fn source_is_generated(root: &Path, path: &Path) -> bool { + generated_header(path) + || generated_path(root, path) + || generated_attribute(root, path).unwrap_or(false) +} + +fn generated_header(path: &Path) -> bool { + fs::File::open(path).ok().is_some_and(|file| { + let mut bytes = Vec::with_capacity(GENERATED_HEADER_BYTES); + if file + .take(GENERATED_HEADER_BYTES as u64) + .read_to_end(&mut bytes) + .is_err() + { + return false; + } + let head = String::from_utf8_lossy(&bytes); + ["DO NOT EDIT", "@generated", "Generated by"] + .iter() + .any(|marker| head.contains(marker)) + }) +} + +fn generated_path(root: &Path, path: &Path) -> bool { + let relative = path.strip_prefix(root).unwrap_or(path); + let components = relative + .components() + .filter_map(|component| match component { + Component::Normal(value) => Some(value.to_string_lossy().to_ascii_lowercase()), + _ => None, + }) + .collect::>(); + let filename = components.last().map_or("", String::as_str); + let root_output = components.first().is_some_and(|component| { + matches!( + component.as_str(), + "generated" | "gen" | "dist" | "build" | "target" | ".next" + ) + }); + let explicit_generated = components + .iter() + .any(|component| matches!(component.as_str(), "generated" | "gen")); + root_output + || explicit_generated + || filename.contains(".generated.") + || filename.contains("_generated.") + || filename.ends_with(".min.js") + || filename.ends_with(".min.css") +} + +fn generated_attribute(root: &Path, path: &Path) -> Option { + let relative = path.strip_prefix(root).ok()?; + let mut directories = Vec::::new(); + let mut current = path.parent()?; + while current.starts_with(root) && directories.len() < MAX_ATTRIBUTE_DEPTH { + directories.push(current.to_path_buf()); + if current == root { + break; + } + current = current.parent()?; + } + directories.reverse(); + let mut decision = None; + for directory in directories { + let attributes_path = directory.join(".gitattributes"); + let Ok(metadata) = fs::metadata(&attributes_path) else { + continue; + }; + let size = metadata.len(); + if size > ATTRIBUTES_FILE_BYTES { + continue; + } + let Ok(bytes) = fs::read(&attributes_path) else { + continue; + }; + let content = String::from_utf8_lossy(&bytes); + let local = relative + .strip_prefix(directory.strip_prefix(root).ok()?) + .ok()? + .to_string_lossy() + .replace('\\', "/"); + for line in content.lines().map(str::trim) { + if line.is_empty() || line.starts_with('#') { + continue; + } + let mut fields = line.split_whitespace(); + let Some(pattern) = fields.next() else { + continue; + }; + if !attribute_pattern_matches(pattern, &local) { + continue; + } + for attribute in fields { + match attribute { + "linguist-generated" | "linguist-generated=true" => decision = Some(true), + "-linguist-generated" | "linguist-generated=false" => { + decision = Some(false); + } + _ => {} + } + } + } + } + decision +} + +fn attribute_pattern_matches(pattern: &str, relative: &str) -> bool { + let pattern = pattern.trim_start_matches('/'); + if pattern.is_empty() || pattern.starts_with('!') { + return false; + } + if !pattern.contains('/') { + return relative.rsplit('/').next().is_some_and(|filename| { + Pattern::new(pattern).is_ok_and(|value| value.matches(filename)) + }); + } + Pattern::new(pattern).is_ok_and(|value| value.matches(relative)) +} + +#[cfg(test)] +mod tests { + use std::error::Error; + + use super::*; + + #[test] + fn generated_attribute_marks_tracked_bundle_without_content_guessing() + -> Result<(), Box> { + let directory = tempfile::tempdir()?; + let root = directory.path(); + let bundle = root.join("assets/viewer/graph.js"); + fs::create_dir_all(bundle.parent().ok_or("missing bundle parent")?)?; + fs::write(&bundle, "(()=>{let x=1;})();\n")?; + fs::write( + root.join(".gitattributes"), + "assets/viewer/graph.js linguist-generated=true\n", + )?; + assert!(source_is_generated(root, &bundle)); + Ok(()) + } + + #[test] + fn explicit_false_attribute_overrides_parent_generated_rule() -> Result<(), Box> { + let directory = tempfile::tempdir()?; + let root = directory.path(); + let source = root.join("assets/handwritten.js"); + fs::create_dir_all(source.parent().ok_or("missing source parent")?)?; + fs::write(&source, "export const value = 1;\n")?; + fs::write( + root.join(".gitattributes"), + "assets/*.js linguist-generated\n", + )?; + fs::write( + root.join("assets/.gitattributes"), + "handwritten.js -linguist-generated\n", + )?; + assert!(!source_is_generated(root, &source)); + Ok(()) + } + + #[test] + fn ordinary_long_or_compact_source_is_not_guessed_generated() -> Result<(), Box> { + let directory = tempfile::tempdir()?; + let source = directory.path().join("src/compact.js"); + fs::create_dir_all(source.parent().ok_or("missing source parent")?)?; + fs::write(&source, "x".repeat(20_000))?; + assert!(!source_is_generated(directory.path(), &source)); + Ok(()) + } + + #[test] + fn source_package_named_build_is_not_an_output_directory() -> Result<(), Box> { + let directory = tempfile::tempdir()?; + let source = directory.path().join("src/main/java/build/crab/Plan.java"); + fs::create_dir_all(source.parent().ok_or("missing source parent")?)?; + fs::write(&source, "package build.crab;\n")?; + assert!(!source_is_generated(directory.path(), &source)); + Ok(()) + } +} diff --git a/crates/compass-files/src/lib.rs b/crates/compass-files/src/lib.rs index 057f5e74..75ab67fe 100644 --- a/crates/compass-files/src/lib.rs +++ b/crates/compass-files/src/lib.rs @@ -5,6 +5,7 @@ mod build_guard; mod cache; mod detect; mod encoding; +mod generated; mod hash; mod manifest; mod project_config; @@ -24,6 +25,7 @@ pub use detect::{ DetectOptions, Detection, FileType, IgnorePolicy, WatchPathFilter, classify_file, detect, }; pub use encoding::read_source_lossy; +pub use generated::source_is_generated; pub use hash::{StatHashIndex, body_content, file_hash, md5_file, prompt_fingerprint}; pub use manifest::{IncrementalDetection, Manifest, ManifestEntry, ManifestKind}; pub use project_config::{PROJECT_CONFIG_RELATIVE_PATH, ProjectConfig}; diff --git a/crates/compass-output/assets/viewer/graph.js b/crates/compass-output/assets/viewer/graph.js index a6879243..0c9ef874 100644 --- a/crates/compass-output/assets/viewer/graph.js +++ b/crates/compass-output/assets/viewer/graph.js @@ -1,75 +1,75 @@ -(function(){"use strict";function KO(n,e){for(var t=0;ti[o]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}function WO(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ll={exports:{}},kr={};var wp;function QO(){if(wp)return kr;wp=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(i,o,r){var A=null;if(r!==void 0&&(A=""+r),o.key!==void 0&&(A=""+o.key),"key"in o){r={};for(var I in o)I!=="key"&&(r[I]=o[I])}else r=o;return o=r.ref,{$$typeof:n,type:i,key:A,ref:o!==void 0?o:null,props:r}}return kr.Fragment=e,kr.jsx=t,kr.jsxs=t,kr}var xp;function XO(){return xp||(xp=1,Ll.exports=QO()),Ll.exports}var f=XO(),Gl={exports:{}},Rr={},Fl={exports:{}},Vl={};var Sp;function $O(){return Sp||(Sp=1,(function(n){function e(M,Q){var K=M.length;M.push(Q);e:for(;0>>1,ee=M[ie];if(0>>1;ieo(te,K))reo(le,te)?(M[ie]=le,M[re]=K,ie=re):(M[ie]=te,M[F]=K,ie=F);else if(reo(le,K))M[ie]=le,M[re]=K,ie=re;else break e}}return Q}function o(M,Q){var K=M.sortIndex-Q.sortIndex;return K!==0?K:M.id-Q.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var r=performance;n.unstable_now=function(){return r.now()}}else{var A=Date,I=A.now();n.unstable_now=function(){return A.now()-I}}var l=[],c=[],h=1,p=null,m=3,b=!1,w=!1,S=!1,x=!1,O=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function B(M){for(var Q=t(c);Q!==null;){if(Q.callback===null)i(c);else if(Q.startTime<=M)i(c),Q.sortIndex=Q.expirationTime,e(l,Q);else break;Q=t(c)}}function W(M){if(S=!1,B(M),!w)if(t(l)!==null)w=!0,ne||(ne=!0,Te());else{var Q=t(c);Q!==null&&Ce(W,Q.startTime-M)}}var ne=!1,L=-1,G=5,Ie=-1;function fe(){return x?!0:!(n.unstable_now()-IeM&&fe());){var ie=p.callback;if(typeof ie=="function"){p.callback=null,m=p.priorityLevel;var ee=ie(p.expirationTime<=M);if(M=n.unstable_now(),typeof ee=="function"){p.callback=ee,B(M),Q=!0;break t}p===t(l)&&i(l),B(M)}else i(l);p=t(l)}if(p!==null)Q=!0;else{var T=t(c);T!==null&&Ce(W,T.startTime-M),Q=!1}}break e}finally{p=null,m=K,b=!1}Q=void 0}}finally{Q?Te():ne=!1}}}var Te;if(typeof R=="function")Te=function(){R(Be)};else if(typeof MessageChannel<"u"){var He=new MessageChannel,Ve=He.port2;He.port1.onmessage=Be,Te=function(){Ve.postMessage(null)}}else Te=function(){O(Be,0)};function Ce(M,Q){L=O(function(){M(n.unstable_now())},Q)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(M){M.callback=null},n.unstable_forceFrameRate=function(M){0>M||125ie?(M.sortIndex=K,e(c,M),t(l)===null&&M===t(c)&&(S?(E(L),L=-1):S=!0,Ce(W,K-ie))):(M.sortIndex=ee,e(l,M),w||b||(w=!0,ne||(ne=!0,Te()))),M},n.unstable_shouldYield=fe,n.unstable_wrapCallback=function(M){var Q=m;return function(){var K=m;m=Q;try{return M.apply(this,arguments)}finally{m=K}}}})(Vl)),Vl}var Ep;function qO(){return Ep||(Ep=1,Fl.exports=$O()),Fl.exports}var Ul={exports:{}},Ze={};var Tp;function JO(){if(Tp)return Ze;Tp=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),r=Symbol.for("react.consumer"),A=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),m=Symbol.iterator;function b(T){return T===null||typeof T!="object"?null:(T=m&&T[m]||T["@@iterator"],typeof T=="function"?T:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,x={};function O(T,F,te){this.props=T,this.context=F,this.refs=x,this.updater=te||w}O.prototype.isReactComponent={},O.prototype.setState=function(T,F){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,F,"setState")},O.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function E(){}E.prototype=O.prototype;function R(T,F,te){this.props=T,this.context=F,this.refs=x,this.updater=te||w}var B=R.prototype=new E;B.constructor=R,S(B,O.prototype),B.isPureReactComponent=!0;var W=Array.isArray;function ne(){}var L={H:null,A:null,T:null,S:null},G=Object.prototype.hasOwnProperty;function Ie(T,F,te){var re=te.ref;return{$$typeof:n,type:T,key:F,ref:re!==void 0?re:null,props:te}}function fe(T,F){return Ie(T.type,F,T.props)}function Be(T){return typeof T=="object"&&T!==null&&T.$$typeof===n}function Te(T){var F={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(te){return F[te]})}var He=/\/+/g;function Ve(T,F){return typeof T=="object"&&T!==null&&T.key!=null?Te(""+T.key):F.toString(36)}function Ce(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(ne,ne):(T.status="pending",T.then(function(F){T.status==="pending"&&(T.status="fulfilled",T.value=F)},function(F){T.status==="pending"&&(T.status="rejected",T.reason=F)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function M(T,F,te,re,le){var pe=typeof T;(pe==="undefined"||pe==="boolean")&&(T=null);var Pe=!1;if(T===null)Pe=!0;else switch(pe){case"bigint":case"string":case"number":Pe=!0;break;case"object":switch(T.$$typeof){case n:case e:Pe=!0;break;case h:return Pe=T._init,M(Pe(T._payload),F,te,re,le)}}if(Pe)return le=le(T),Pe=re===""?"."+Ve(T,0):re,W(le)?(te="",Pe!=null&&(te=Pe.replace(He,"$&/")+"/"),M(le,F,te,"",function(en){return en})):le!=null&&(Be(le)&&(le=fe(le,te+(le.key==null||T&&T.key===le.key?"":(""+le.key).replace(He,"$&/")+"/")+Pe)),F.push(le)),1;Pe=0;var dt=re===""?".":re+":";if(W(T))for(var Re=0;Re"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),Hl.exports=eN(),Hl.exports}var Mp;function nN(){if(Mp)return Rr;Mp=1;var n=qO(),e=Yl(),t=tN();function i(g){var s="https://react.dev/errors/"+g;if(1ee||(g.current=ie[ee],ie[ee]=null,ee--)}function te(g,s){ee++,ie[ee]=g.current,g.current=s}var re=T(null),le=T(null),pe=T(null),Pe=T(null);function dt(g,s){switch(te(pe,s),te(le,g),te(re,null),s.nodeType){case 9:case 11:g=(g=s.documentElement)&&(g=g.namespaceURI)?hO(g):0;break;default:if(g=s.tagName,s=s.namespaceURI)s=hO(s),g=fO(s,g);else switch(g){case"svg":g=1;break;case"math":g=2;break;default:g=0}}F(re),te(re,g)}function Re(){F(re),F(le),F(pe)}function en(g){g.memoizedState!==null&&te(Pe,g);var s=re.current,a=fO(s,g.type);s!==a&&(te(le,g),te(re,a))}function z(g){le.current===g&&(F(re),F(le)),Pe.current===g&&(F(Pe),RA._currentValue=K)}var ve,xe;function ze(g){if(ve===void 0)try{throw Error()}catch(a){var s=a.stack.trim().match(/\n( *(at )?)/);ve=s&&s[1]||"",xe=-1i[o]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}function tN(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Fl={exports:{}},zr={};var xp;function nN(){if(xp)return zr;xp=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(i,o,r){var A=null;if(r!==void 0&&(A=""+r),o.key!==void 0&&(A=""+o.key),"key"in o){r={};for(var I in o)I!=="key"&&(r[I]=o[I])}else r=o;return o=r.ref,{$$typeof:n,type:i,key:A,ref:o!==void 0?o:null,props:r}}return zr.Fragment=e,zr.jsx=t,zr.jsxs=t,zr}var Ep;function iN(){return Ep||(Ep=1,Fl.exports=nN()),Fl.exports}var f=iN(),Vl={exports:{}},kr={},Ul={exports:{}},Yl={};var Sp;function gN(){return Sp||(Sp=1,(function(n){function e(M,Q){var W=M.length;M.push(Q);e:for(;0>>1,ee=M[ge];if(0>>1;geo(ie,W))aeo(ue,ie)?(M[ge]=ue,M[ae]=W,ge=ae):(M[ge]=ie,M[U]=W,ge=U);else if(aeo(ue,W))M[ge]=ue,M[ae]=W,ge=ae;else break e}}return Q}function o(M,Q){var W=M.sortIndex-Q.sortIndex;return W!==0?W:M.id-Q.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var r=performance;n.unstable_now=function(){return r.now()}}else{var A=Date,I=A.now();n.unstable_now=function(){return A.now()-I}}var l=[],c=[],h=1,p=null,m=3,b=!1,w=!1,O=!1,x=!1,S=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function j(M){for(var Q=t(c);Q!==null;){if(Q.callback===null)i(c);else if(Q.startTime<=M)i(c),Q.sortIndex=Q.expirationTime,e(l,Q);else break;Q=t(c)}}function X(M){if(O=!1,j(M),!w)if(t(l)!==null)w=!0,ne||(ne=!0,xe());else{var Q=t(c);Q!==null&&le(X,Q.startTime-M)}}var ne=!1,F=-1,V=5,Ie=-1;function Ee(){return x?!0:!(n.unstable_now()-IeM&&Ee());){var ge=p.callback;if(typeof ge=="function"){p.callback=null,m=p.priorityLevel;var ee=ge(p.expirationTime<=M);if(M=n.unstable_now(),typeof ee=="function"){p.callback=ee,j(M),Q=!0;break t}p===t(l)&&i(l),j(M)}else i(l);p=t(l)}if(p!==null)Q=!0;else{var T=t(c);T!==null&&le(X,T.startTime-M),Q=!1}}break e}finally{p=null,m=W,b=!1}Q=void 0}}finally{Q?xe():ne=!1}}}var xe;if(typeof _=="function")xe=function(){_(Ze)};else if(typeof MessageChannel<"u"){var He=new MessageChannel,Fe=He.port2;He.port1.onmessage=Ze,xe=function(){Fe.postMessage(null)}}else xe=function(){S(Ze,0)};function le(M,Q){F=S(function(){M(n.unstable_now())},Q)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(M){M.callback=null},n.unstable_forceFrameRate=function(M){0>M||125ge?(M.sortIndex=W,e(c,M),t(l)===null&&M===t(c)&&(O?(E(F),F=-1):O=!0,le(X,W-ge))):(M.sortIndex=ee,e(l,M),w||b||(w=!0,ne||(ne=!0,xe()))),M},n.unstable_shouldYield=Ee,n.unstable_wrapCallback=function(M){var Q=m;return function(){var W=m;m=Q;try{return M.apply(this,arguments)}finally{m=W}}}})(Yl)),Yl}var Tp;function oN(){return Tp||(Tp=1,Ul.exports=gN()),Ul.exports}var Hl={exports:{}},Pe={};var Op;function sN(){if(Op)return Pe;Op=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),r=Symbol.for("react.consumer"),A=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),m=Symbol.iterator;function b(T){return T===null||typeof T!="object"?null:(T=m&&T[m]||T["@@iterator"],typeof T=="function"?T:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,x={};function S(T,U,ie){this.props=T,this.context=U,this.refs=x,this.updater=ie||w}S.prototype.isReactComponent={},S.prototype.setState=function(T,U){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,U,"setState")},S.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function E(){}E.prototype=S.prototype;function _(T,U,ie){this.props=T,this.context=U,this.refs=x,this.updater=ie||w}var j=_.prototype=new E;j.constructor=_,O(j,S.prototype),j.isPureReactComponent=!0;var X=Array.isArray;function ne(){}var F={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function Ie(T,U,ie){var ae=ie.ref;return{$$typeof:n,type:T,key:U,ref:ae!==void 0?ae:null,props:ie}}function Ee(T,U){return Ie(T.type,U,T.props)}function Ze(T){return typeof T=="object"&&T!==null&&T.$$typeof===n}function xe(T){var U={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(ie){return U[ie]})}var He=/\/+/g;function Fe(T,U){return typeof T=="object"&&T!==null&&T.key!=null?xe(""+T.key):U.toString(36)}function le(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(ne,ne):(T.status="pending",T.then(function(U){T.status==="pending"&&(T.status="fulfilled",T.value=U)},function(U){T.status==="pending"&&(T.status="rejected",T.reason=U)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function M(T,U,ie,ae,ue){var me=typeof T;(me==="undefined"||me==="boolean")&&(T=null);var Be=!1;if(T===null)Be=!0;else switch(me){case"bigint":case"string":case"number":Be=!0;break;case"object":switch(T.$$typeof){case n:case e:Be=!0;break;case h:return Be=T._init,M(Be(T._payload),U,ie,ae,ue)}}if(Be)return ue=ue(T),Be=ae===""?"."+Fe(T,0):ae,X(ue)?(ie="",Be!=null&&(ie=Be.replace(He,"$&/")+"/"),M(ue,U,ie,"",function(en){return en})):ue!=null&&(Ze(ue)&&(ue=Ee(ue,ie+(ue.key==null||T&&T.key===ue.key?"":(""+ue.key).replace(He,"$&/")+"/")+Be)),U.push(ue)),1;Be=0;var ut=ae===""?".":ae+":";if(X(T))for(var _e=0;_e"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),Wl.exports=rN(),Wl.exports}var Rp;function AN(){if(Rp)return kr;Rp=1;var n=oN(),e=Kl(),t=aN();function i(g){var s="https://react.dev/errors/"+g;if(1ee||(g.current=ge[ee],ge[ee]=null,ee--)}function ie(g,s){ee++,ge[ee]=g.current,g.current=s}var ae=T(null),ue=T(null),me=T(null),Be=T(null);function ut(g,s){switch(ie(me,s),ie(ue,g),ie(ae,null),s.nodeType){case 9:case 11:g=(g=s.documentElement)&&(g=g.namespaceURI)?wO(g):0;break;default:if(g=s.tagName,s=s.namespaceURI)s=wO(s),g=xO(s,g);else switch(g){case"svg":g=1;break;case"math":g=2;break;default:g=0}}U(ae),ie(ae,g)}function _e(){U(ae),U(ue),U(me)}function en(g){g.memoizedState!==null&&ie(Be,g);var s=ae.current,a=xO(s,g.type);s!==a&&(ie(ue,g),ie(ae,a))}function fn(g){ue.current===g&&(U(ae),U(ue)),Be.current===g&&(U(Be),kA._currentValue=W)}var R,de;function Te(g){if(R===void 0)try{throw Error()}catch(a){var s=a.stack.trim().match(/\n( *(at )?)/);R=s&&s[1]||"",de=-1)":-1d||N[C]!==j[d]){var X=` -`+N[C].replace(" at new "," at ");return g.displayName&&X.includes("")&&(X=X.replace("",g.displayName)),X}while(1<=C&&0<=d);break}}}finally{Bt=!1,Error.prepareStackTrace=a}return(a=g?g.displayName||g.name:"")?ze(a):""}function fn(g,s){switch(g.tag){case 26:case 27:case 5:return ze(g.type);case 16:return ze("Lazy");case 13:return g.child!==s&&s!==null?ze("Suspense Fallback"):ze("Suspense");case 19:return ze("SuspenseList");case 0:case 15:return Ht(g.type,!1);case 11:return Ht(g.type.render,!1);case 1:return Ht(g.type,!0);case 31:return ze("Activity");default:return""}}function se(g){try{var s="",a=null;do s+=fn(g,a),a=g,g=g.return;while(g);return s}catch(C){return` +`+R+g+de}var Je=!1;function Dt(g,s){if(!g||Je)return"";Je=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var C={DetermineComponentFrameRoot:function(){try{if(s){var te=function(){throw Error()};if(Object.defineProperty(te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(te,[])}catch(H){var L=H}Reflect.construct(g,[],te)}else{try{te.call()}catch(H){L=H}g.call(te.prototype)}}else{try{throw Error()}catch(H){L=H}(te=g())&&typeof te.catch=="function"&&te.catch(function(){})}}catch(H){if(H&&L&&typeof H.stack=="string")return[H.stack,L.stack]}return[null,null]}};C.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(C.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(C.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=C.DetermineComponentFrameRoot(),v=u[0],y=u[1];if(v&&y){var N=v.split(` +`),P=y.split(` +`);for(d=C=0;Cd||N[C]!==P[d]){var $=` +`+N[C].replace(" at new "," at ");return g.displayName&&$.includes("")&&($=$.replace("",g.displayName)),$}while(1<=C&&0<=d);break}}}finally{Je=!1,Error.prepareStackTrace=a}return(a=g?g.displayName||g.name:"")?Te(a):""}function Bt(g,s){switch(g.tag){case 26:case 27:case 5:return Te(g.type);case 16:return Te("Lazy");case 13:return g.child!==s&&s!==null?Te("Suspense Fallback"):Te("Suspense");case 19:return Te("SuspenseList");case 0:case 15:return Dt(g.type,!1);case 11:return Dt(g.type.render,!1);case 1:return Dt(g.type,!0);case 31:return Te("Activity");default:return""}}function re(g){try{var s="",a=null;do s+=Bt(g,a),a=g,g=g.return;while(g);return s}catch(C){return` Error generating stack: `+C.message+` -`+C.stack}}var je=Object.prototype.hasOwnProperty,ke=n.unstable_scheduleCallback,Pt=n.unstable_cancelCallback,Sn=n.unstable_shouldYield,V=n.unstable_requestPaint,ae=n.unstable_now,Xe=n.unstable_getCurrentPriorityLevel,St=n.unstable_ImmediatePriority,wt=n.unstable_UserBlockingPriority,Mn=n.unstable_NormalPriority,wI=n.unstable_LowPriority,X2=n.unstable_IdlePriority,_te=n.log,jte=n.unstable_setDisableYieldValue,Ha=null,Kn=null;function Hg(g){if(typeof _te=="function"&&jte(g),Kn&&typeof Kn.setStrictMode=="function")try{Kn.setStrictMode(Ha,g)}catch{}}var Wn=Math.clz32?Math.clz32:Pte,Zte=Math.log,Bte=Math.LN2;function Pte(g){return g>>>=0,g===0?32:31-(Zte(g)/Bte|0)|0}var xI=256,SI=262144,EI=4194304;function Fo(g){var s=g&42;if(s!==0)return s;switch(g&-g){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 g&261888;case 262144:case 524288:case 1048576:case 2097152:return g&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return g&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return g}}function TI(g,s,a){var C=g.pendingLanes;if(C===0)return 0;var d=0,u=g.suspendedLanes,v=g.pingedLanes;g=g.warmLanes;var y=C&134217727;return y!==0?(C=y&~u,C!==0?d=Fo(C):(v&=y,v!==0?d=Fo(v):a||(a=y&~g,a!==0&&(d=Fo(a))))):(y=C&~u,y!==0?d=Fo(y):v!==0?d=Fo(v):a||(a=C&~g,a!==0&&(d=Fo(a)))),d===0?0:s!==0&&s!==d&&(s&u)===0&&(u=d&-d,a=s&-s,u>=a||u===32&&(a&4194048)!==0)?s:d}function Ka(g,s){return(g.pendingLanes&~(g.suspendedLanes&~g.pingedLanes)&s)===0}function Lte(g,s){switch(g){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 $2(){var g=EI;return EI<<=1,(EI&62914560)===0&&(EI=4194304),g}function Ch(g){for(var s=[],a=0;31>a;a++)s.push(g);return s}function Wa(g,s){g.pendingLanes|=s,s!==268435456&&(g.suspendedLanes=0,g.pingedLanes=0,g.warmLanes=0)}function Gte(g,s,a,C,d,u){var v=g.pendingLanes;g.pendingLanes=a,g.suspendedLanes=0,g.pingedLanes=0,g.warmLanes=0,g.expiredLanes&=a,g.entangledLanes&=a,g.errorRecoveryDisabledLanes&=a,g.shellSuspendCounter=0;var y=g.entanglements,N=g.expirationTimes,j=g.hiddenUpdates;for(a=v&~a;0"u")return null;try{return g.activeElement||g.body}catch{return g.body}}var Kte=/[\n"\\]/g;function Ci(g){return g.replace(Kte,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function hh(g,s,a,C,d,u,v,y){g.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?g.type=v:g.removeAttribute("type"),s!=null?v==="number"?(s===0&&g.value===""||g.value!=s)&&(g.value=""+Ai(s)):g.value!==""+Ai(s)&&(g.value=""+Ai(s)):v!=="submit"&&v!=="reset"||g.removeAttribute("value"),s!=null?fh(g,v,Ai(s)):a!=null?fh(g,v,Ai(a)):C!=null&&g.removeAttribute("value"),d==null&&u!=null&&(g.defaultChecked=!!u),d!=null&&(g.checked=d&&typeof d!="function"&&typeof d!="symbol"),y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?g.name=""+Ai(y):g.removeAttribute("name")}function CS(g,s,a,C,d,u,v,y){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(g.type=u),s!=null||a!=null){if(!(u!=="submit"&&u!=="reset"||s!=null)){uh(g);return}a=a!=null?""+Ai(a):"",s=s!=null?""+Ai(s):a,y||s===g.value||(g.value=s),g.defaultValue=s}C=C??d,C=typeof C!="function"&&typeof C!="symbol"&&!!C,g.checked=y?g.checked:!!C,g.defaultChecked=!!C,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(g.name=v),uh(g)}function fh(g,s,a){s==="number"&&DI(g.ownerDocument)===g||g.defaultValue===""+a||(g.defaultValue=""+a)}function er(g,s,a,C){if(g=g.options,s){s={};for(var d=0;d"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yh=!1;if(ag)try{var qa={};Object.defineProperty(qa,"passive",{get:function(){yh=!0}}),window.addEventListener("test",qa,qa),window.removeEventListener("test",qa,qa)}catch{yh=!1}var Wg=null,wh=null,zI=null;function fS(){if(zI)return zI;var g,s=wh,a=s.length,C,d="value"in Wg?Wg.value:Wg.textContent,u=d.length;for(g=0;g=tA),wS=" ",xS=!1;function SS(g,s){switch(g){case"keyup":return bne.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ES(g){return g=g.detail,typeof g=="object"&&"data"in g?g.data:null}var gr=!1;function wne(g,s){switch(g){case"compositionend":return ES(s);case"keypress":return s.which!==32?null:(xS=!0,wS);case"textInput":return g=s.data,g===wS&&xS?null:g;default:return null}}function xne(g,s){if(gr)return g==="compositionend"||!Oh&&SS(g,s)?(g=fS(),zI=wh=Wg=null,gr=!1,g):null;switch(g){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:a,offset:s-g};g=C}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=RS(a)}}function jS(g,s){return g&&s?g===s?!0:g&&g.nodeType===3?!1:s&&s.nodeType===3?jS(g,s.parentNode):"contains"in g?g.contains(s):g.compareDocumentPosition?!!(g.compareDocumentPosition(s)&16):!1:!1}function ZS(g){g=g!=null&&g.ownerDocument!=null&&g.ownerDocument.defaultView!=null?g.ownerDocument.defaultView:window;for(var s=DI(g.document);s instanceof g.HTMLIFrameElement;){try{var a=typeof s.contentWindow.location.href=="string"}catch{a=!1}if(a)g=s.contentWindow;else break;s=DI(g.document)}return s}function Mh(g){var s=g&&g.nodeName&&g.nodeName.toLowerCase();return s&&(s==="input"&&(g.type==="text"||g.type==="search"||g.type==="tel"||g.type==="url"||g.type==="password")||s==="textarea"||g.contentEditable==="true")}var zne=ag&&"documentMode"in document&&11>=document.documentMode,or=null,zh=null,oA=null,kh=!1;function BS(g,s,a){var C=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;kh||or==null||or!==DI(C)||(C=or,"selectionStart"in C&&Mh(C)?C={start:C.selectionStart,end:C.selectionEnd}:(C=(C.ownerDocument&&C.ownerDocument.defaultView||window).getSelection(),C={anchorNode:C.anchorNode,anchorOffset:C.anchorOffset,focusNode:C.focusNode,focusOffset:C.focusOffset}),oA&&gA(oA,C)||(oA=C,C=Sl(zh,"onSelect"),0>=v,d-=v,Vi=1<<32-Wn(s)+d|a<Ge?(qe=be,be=null):qe=be.sibling;var it=P(k,be,_[Ge],q);if(it===null){be===null&&(be=qe);break}g&&be&&it.alternate===null&&s(k,be),D=u(it,D,Ge),nt===null?Ee=it:nt.sibling=it,nt=it,be=qe}if(Ge===_.length)return a(k,be),Je&&Cg(k,Ge),Ee;if(be===null){for(;Ge<_.length;Ge++)be=J(k,_[Ge],q),be!==null&&(D=u(be,D,Ge),nt===null?Ee=be:nt.sibling=be,nt=be);return Je&&Cg(k,Ge),Ee}for(be=C(be);Ge<_.length;Ge++)qe=U(be,k,Ge,_[Ge],q),qe!==null&&(g&&qe.alternate!==null&&be.delete(qe.key===null?Ge:qe.key),D=u(qe,D,Ge),nt===null?Ee=qe:nt.sibling=qe,nt=qe);return g&&be.forEach(function(fo){return s(k,fo)}),Je&&Cg(k,Ge),Ee}function De(k,D,_,q){if(_==null)throw Error(i(151));for(var Ee=null,nt=null,be=D,Ge=D=0,qe=null,it=_.next();be!==null&&!it.done;Ge++,it=_.next()){be.index>Ge?(qe=be,be=null):qe=be.sibling;var fo=P(k,be,it.value,q);if(fo===null){be===null&&(be=qe);break}g&&be&&fo.alternate===null&&s(k,be),D=u(fo,D,Ge),nt===null?Ee=fo:nt.sibling=fo,nt=fo,be=qe}if(it.done)return a(k,be),Je&&Cg(k,Ge),Ee;if(be===null){for(;!it.done;Ge++,it=_.next())it=J(k,it.value,q),it!==null&&(D=u(it,D,Ge),nt===null?Ee=it:nt.sibling=it,nt=it);return Je&&Cg(k,Ge),Ee}for(be=C(be);!it.done;Ge++,it=_.next())it=U(be,k,Ge,it.value,q),it!==null&&(g&&it.alternate!==null&&be.delete(it.key===null?Ge:it.key),D=u(it,D,Ge),nt===null?Ee=it:nt.sibling=it,nt=it);return g&&be.forEach(function(qie){return s(k,qie)}),Je&&Cg(k,Ge),Ee}function ft(k,D,_,q){if(typeof _=="object"&&_!==null&&_.type===S&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case b:e:{for(var Ee=_.key;D!==null;){if(D.key===Ee){if(Ee=_.type,Ee===S){if(D.tag===7){a(k,D.sibling),q=d(D,_.props.children),q.return=k,k=q;break e}}else if(D.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===G&&Jo(Ee)===D.type){a(k,D.sibling),q=d(D,_.props),IA(q,_),q.return=k,k=q;break e}a(k,D);break}else s(k,D);D=D.sibling}_.type===S?(q=Wo(_.props.children,k.mode,q,_.key),q.return=k,k=q):(q=FI(_.type,_.key,_.props,null,k.mode,q),IA(q,_),q.return=k,k=q)}return v(k);case w:e:{for(Ee=_.key;D!==null;){if(D.key===Ee)if(D.tag===4&&D.stateNode.containerInfo===_.containerInfo&&D.stateNode.implementation===_.implementation){a(k,D.sibling),q=d(D,_.children||[]),q.return=k,k=q;break e}else{a(k,D);break}else s(k,D);D=D.sibling}q=Lh(_,k.mode,q),q.return=k,k=q}return v(k);case G:return _=Jo(_),ft(k,D,_,q)}if(Ce(_))return ue(k,D,_,q);if(Te(_)){if(Ee=Te(_),typeof Ee!="function")throw Error(i(150));return _=Ee.call(_),De(k,D,_,q)}if(typeof _.then=="function")return ft(k,D,QI(_),q);if(_.$$typeof===R)return ft(k,D,YI(k,_),q);XI(k,_)}return typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint"?(_=""+_,D!==null&&D.tag===6?(a(k,D.sibling),q=d(D,_),q.return=k,k=q):(a(k,D),q=Ph(_,k.mode,q),q.return=k,k=q),v(k)):a(k,D)}return function(k,D,_,q){try{CA=0;var Ee=ft(k,D,_,q);return hr=null,Ee}catch(be){if(be===ur||be===KI)throw be;var nt=Xn(29,be,null,k.mode);return nt.lanes=q,nt.return=k,nt}}}var ts=rE(!0),aE=rE(!1),Jg=!1;function qh(g){g.updateQueue={baseState:g.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jh(g,s){g=g.updateQueue,s.updateQueue===g&&(s.updateQueue={baseState:g.baseState,firstBaseUpdate:g.firstBaseUpdate,lastBaseUpdate:g.lastBaseUpdate,shared:g.shared,callbacks:null})}function eo(g){return{lane:g,tag:0,payload:null,callback:null,next:null}}function to(g,s,a){var C=g.updateQueue;if(C===null)return null;if(C=C.shared,(st&2)!==0){var d=C.pending;return d===null?s.next=s:(s.next=d.next,d.next=s),C.pending=s,s=GI(g),YS(g,null,a),s}return LI(g,C,s,a),GI(g)}function lA(g,s,a){if(s=s.updateQueue,s!==null&&(s=s.shared,(a&4194048)!==0)){var C=s.lanes;C&=g.pendingLanes,a|=C,s.lanes=a,J2(g,a)}}function ef(g,s){var a=g.updateQueue,C=g.alternate;if(C!==null&&(C=C.updateQueue,a===C)){var d=null,u=null;if(a=a.firstBaseUpdate,a!==null){do{var v={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};u===null?d=u=v:u=u.next=v,a=a.next}while(a!==null);u===null?d=u=s:u=u.next=s}else d=u=s;a={baseState:C.baseState,firstBaseUpdate:d,lastBaseUpdate:u,shared:C.shared,callbacks:C.callbacks},g.updateQueue=a;return}g=a.lastBaseUpdate,g===null?a.firstBaseUpdate=s:g.next=s,a.lastBaseUpdate=s}var tf=!1;function cA(){if(tf){var g=dr;if(g!==null)throw g}}function dA(g,s,a,C){tf=!1;var d=g.updateQueue;Jg=!1;var u=d.firstBaseUpdate,v=d.lastBaseUpdate,y=d.shared.pending;if(y!==null){d.shared.pending=null;var N=y,j=N.next;N.next=null,v===null?u=j:v.next=j,v=N;var X=g.alternate;X!==null&&(X=X.updateQueue,y=X.lastBaseUpdate,y!==v&&(y===null?X.firstBaseUpdate=j:y.next=j,X.lastBaseUpdate=N))}if(u!==null){var J=d.baseState;v=0,X=j=N=null,y=u;do{var P=y.lane&-536870913,U=P!==y.lane;if(U?($e&P)===P:(C&P)===P){P!==0&&P===cr&&(tf=!0),X!==null&&(X=X.next={lane:0,tag:y.tag,payload:y.payload,callback:null,next:null});e:{var ue=g,De=y;P=s;var ft=a;switch(De.tag){case 1:if(ue=De.payload,typeof ue=="function"){J=ue.call(ft,J,P);break e}J=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=De.payload,P=typeof ue=="function"?ue.call(ft,J,P):ue,P==null)break e;J=p({},J,P);break e;case 2:Jg=!0}}P=y.callback,P!==null&&(g.flags|=64,U&&(g.flags|=8192),U=d.callbacks,U===null?d.callbacks=[P]:U.push(P))}else U={lane:P,tag:y.tag,payload:y.payload,callback:y.callback,next:null},X===null?(j=X=U,N=J):X=X.next=U,v|=P;if(y=y.next,y===null){if(y=d.shared.pending,y===null)break;U=y,y=U.next,U.next=null,d.lastBaseUpdate=U,d.shared.pending=null}}while(!0);X===null&&(N=J),d.baseState=N,d.firstBaseUpdate=j,d.lastBaseUpdate=X,u===null&&(d.shared.lanes=0),so|=v,g.lanes=v,g.memoizedState=J}}function AE(g,s){if(typeof g!="function")throw Error(i(191,g));g.call(s)}function CE(g,s){var a=g.callbacks;if(a!==null)for(g.callbacks=null,g=0;gu?u:8;var v=M.T,y={};M.T=y,bf(g,!1,s,a);try{var N=d(),j=M.S;if(j!==null&&j(y,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var X=Gne(N,C);fA(g,s,X,ti(g))}else fA(g,s,C,ti(g))}catch(J){fA(g,s,{then:function(){},status:"rejected",reason:J},ti())}finally{Q.p=u,v!==null&&y.types!==null&&(v.types=y.types),M.T=v}}function Kne(){}function mf(g,s,a,C){if(g.tag!==5)throw Error(i(476));var d=FE(g).queue;GE(g,d,s,K,a===null?Kne:function(){return VE(g),a(C)})}function FE(g){var s=g.memoizedState;if(s!==null)return s;s={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dg,lastRenderedState:K},next:null};var a={};return s.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dg,lastRenderedState:a},next:null},g.memoizedState=s,g=g.alternate,g!==null&&(g.memoizedState=s),s}function VE(g){var s=FE(g);s.next===null&&(s=g.alternate.memoizedState),fA(g,s.next.queue,{},ti())}function vf(){return vn(RA)}function UE(){return Wt().memoizedState}function YE(){return Wt().memoizedState}function Wne(g){for(var s=g.return;s!==null;){switch(s.tag){case 24:case 3:var a=ti();g=eo(a);var C=to(s,g,a);C!==null&&(Vn(C,s,a),lA(C,s,a)),s={cache:Wh()},g.payload=s;return}s=s.return}}function Qne(g,s,a){var C=ti();a={lane:C,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},sl(g)?KE(s,a):(a=Zh(g,s,a,C),a!==null&&(Vn(a,g,C),WE(a,s,C)))}function HE(g,s,a){var C=ti();fA(g,s,a,C)}function fA(g,s,a,C){var d={lane:C,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(sl(g))KE(s,d);else{var u=g.alternate;if(g.lanes===0&&(u===null||u.lanes===0)&&(u=s.lastRenderedReducer,u!==null))try{var v=s.lastRenderedState,y=u(v,a);if(d.hasEagerState=!0,d.eagerState=y,Qn(y,v))return LI(g,s,d,0),pt===null&&PI(),!1}catch{}if(a=Zh(g,s,d,C),a!==null)return Vn(a,g,C),WE(a,s,C),!0}return!1}function bf(g,s,a,C){if(C={lane:2,revertLane:Jf(),gesture:null,action:C,hasEagerState:!1,eagerState:null,next:null},sl(g)){if(s)throw Error(i(479))}else s=Zh(g,a,C,2),s!==null&&Vn(s,g,2)}function sl(g){var s=g.alternate;return g===Le||s!==null&&s===Le}function KE(g,s){pr=JI=!0;var a=g.pending;a===null?s.next=s:(s.next=a.next,a.next=s),g.pending=s}function WE(g,s,a){if((a&4194048)!==0){var C=s.lanes;C&=g.pendingLanes,a|=C,s.lanes=a,J2(g,a)}}var pA={readContext:vn,use:nl,useCallback:Lt,useContext:Lt,useEffect:Lt,useImperativeHandle:Lt,useLayoutEffect:Lt,useInsertionEffect:Lt,useMemo:Lt,useReducer:Lt,useRef:Lt,useState:Lt,useDebugValue:Lt,useDeferredValue:Lt,useTransition:Lt,useSyncExternalStore:Lt,useId:Lt,useHostTransitionStatus:Lt,useFormState:Lt,useActionState:Lt,useOptimistic:Lt,useMemoCache:Lt,useCacheRefresh:Lt};pA.useEffectEvent=Lt;var QE={readContext:vn,use:nl,useCallback:function(g,s){return zn().memoizedState=[g,s===void 0?null:s],g},useContext:vn,useEffect:zE,useImperativeHandle:function(g,s,a){a=a!=null?a.concat([g]):null,gl(4194308,4,jE.bind(null,s,g),a)},useLayoutEffect:function(g,s){return gl(4194308,4,g,s)},useInsertionEffect:function(g,s){gl(4,2,g,s)},useMemo:function(g,s){var a=zn();s=s===void 0?null:s;var C=g();if(ns){Hg(!0);try{g()}finally{Hg(!1)}}return a.memoizedState=[C,s],C},useReducer:function(g,s,a){var C=zn();if(a!==void 0){var d=a(s);if(ns){Hg(!0);try{a(s)}finally{Hg(!1)}}}else d=s;return C.memoizedState=C.baseState=d,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:g,lastRenderedState:d},C.queue=g,g=g.dispatch=Qne.bind(null,Le,g),[C.memoizedState,g]},useRef:function(g){var s=zn();return g={current:g},s.memoizedState=g},useState:function(g){g=df(g);var s=g.queue,a=HE.bind(null,Le,s);return s.dispatch=a,[g.memoizedState,a]},useDebugValue:ff,useDeferredValue:function(g,s){var a=zn();return pf(a,g,s)},useTransition:function(){var g=df(!1);return g=GE.bind(null,Le,g.queue,!0,!1),zn().memoizedState=g,[!1,g]},useSyncExternalStore:function(g,s,a){var C=Le,d=zn();if(Je){if(a===void 0)throw Error(i(407));a=a()}else{if(a=s(),pt===null)throw Error(i(349));($e&127)!==0||hE(C,s,a)}d.memoizedState=a;var u={value:a,getSnapshot:s};return d.queue=u,zE(pE.bind(null,C,u,g),[g]),C.flags|=2048,vr(9,{destroy:void 0},fE.bind(null,C,u,a,s),null),a},useId:function(){var g=zn(),s=pt.identifierPrefix;if(Je){var a=Ui,C=Vi;a=(C&~(1<<32-Wn(C)-1)).toString(32)+a,s="_"+s+"R_"+a,a=el++,0<\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof C.is=="string"?v.createElement("select",{is:C.is}):v.createElement("select"),C.multiple?u.multiple=!0:C.size&&(u.size=C.size);break;default:u=typeof C.is=="string"?v.createElement(d,{is:C.is}):v.createElement(d)}}u[pn]=s,u[Zn]=C;e:for(v=s.child;v!==null;){if(v.tag===5||v.tag===6)u.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===s)break e;for(;v.sibling===null;){if(v.return===null||v.return===s)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}s.stateNode=u;e:switch(yn(u,d,C),d){case"button":case"input":case"select":case"textarea":C=!!C.autoFocus;break e;case"img":C=!0;break e;default:C=!1}C&&hg(s)}}return Tt(s),_f(s,s.type,g===null?null:g.memoizedProps,s.pendingProps,a),null;case 6:if(g&&s.stateNode!=null)g.memoizedProps!==C&&hg(s);else{if(typeof C!="string"&&s.stateNode===null)throw Error(i(166));if(g=pe.current,Ir(s)){if(g=s.stateNode,a=s.memoizedProps,C=null,d=mn,d!==null)switch(d.tag){case 27:case 5:C=d.memoizedProps}g[pn]=s,g=!!(g.nodeValue===a||C!==null&&C.suppressHydrationWarning===!0||dO(g.nodeValue,a)),g||$g(s,!0)}else g=El(g).createTextNode(C),g[pn]=s,s.stateNode=g}return Tt(s),null;case 31:if(a=s.memoizedState,g===null||g.memoizedState!==null){if(C=Ir(s),a!==null){if(g===null){if(!C)throw Error(i(318));if(g=s.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(i(557));g[pn]=s}else Qo(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Tt(s),g=!1}else a=Uh(),g!==null&&g.memoizedState!==null&&(g.memoizedState.hydrationErrors=a),g=!0;if(!g)return s.flags&256?(qn(s),s):(qn(s),null);if((s.flags&128)!==0)throw Error(i(558))}return Tt(s),null;case 13:if(C=s.memoizedState,g===null||g.memoizedState!==null&&g.memoizedState.dehydrated!==null){if(d=Ir(s),C!==null&&C.dehydrated!==null){if(g===null){if(!d)throw Error(i(318));if(d=s.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(i(317));d[pn]=s}else Qo(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Tt(s),d=!1}else d=Uh(),g!==null&&g.memoizedState!==null&&(g.memoizedState.hydrationErrors=d),d=!0;if(!d)return s.flags&256?(qn(s),s):(qn(s),null)}return qn(s),(s.flags&128)!==0?(s.lanes=a,s):(a=C!==null,g=g!==null&&g.memoizedState!==null,a&&(C=s.child,d=null,C.alternate!==null&&C.alternate.memoizedState!==null&&C.alternate.memoizedState.cachePool!==null&&(d=C.alternate.memoizedState.cachePool.pool),u=null,C.memoizedState!==null&&C.memoizedState.cachePool!==null&&(u=C.memoizedState.cachePool.pool),u!==d&&(C.flags|=2048)),a!==g&&a&&(s.child.flags|=8192),Il(s,s.updateQueue),Tt(s),null);case 4:return Re(),g===null&&ip(s.stateNode.containerInfo),Tt(s),null;case 10:return lg(s.type),Tt(s),null;case 19:if(F(Kt),C=s.memoizedState,C===null)return Tt(s),null;if(d=(s.flags&128)!==0,u=C.rendering,u===null)if(d)vA(C,!1);else{if(Gt!==0||g!==null&&(g.flags&128)!==0)for(g=s.child;g!==null;){if(u=qI(g),u!==null){for(s.flags|=128,vA(C,!1),g=u.updateQueue,s.updateQueue=g,Il(s,g),s.subtreeFlags=0,g=a,a=s.child;a!==null;)HS(a,g),a=a.sibling;return te(Kt,Kt.current&1|2),Je&&Cg(s,C.treeForkCount),s.child}g=g.sibling}C.tail!==null&&ae()>hl&&(s.flags|=128,d=!0,vA(C,!1),s.lanes=4194304)}else{if(!d)if(g=qI(u),g!==null){if(s.flags|=128,d=!0,g=g.updateQueue,s.updateQueue=g,Il(s,g),vA(C,!0),C.tail===null&&C.tailMode==="hidden"&&!u.alternate&&!Je)return Tt(s),null}else 2*ae()-C.renderingStartTime>hl&&a!==536870912&&(s.flags|=128,d=!0,vA(C,!1),s.lanes=4194304);C.isBackwards?(u.sibling=s.child,s.child=u):(g=C.last,g!==null?g.sibling=u:s.child=u,C.last=u)}return C.tail!==null?(g=C.tail,C.rendering=g,C.tail=g.sibling,C.renderingStartTime=ae(),g.sibling=null,a=Kt.current,te(Kt,d?a&1|2:a&1),Je&&Cg(s,C.treeForkCount),g):(Tt(s),null);case 22:case 23:return qn(s),gf(),C=s.memoizedState!==null,g!==null?g.memoizedState!==null!==C&&(s.flags|=8192):C&&(s.flags|=8192),C?(a&536870912)!==0&&(s.flags&128)===0&&(Tt(s),s.subtreeFlags&6&&(s.flags|=8192)):Tt(s),a=s.updateQueue,a!==null&&Il(s,a.retryQueue),a=null,g!==null&&g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(a=g.memoizedState.cachePool.pool),C=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(C=s.memoizedState.cachePool.pool),C!==a&&(s.flags|=2048),g!==null&&F(qo),null;case 24:return a=null,g!==null&&(a=g.memoizedState.cache),s.memoizedState.cache!==a&&(s.flags|=2048),lg(tn),Tt(s),null;case 25:return null;case 30:return null}throw Error(i(156,s.tag))}function eie(g,s){switch(Fh(s),s.tag){case 1:return g=s.flags,g&65536?(s.flags=g&-65537|128,s):null;case 3:return lg(tn),Re(),g=s.flags,(g&65536)!==0&&(g&128)===0?(s.flags=g&-65537|128,s):null;case 26:case 27:case 5:return z(s),null;case 31:if(s.memoizedState!==null){if(qn(s),s.alternate===null)throw Error(i(340));Qo()}return g=s.flags,g&65536?(s.flags=g&-65537|128,s):null;case 13:if(qn(s),g=s.memoizedState,g!==null&&g.dehydrated!==null){if(s.alternate===null)throw Error(i(340));Qo()}return g=s.flags,g&65536?(s.flags=g&-65537|128,s):null;case 19:return F(Kt),null;case 4:return Re(),null;case 10:return lg(s.type),null;case 22:case 23:return qn(s),gf(),g!==null&&F(qo),g=s.flags,g&65536?(s.flags=g&-65537|128,s):null;case 24:return lg(tn),null;case 25:return null;default:return null}}function mT(g,s){switch(Fh(s),s.tag){case 3:lg(tn),Re();break;case 26:case 27:case 5:z(s);break;case 4:Re();break;case 31:s.memoizedState!==null&&qn(s);break;case 13:qn(s);break;case 19:F(Kt);break;case 10:lg(s.type);break;case 22:case 23:qn(s),gf(),g!==null&&F(qo);break;case 24:lg(tn)}}function bA(g,s){try{var a=s.updateQueue,C=a!==null?a.lastEffect:null;if(C!==null){var d=C.next;a=d;do{if((a.tag&g)===g){C=void 0;var u=a.create,v=a.inst;C=u(),v.destroy=C}a=a.next}while(a!==d)}}catch(y){It(s,s.return,y)}}function go(g,s,a){try{var C=s.updateQueue,d=C!==null?C.lastEffect:null;if(d!==null){var u=d.next;C=u;do{if((C.tag&g)===g){var v=C.inst,y=v.destroy;if(y!==void 0){v.destroy=void 0,d=s;var N=a,j=y;try{j()}catch(X){It(d,N,X)}}}C=C.next}while(C!==u)}}catch(X){It(s,s.return,X)}}function vT(g){var s=g.updateQueue;if(s!==null){var a=g.stateNode;try{CE(s,a)}catch(C){It(g,g.return,C)}}}function bT(g,s,a){a.props=is(g.type,g.memoizedProps),a.state=g.memoizedState;try{a.componentWillUnmount()}catch(C){It(g,s,C)}}function yA(g,s){try{var a=g.ref;if(a!==null){switch(g.tag){case 26:case 27:case 5:var C=g.stateNode;break;case 30:C=g.stateNode;break;default:C=g.stateNode}typeof a=="function"?g.refCleanup=a(C):a.current=C}}catch(d){It(g,s,d)}}function Yi(g,s){var a=g.ref,C=g.refCleanup;if(a!==null)if(typeof C=="function")try{C()}catch(d){It(g,s,d)}finally{g.refCleanup=null,g=g.alternate,g!=null&&(g.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(d){It(g,s,d)}else a.current=null}function yT(g){var s=g.type,a=g.memoizedProps,C=g.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":a.autoFocus&&C.focus();break e;case"img":a.src?C.src=a.src:a.srcSet&&(C.srcset=a.srcSet)}}catch(d){It(g,g.return,d)}}function jf(g,s,a){try{var C=g.stateNode;yie(C,g.type,a,s),C[Zn]=s}catch(d){It(g,g.return,d)}}function wT(g){return g.tag===5||g.tag===3||g.tag===26||g.tag===27&&Io(g.type)||g.tag===4}function Zf(g){e:for(;;){for(;g.sibling===null;){if(g.return===null||wT(g.return))return null;g=g.return}for(g.sibling.return=g.return,g=g.sibling;g.tag!==5&&g.tag!==6&&g.tag!==18;){if(g.tag===27&&Io(g.type)||g.flags&2||g.child===null||g.tag===4)continue e;g.child.return=g,g=g.child}if(!(g.flags&2))return g.stateNode}}function Bf(g,s,a){var C=g.tag;if(C===5||C===6)g=g.stateNode,s?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(g,s):(s=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,s.appendChild(g),a=a._reactRootContainer,a!=null||s.onclick!==null||(s.onclick=rg));else if(C!==4&&(C===27&&Io(g.type)&&(a=g.stateNode,s=null),g=g.child,g!==null))for(Bf(g,s,a),g=g.sibling;g!==null;)Bf(g,s,a),g=g.sibling}function ll(g,s,a){var C=g.tag;if(C===5||C===6)g=g.stateNode,s?a.insertBefore(g,s):a.appendChild(g);else if(C!==4&&(C===27&&Io(g.type)&&(a=g.stateNode),g=g.child,g!==null))for(ll(g,s,a),g=g.sibling;g!==null;)ll(g,s,a),g=g.sibling}function xT(g){var s=g.stateNode,a=g.memoizedProps;try{for(var C=g.type,d=s.attributes;d.length;)s.removeAttributeNode(d[0]);yn(s,C,a),s[pn]=g,s[Zn]=a}catch(u){It(g,g.return,u)}}var fg=!1,on=!1,Pf=!1,ST=typeof WeakSet=="function"?WeakSet:Set,cn=null;function tie(g,s){if(g=g.containerInfo,sp=kl,g=ZS(g),Mh(g)){if("selectionStart"in g)var a={start:g.selectionStart,end:g.selectionEnd};else e:{a=(a=g.ownerDocument)&&a.defaultView||window;var C=a.getSelection&&a.getSelection();if(C&&C.rangeCount!==0){a=C.anchorNode;var d=C.anchorOffset,u=C.focusNode;C=C.focusOffset;try{a.nodeType,u.nodeType}catch{a=null;break e}var v=0,y=-1,N=-1,j=0,X=0,J=g,P=null;t:for(;;){for(var U;J!==a||d!==0&&J.nodeType!==3||(y=v+d),J!==u||C!==0&&J.nodeType!==3||(N=v+C),J.nodeType===3&&(v+=J.nodeValue.length),(U=J.firstChild)!==null;)P=J,J=U;for(;;){if(J===g)break t;if(P===a&&++j===d&&(y=v),P===u&&++X===C&&(N=v),(U=J.nextSibling)!==null)break;J=P,P=J.parentNode}J=U}a=y===-1||N===-1?null:{start:y,end:N}}else a=null}a=a||{start:0,end:0}}else a=null;for(rp={focusedElem:g,selectionRange:a},kl=!1,cn=s;cn!==null;)if(s=cn,g=s.child,(s.subtreeFlags&1028)!==0&&g!==null)g.return=s,cn=g;else for(;cn!==null;){switch(s=cn,u=s.alternate,g=s.flags,s.tag){case 0:if((g&4)!==0&&(g=s.updateQueue,g=g!==null?g.events:null,g!==null))for(a=0;a title"))),yn(u,C,a),u[pn]=g,ln(u),C=u;break e;case"link":var v=MO("link","href",d).get(C+(a.href||""));if(v){for(var y=0;yft&&(v=ft,ft=De,De=v);var k=_S(y,De),D=_S(y,ft);if(k&&D&&(U.rangeCount!==1||U.anchorNode!==k.node||U.anchorOffset!==k.offset||U.focusNode!==D.node||U.focusOffset!==D.offset)){var _=J.createRange();_.setStart(k.node,k.offset),U.removeAllRanges(),De>ft?(U.addRange(_),U.extend(D.node,D.offset)):(_.setEnd(D.node,D.offset),U.addRange(_))}}}}for(J=[],U=y;U=U.parentNode;)U.nodeType===1&&J.push({element:U,left:U.scrollLeft,top:U.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;ya?32:a,M.T=null,a=Hf,Hf=null;var u=ao,v=yg;if(An=0,Sr=ao=null,yg=0,(st&6)!==0)throw Error(i(331));var y=st;if(st|=4,jT(u.current),kT(u,u.current,v,a),st=y,OA(0,!1),Kn&&typeof Kn.onPostCommitFiberRoot=="function")try{Kn.onPostCommitFiberRoot(Ha,u)}catch{}return!0}finally{Q.p=d,M.T=C,eO(g,s)}}function nO(g,s,a){s=li(a,s),s=Sf(g.stateNode,s,2),g=to(g,s,2),g!==null&&(Wa(g,2),Hi(g))}function It(g,s,a){if(g.tag===3)nO(g,g,a);else for(;s!==null;){if(s.tag===3){nO(s,g,a);break}else if(s.tag===1){var C=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof C.componentDidCatch=="function"&&(ro===null||!ro.has(C))){g=li(a,g),a=iT(2),C=to(s,a,2),C!==null&&(gT(a,C,s,g),Wa(C,2),Hi(C));break}}s=s.return}}function Xf(g,s,a){var C=g.pingCache;if(C===null){C=g.pingCache=new gie;var d=new Set;C.set(s,d)}else d=C.get(s),d===void 0&&(d=new Set,C.set(s,d));d.has(a)||(Ff=!0,d.add(a),g=Aie.bind(null,g,s,a),s.then(g,g))}function Aie(g,s,a){var C=g.pingCache;C!==null&&C.delete(s),g.pingedLanes|=g.suspendedLanes&a,g.warmLanes&=~a,pt===g&&($e&a)===a&&(Gt===4||Gt===3&&($e&62914560)===$e&&300>ae()-ul?(st&2)===0&&Er(g,0):Vf|=a,xr===$e&&(xr=0)),Hi(g)}function iO(g,s){s===0&&(s=$2()),g=Ko(g,s),g!==null&&(Wa(g,s),Hi(g))}function Cie(g){var s=g.memoizedState,a=0;s!==null&&(a=s.retryLane),iO(g,a)}function Iie(g,s){var a=0;switch(g.tag){case 31:case 13:var C=g.stateNode,d=g.memoizedState;d!==null&&(a=d.retryLane);break;case 19:C=g.stateNode;break;case 22:C=g.stateNode._retryCache;break;default:throw Error(i(314))}C!==null&&C.delete(s),iO(g,a)}function lie(g,s){return ke(g,s)}var yl=null,Or=null,$f=!1,wl=!1,qf=!1,Co=0;function Hi(g){g!==Or&&g.next===null&&(Or===null?yl=Or=g:Or=Or.next=g),wl=!0,$f||($f=!0,die())}function OA(g,s){if(!qf&&wl){qf=!0;do for(var a=!1,C=yl;C!==null;){if(g!==0){var d=C.pendingLanes;if(d===0)var u=0;else{var v=C.suspendedLanes,y=C.pingedLanes;u=(1<<31-Wn(42|g)+1)-1,u&=d&~(v&~y),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(a=!0,rO(C,u))}else u=$e,u=TI(C,C===pt?u:0,C.cancelPendingCommit!==null||C.timeoutHandle!==-1),(u&3)===0||Ka(C,u)||(a=!0,rO(C,u));C=C.next}while(a);qf=!1}}function cie(){gO()}function gO(){wl=$f=!1;var g=0;Co!==0&&xie()&&(g=Co);for(var s=ae(),a=null,C=yl;C!==null;){var d=C.next,u=oO(C,s);u===0?(C.next=null,a===null?yl=d:a.next=d,d===null&&(Or=a)):(a=C,(g!==0||(u&3)!==0)&&(wl=!0)),C=d}An!==0&&An!==5||OA(g),Co!==0&&(Co=0)}function oO(g,s){for(var a=g.suspendedLanes,C=g.pingedLanes,d=g.expirationTimes,u=g.pendingLanes&-62914561;0y)break;var X=N.transferSize,J=N.initiatorType;X&&uO(J)&&(N=N.responseEnd,v+=X*(N"u"?null:document;function TO(g,s,a){var C=Nr;if(C&&typeof s=="string"&&s){var d=Ci(s);d='link[rel="'+g+'"][href="'+d+'"]',typeof a=="string"&&(d+='[crossorigin="'+a+'"]'),EO.has(d)||(EO.add(d),g={rel:g,crossOrigin:a,href:s},C.querySelector(d)===null&&(s=C.createElement("link"),yn(s,"link",g),ln(s),C.head.appendChild(s)))}}function kie(g){wg.D(g),TO("dns-prefetch",g,null)}function Rie(g,s){wg.C(g,s),TO("preconnect",g,s)}function _ie(g,s,a){wg.L(g,s,a);var C=Nr;if(C&&g&&s){var d='link[rel="preload"][as="'+Ci(s)+'"]';s==="image"&&a&&a.imageSrcSet?(d+='[imagesrcset="'+Ci(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(d+='[imagesizes="'+Ci(a.imageSizes)+'"]')):d+='[href="'+Ci(g)+'"]';var u=d;switch(s){case"style":u=Dr(g);break;case"script":u=Mr(g)}pi.has(u)||(g=p({rel:"preload",href:s==="image"&&a&&a.imageSrcSet?void 0:g,as:s},a),pi.set(u,g),C.querySelector(d)!==null||s==="style"&&C.querySelector(zA(u))||s==="script"&&C.querySelector(kA(u))||(s=C.createElement("link"),yn(s,"link",g),ln(s),C.head.appendChild(s)))}}function jie(g,s){wg.m(g,s);var a=Nr;if(a&&g){var C=s&&typeof s.as=="string"?s.as:"script",d='link[rel="modulepreload"][as="'+Ci(C)+'"][href="'+Ci(g)+'"]',u=d;switch(C){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Mr(g)}if(!pi.has(u)&&(g=p({rel:"modulepreload",href:g},s),pi.set(u,g),a.querySelector(d)===null)){switch(C){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(kA(u)))return}C=a.createElement("link"),yn(C,"link",g),ln(C),a.head.appendChild(C)}}}function Zie(g,s,a){wg.S(g,s,a);var C=Nr;if(C&&g){var d=qs(C).hoistableStyles,u=Dr(g);s=s||"default";var v=d.get(u);if(!v){var y={loading:0,preload:null};if(v=C.querySelector(zA(u)))y.loading=5;else{g=p({rel:"stylesheet",href:g,"data-precedence":s},a),(a=pi.get(u))&&dp(g,a);var N=v=C.createElement("link");ln(N),yn(N,"link",g),N._p=new Promise(function(j,X){N.onload=j,N.onerror=X}),N.addEventListener("load",function(){y.loading|=1}),N.addEventListener("error",function(){y.loading|=2}),y.loading|=4,Ol(v,s,C)}v={type:"stylesheet",instance:v,count:1,state:y},d.set(u,v)}}}function Bie(g,s){wg.X(g,s);var a=Nr;if(a&&g){var C=qs(a).hoistableScripts,d=Mr(g),u=C.get(d);u||(u=a.querySelector(kA(d)),u||(g=p({src:g,async:!0},s),(s=pi.get(d))&&up(g,s),u=a.createElement("script"),ln(u),yn(u,"link",g),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},C.set(d,u))}}function Pie(g,s){wg.M(g,s);var a=Nr;if(a&&g){var C=qs(a).hoistableScripts,d=Mr(g),u=C.get(d);u||(u=a.querySelector(kA(d)),u||(g=p({src:g,async:!0,type:"module"},s),(s=pi.get(d))&&up(g,s),u=a.createElement("script"),ln(u),yn(u,"link",g),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},C.set(d,u))}}function OO(g,s,a,C){var d=(d=pe.current)?Tl(d):null;if(!d)throw Error(i(446));switch(g){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(s=Dr(a.href),a=qs(d).hoistableStyles,C=a.get(s),C||(C={type:"style",instance:null,count:0,state:null},a.set(s,C)),C):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){g=Dr(a.href);var u=qs(d).hoistableStyles,v=u.get(g);if(v||(d=d.ownerDocument||d,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(g,v),(u=d.querySelector(zA(g)))&&!u._p&&(v.instance=u,v.state.loading=5),pi.has(g)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},pi.set(g,a),u||Lie(d,g,a,v.state))),s&&C===null)throw Error(i(528,""));return v}if(s&&C!==null)throw Error(i(529,""));return null;case"script":return s=a.async,a=a.src,typeof a=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Mr(a),a=qs(d).hoistableScripts,C=a.get(s),C||(C={type:"script",instance:null,count:0,state:null},a.set(s,C)),C):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,g))}}function Dr(g){return'href="'+Ci(g)+'"'}function zA(g){return'link[rel="stylesheet"]['+g+"]"}function NO(g){return p({},g,{"data-precedence":g.precedence,precedence:null})}function Lie(g,s,a,C){g.querySelector('link[rel="preload"][as="style"]['+s+"]")?C.loading=1:(s=g.createElement("link"),C.preload=s,s.addEventListener("load",function(){return C.loading|=1}),s.addEventListener("error",function(){return C.loading|=2}),yn(s,"link",a),ln(s),g.head.appendChild(s))}function Mr(g){return'[src="'+Ci(g)+'"]'}function kA(g){return"script[async]"+g}function DO(g,s,a){if(s.count++,s.instance===null)switch(s.type){case"style":var C=g.querySelector('style[data-href~="'+Ci(a.href)+'"]');if(C)return s.instance=C,ln(C),C;var d=p({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return C=(g.ownerDocument||g).createElement("style"),ln(C),yn(C,"style",d),Ol(C,a.precedence,g),s.instance=C;case"stylesheet":d=Dr(a.href);var u=g.querySelector(zA(d));if(u)return s.state.loading|=4,s.instance=u,ln(u),u;C=NO(a),(d=pi.get(d))&&dp(C,d),u=(g.ownerDocument||g).createElement("link"),ln(u);var v=u;return v._p=new Promise(function(y,N){v.onload=y,v.onerror=N}),yn(u,"link",C),s.state.loading|=4,Ol(u,a.precedence,g),s.instance=u;case"script":return u=Mr(a.src),(d=g.querySelector(kA(u)))?(s.instance=d,ln(d),d):(C=a,(d=pi.get(u))&&(C=p({},a),up(C,d)),g=g.ownerDocument||g,d=g.createElement("script"),ln(d),yn(d,"link",C),g.head.appendChild(d),s.instance=d);case"void":return null;default:throw Error(i(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(C=s.instance,s.state.loading|=4,Ol(C,a.precedence,g));return s.instance}function Ol(g,s,a){for(var C=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=C.length?C[C.length-1]:null,u=d,v=0;v title"):null)}function Gie(g,s,a){if(a===1||s.itemProp!=null)return!1;switch(g){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(g=s.disabled,typeof s.precedence=="string"&&g==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function kO(g){return!(g.type==="stylesheet"&&(g.state.loading&3)===0)}function Fie(g,s,a,C){if(a.type==="stylesheet"&&(typeof C.media!="string"||matchMedia(C.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var d=Dr(C.href),u=s.querySelector(zA(d));if(u){s=u._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(g.count++,g=Dl.bind(g),s.then(g,g)),a.state.loading|=4,a.instance=u,ln(u);return}u=s.ownerDocument||s,C=NO(C),(d=pi.get(d))&&dp(C,d),u=u.createElement("link"),ln(u);var v=u;v._p=new Promise(function(y,N){v.onload=y,v.onerror=N}),yn(u,"link",C),a.instance=u}g.stylesheets===null&&(g.stylesheets=new Map),g.stylesheets.set(a,s),(s=a.state.preload)&&(a.state.loading&3)===0&&(g.count++,a=Dl.bind(g),s.addEventListener("load",a),s.addEventListener("error",a))}}var hp=0;function Vie(g,s){return g.stylesheets&&g.count===0&&zl(g,g.stylesheets),0hp?50:800)+s);return g.unsuspend=a,function(){g.unsuspend=null,clearTimeout(C),clearTimeout(d)}}:null}function Dl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)zl(this,this.stylesheets);else if(this.unsuspend){var g=this.unsuspend;this.unsuspend=null,g()}}}var Ml=null;function zl(g,s){g.stylesheets=null,g.unsuspend!==null&&(g.count++,Ml=new Map,s.forEach(Uie,g),Ml=null,Dl.call(g))}function Uie(g,s){if(!(s.state.loading&4)){var a=Ml.get(g);if(a)var C=a.get(null);else{a=new Map,Ml.set(g,a);for(var d=g.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),Gl.exports=nN(),Gl.exports}var gN=iN(),kp;function $(n,e,t){function i(I,l){if(I._zod||Object.defineProperty(I,"_zod",{value:{def:l,constr:A,traits:new Set},enumerable:!1}),I._zod.traits.has(n))return;I._zod.traits.add(n),e(I,l);const c=A.prototype,h=Object.keys(c);for(let p=0;pt?.Parent&&I instanceof t.Parent?!0:I?._zod?.traits?.has(n)}),Object.defineProperty(A,"name",{value:n}),A}class ss extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Rp extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(kp=globalThis).__zod_globalConfig??(kp.__zod_globalConfig={});const Kl=globalThis.__zod_globalConfig;function Ki(n){return Kl}function _p(n){const e=Object.values(n).filter(i=>typeof i=="number");return Object.entries(n).filter(([i,o])=>e.indexOf(+i)===-1).map(([i,o])=>o)}function Wl(n,e){return typeof e=="bigint"?e.toString():e}function BA(n){return{get value(){{const e=n();return Object.defineProperty(this,"value",{value:e}),e}}}}function Ql(n){return n==null}function Xl(n){const e=n.startsWith("^")?1:0,t=n.endsWith("$")?n.length-1:n.length;return n.slice(e,t)}function oN(n,e){const t=n/e,i=Math.round(t),o=Number.EPSILON*Math.max(Math.abs(t),1);return Math.abs(t-i){};function _r(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const rN=BA(()=>{if(Kl.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const n=Function;return new n(""),!0}catch{return!1}});function rs(n){if(_r(n)===!1)return!1;const e=n.constructor;if(e===void 0||typeof e!="function")return!0;const t=e.prototype;return!(_r(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function Pp(n){return rs(n)?{...n}:Array.isArray(n)?[...n]:n instanceof Map?new Map(n):n instanceof Set?new Set(n):n}const aN=new Set(["string","number","symbol"]);function as(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Sg(n,e,t){const i=new n._zod.constr(e??n._zod.def);return(!e||t?.parent)&&(i._zod.parent=n),i}function ye(n){const e=n;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function AN(n){return Object.keys(n).filter(e=>n[e]._zod.optin==="optional"&&n[e]._zod.optout==="optional")}const CN={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function IN(n,e){const t=n._zod.def,i=t.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const r=xg(n._zod.def,{get shape(){const A={};for(const I in e){if(!(I in t.shape))throw new Error(`Unrecognized key: "${I}"`);e[I]&&(A[I]=t.shape[I])}return po(this,"shape",A),A},checks:[]});return Sg(n,r)}function lN(n,e){const t=n._zod.def,i=t.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const r=xg(n._zod.def,{get shape(){const A={...n._zod.def.shape};for(const I in e){if(!(I in t.shape))throw new Error(`Unrecognized key: "${I}"`);e[I]&&delete A[I]}return po(this,"shape",A),A},checks:[]});return Sg(n,r)}function cN(n,e){if(!rs(e))throw new Error("Invalid input to extend: expected a plain object");const t=n._zod.def.checks;if(t&&t.length>0){const r=n._zod.def.shape;for(const A in e)if(Object.getOwnPropertyDescriptor(r,A)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=xg(n._zod.def,{get shape(){const r={...n._zod.def.shape,...e};return po(this,"shape",r),r}});return Sg(n,o)}function dN(n,e){if(!rs(e))throw new Error("Invalid input to safeExtend: expected a plain object");const t=xg(n._zod.def,{get shape(){const i={...n._zod.def.shape,...e};return po(this,"shape",i),i}});return Sg(n,t)}function uN(n,e){if(n._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const t=xg(n._zod.def,{get shape(){const i={...n._zod.def.shape,...e._zod.def.shape};return po(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Sg(n,t)}function hN(n,e,t){const o=e._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const A=xg(e._zod.def,{get shape(){const I=e._zod.def.shape,l={...I};if(t)for(const c in t){if(!(c in I))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(l[c]=n?new n({type:"optional",innerType:I[c]}):I[c])}else for(const c in I)l[c]=n?new n({type:"optional",innerType:I[c]}):I[c];return po(this,"shape",l),l},checks:[]});return Sg(e,A)}function fN(n,e,t){const i=xg(e._zod.def,{get shape(){const o=e._zod.def.shape,r={...o};if(t)for(const A in t){if(!(A in r))throw new Error(`Unrecognized key: "${A}"`);t[A]&&(r[A]=new n({type:"nonoptional",innerType:o[A]}))}else for(const A in o)r[A]=new n({type:"nonoptional",innerType:o[A]});return po(this,"shape",r),r}});return Sg(e,i)}function As(n,e=0){if(n.aborted===!0)return!0;for(let t=e;t{var i;return(i=t).path??(i.path=[]),t.path.unshift(n),t})}function PA(n){return typeof n=="string"?n:n?.message}function Wi(n,e,t){const i=n.message?n.message:PA(n.inst?._zod.def?.error?.(n))??PA(e?.error?.(n))??PA(t.customError?.(n))??PA(t.localeError?.(n))??"Invalid input",{inst:o,continue:r,input:A,...I}=n;return I.path??(I.path=[]),I.message=i,e?.reportInput&&(I.input=A),I}function $l(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function jr(...n){const[e,t,i]=n;return typeof e=="string"?{message:e,code:"custom",input:t,inst:i}:{...e}}const Lp=(n,e)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:e,enumerable:!1}),n.message=JSON.stringify(e,Wl,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},Gp=$("$ZodError",Lp),Fp=$("$ZodError",Lp,{Parent:Error});function mN(n,e=t=>t.message){const t={},i=[];for(const o of n.issues)o.path.length>0?(t[o.path[0]]=t[o.path[0]]||[],t[o.path[0]].push(e(o))):i.push(e(o));return{formErrors:i,fieldErrors:t}}function vN(n,e=t=>t.message){const t={_errors:[]},i=(o,r=[])=>{for(const A of o.issues)if(A.code==="invalid_union"&&A.errors.length)A.errors.map(I=>i({issues:I},[...r,...A.path]));else if(A.code==="invalid_key")i({issues:A.issues},[...r,...A.path]);else if(A.code==="invalid_element")i({issues:A.issues},[...r,...A.path]);else{const I=[...r,...A.path];if(I.length===0)t._errors.push(e(A));else{let l=t,c=0;for(;c(e,t,i,o)=>{const r=i?{...i,async:!1}:{async:!1},A=e._zod.run({value:t,issues:[]},r);if(A instanceof Promise)throw new ss;if(A.issues.length){const I=new(o?.Err??n)(A.issues.map(l=>Wi(l,r,Ki())));throw Bp(I,o?.callee),I}return A.value},Jl=n=>async(e,t,i,o)=>{const r=i?{...i,async:!0}:{async:!0};let A=e._zod.run({value:t,issues:[]},r);if(A instanceof Promise&&(A=await A),A.issues.length){const I=new(o?.Err??n)(A.issues.map(l=>Wi(l,r,Ki())));throw Bp(I,o?.callee),I}return A.value},LA=n=>(e,t,i)=>{const o=i?{...i,async:!1}:{async:!1},r=e._zod.run({value:t,issues:[]},o);if(r instanceof Promise)throw new ss;return r.issues.length?{success:!1,error:new(n??Gp)(r.issues.map(A=>Wi(A,o,Ki())))}:{success:!0,data:r.value}},bN=LA(Fp),GA=n=>async(e,t,i)=>{const o=i?{...i,async:!0}:{async:!0};let r=e._zod.run({value:t,issues:[]},o);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new n(r.issues.map(A=>Wi(A,o,Ki())))}:{success:!0,data:r.value}},yN=GA(Fp),wN=n=>(e,t,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return ql(n)(e,t,o)},xN=n=>(e,t,i)=>ql(n)(e,t,i),SN=n=>async(e,t,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return Jl(n)(e,t,o)},EN=n=>async(e,t,i)=>Jl(n)(e,t,i),TN=n=>(e,t,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return LA(n)(e,t,o)},ON=n=>(e,t,i)=>LA(n)(e,t,i),NN=n=>async(e,t,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return GA(n)(e,t,o)},DN=n=>async(e,t,i)=>GA(n)(e,t,i),MN=/^[cC][0-9a-z]{6,}$/,zN=/^[0-9a-z]+$/,kN=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,RN=/^[0-9a-vA-V]{20}$/,_N=/^[A-Za-z0-9]{27}$/,jN=/^[a-zA-Z0-9_-]{21}$/,ZN=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,BN=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Vp=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,PN=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,LN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function GN(){return new RegExp(LN,"u")}const FN=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,VN=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,UN=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,YN=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,HN=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Up=/^[A-Za-z0-9_-]*$/,KN=/^https?$/,WN=/^\+[1-9]\d{6,14}$/,Yp="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",QN=new RegExp(`^${Yp}$`);function Hp(n){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${e}`:n.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${n.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function XN(n){return new RegExp(`^${Hp(n)}$`)}function $N(n){const e=Hp({precision:n.precision}),t=["Z"];n.local&&t.push(""),n.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${e}(?:${t.join("|")})`;return new RegExp(`^${Yp}T(?:${i})$`)}const qN=n=>{const e=n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},JN=/^-?\d+$/,Kp=/^-?\d+(?:\.\d+)?$/,eD=/^(?:true|false)$/i,tD=/^[^A-Z]*$/,nD=/^[^a-z]*$/,kn=$("$ZodCheck",(n,e)=>{var t;n._zod??(n._zod={}),n._zod.def=e,(t=n._zod).onattach??(t.onattach=[])}),Wp={number:"number",bigint:"bigint",object:"date"},Qp=$("$ZodCheckLessThan",(n,e)=>{kn.init(n,e);const t=Wp[typeof e.value];n._zod.onattach.push(i=>{const o=i._zod.bag,r=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?i.value<=e.value:i.value{kn.init(n,e);const t=Wp[typeof e.value];n._zod.onattach.push(i=>{const o=i._zod.bag,r=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>r&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),n._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:t,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:n,continue:!e.abort})}}),iD=$("$ZodCheckMultipleOf",(n,e)=>{kn.init(n,e),n._zod.onattach.push(t=>{var i;(i=t._zod.bag).multipleOf??(i.multipleOf=e.value)}),n._zod.check=t=>{if(typeof t.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof t.value=="bigint"?t.value%e.value===BigInt(0):oN(t.value,e.value)===0)||t.issues.push({origin:typeof t.value,code:"not_multiple_of",divisor:e.value,input:t.value,inst:n,continue:!e.abort})}}),gD=$("$ZodCheckNumberFormat",(n,e)=>{kn.init(n,e),e.format=e.format||"float64";const t=e.format?.includes("int"),i=t?"int":"number",[o,r]=CN[e.format];n._zod.onattach.push(A=>{const I=A._zod.bag;I.format=e.format,I.minimum=o,I.maximum=r,t&&(I.pattern=JN)}),n._zod.check=A=>{const I=A.value;if(t){if(!Number.isInteger(I)){A.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:I,inst:n});return}if(!Number.isSafeInteger(I)){I>0?A.issues.push({input:I,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:i,inclusive:!0,continue:!e.abort}):A.issues.push({input:I,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:i,inclusive:!0,continue:!e.abort});return}}Ir&&A.issues.push({origin:"number",input:I,code:"too_big",maximum:r,inclusive:!0,inst:n,continue:!e.abort})}}),oD=$("$ZodCheckMaxLength",(n,e)=>{var t;kn.init(n,e),(t=n._zod.def).when??(t.when=i=>{const o=i.value;return!Ql(o)&&o.length!==void 0}),n._zod.onattach.push(i=>{const o=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{const o=i.value;if(o.length<=e.maximum)return;const A=$l(o);i.issues.push({origin:A,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:n,continue:!e.abort})}}),sD=$("$ZodCheckMinLength",(n,e)=>{var t;kn.init(n,e),(t=n._zod.def).when??(t.when=i=>{const o=i.value;return!Ql(o)&&o.length!==void 0}),n._zod.onattach.push(i=>{const o=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(i._zod.bag.minimum=e.minimum)}),n._zod.check=i=>{const o=i.value;if(o.length>=e.minimum)return;const A=$l(o);i.issues.push({origin:A,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:n,continue:!e.abort})}}),rD=$("$ZodCheckLengthEquals",(n,e)=>{var t;kn.init(n,e),(t=n._zod.def).when??(t.when=i=>{const o=i.value;return!Ql(o)&&o.length!==void 0}),n._zod.onattach.push(i=>{const o=i._zod.bag;o.minimum=e.length,o.maximum=e.length,o.length=e.length}),n._zod.check=i=>{const o=i.value,r=o.length;if(r===e.length)return;const A=$l(o),I=r>e.length;i.issues.push({origin:A,...I?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:n,continue:!e.abort})}}),FA=$("$ZodCheckStringFormat",(n,e)=>{var t,i;kn.init(n,e),n._zod.onattach.push(o=>{const r=o._zod.bag;r.format=e.format,e.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(e.pattern))}),e.pattern?(t=n._zod).check??(t.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:n,continue:!e.abort})}):(i=n._zod).check??(i.check=()=>{})}),aD=$("$ZodCheckRegex",(n,e)=>{FA.init(n,e),n._zod.check=t=>{e.pattern.lastIndex=0,!e.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:e.pattern.toString(),inst:n,continue:!e.abort})}}),AD=$("$ZodCheckLowerCase",(n,e)=>{e.pattern??(e.pattern=tD),FA.init(n,e)}),CD=$("$ZodCheckUpperCase",(n,e)=>{e.pattern??(e.pattern=nD),FA.init(n,e)}),ID=$("$ZodCheckIncludes",(n,e)=>{kn.init(n,e);const t=as(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${t}`:t);e.pattern=i,n._zod.onattach.push(o=>{const r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(i)}),n._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:n,continue:!e.abort})}}),lD=$("$ZodCheckStartsWith",(n,e)=>{kn.init(n,e);const t=new RegExp(`^${as(e.prefix)}.*`);e.pattern??(e.pattern=t),n._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(t)}),n._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:n,continue:!e.abort})}}),cD=$("$ZodCheckEndsWith",(n,e)=>{kn.init(n,e);const t=new RegExp(`.*${as(e.suffix)}$`);e.pattern??(e.pattern=t),n._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(t)}),n._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:n,continue:!e.abort})}}),dD=$("$ZodCheckOverwrite",(n,e)=>{kn.init(n,e),n._zod.check=t=>{t.value=e.tx(t.value)}});class uD{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const i=e.split(` +`+C.stack}}var Me=Object.prototype.hasOwnProperty,ke=n.unstable_scheduleCallback,Lt=n.unstable_cancelCallback,En=n.unstable_shouldYield,Y=n.unstable_requestPaint,Ae=n.unstable_now,Xe=n.unstable_getCurrentPriorityLevel,Et=n.unstable_ImmediatePriority,wt=n.unstable_UserBlockingPriority,Mn=n.unstable_NormalPriority,EI=n.unstable_LowPriority,iE=n.unstable_IdlePriority,fne=n.log,pne=n.unstable_setDisableYieldValue,Ha=null,Kn=null;function Hg(g){if(typeof fne=="function"&&pne(g),Kn&&typeof Kn.setStrictMode=="function")try{Kn.setStrictMode(Ha,g)}catch{}}var Wn=Math.clz32?Math.clz32:bne,mne=Math.log,vne=Math.LN2;function bne(g){return g>>>=0,g===0?32:31-(mne(g)/vne|0)|0}var SI=256,TI=262144,OI=4194304;function Vo(g){var s=g&42;if(s!==0)return s;switch(g&-g){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 g&261888;case 262144:case 524288:case 1048576:case 2097152:return g&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return g&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return g}}function NI(g,s,a){var C=g.pendingLanes;if(C===0)return 0;var d=0,u=g.suspendedLanes,v=g.pingedLanes;g=g.warmLanes;var y=C&134217727;return y!==0?(C=y&~u,C!==0?d=Vo(C):(v&=y,v!==0?d=Vo(v):a||(a=y&~g,a!==0&&(d=Vo(a))))):(y=C&~u,y!==0?d=Vo(y):v!==0?d=Vo(v):a||(a=C&~g,a!==0&&(d=Vo(a)))),d===0?0:s!==0&&s!==d&&(s&u)===0&&(u=d&-d,a=s&-s,u>=a||u===32&&(a&4194048)!==0)?s:d}function Ka(g,s){return(g.pendingLanes&~(g.suspendedLanes&~g.pingedLanes)&s)===0}function yne(g,s){switch(g){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 gE(){var g=OI;return OI<<=1,(OI&62914560)===0&&(OI=4194304),g}function Ih(g){for(var s=[],a=0;31>a;a++)s.push(g);return s}function Wa(g,s){g.pendingLanes|=s,s!==268435456&&(g.suspendedLanes=0,g.pingedLanes=0,g.warmLanes=0)}function wne(g,s,a,C,d,u){var v=g.pendingLanes;g.pendingLanes=a,g.suspendedLanes=0,g.pingedLanes=0,g.warmLanes=0,g.expiredLanes&=a,g.entangledLanes&=a,g.errorRecoveryDisabledLanes&=a,g.shellSuspendCounter=0;var y=g.entanglements,N=g.expirationTimes,P=g.hiddenUpdates;for(a=v&~a;0"u")return null;try{return g.activeElement||g.body}catch{return g.body}}var Nne=/[\n"\\]/g;function Ci(g){return g.replace(Nne,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function fh(g,s,a,C,d,u,v,y){g.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?g.type=v:g.removeAttribute("type"),s!=null?v==="number"?(s===0&&g.value===""||g.value!=s)&&(g.value=""+Ai(s)):g.value!==""+Ai(s)&&(g.value=""+Ai(s)):v!=="submit"&&v!=="reset"||g.removeAttribute("value"),s!=null?ph(g,v,Ai(s)):a!=null?ph(g,v,Ai(a)):C!=null&&g.removeAttribute("value"),d==null&&u!=null&&(g.defaultChecked=!!u),d!=null&&(g.checked=d&&typeof d!="function"&&typeof d!="symbol"),y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?g.name=""+Ai(y):g.removeAttribute("name")}function fE(g,s,a,C,d,u,v,y){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(g.type=u),s!=null||a!=null){if(!(u!=="submit"&&u!=="reset"||s!=null)){hh(g);return}a=a!=null?""+Ai(a):"",s=s!=null?""+Ai(s):a,y||s===g.value||(g.value=s),g.defaultValue=s}C=C??d,C=typeof C!="function"&&typeof C!="symbol"&&!!C,g.checked=y?g.checked:!!C,g.defaultChecked=!!C,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(g.name=v),hh(g)}function ph(g,s,a){s==="number"&&RI(g.ownerDocument)===g||g.defaultValue===""+a||(g.defaultValue=""+a)}function er(g,s,a,C){if(g=g.options,s){s={};for(var d=0;d"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wh=!1;if(ag)try{var qa={};Object.defineProperty(qa,"passive",{get:function(){wh=!0}}),window.addEventListener("test",qa,qa),window.removeEventListener("test",qa,qa)}catch{wh=!1}var Wg=null,xh=null,kI=null;function xE(){if(kI)return kI;var g,s=xh,a=s.length,C,d="value"in Wg?Wg.value:Wg.textContent,u=d.length;for(g=0;g=tA),DE=" ",ME=!1;function RE(g,s){switch(g){case"keyup":return iie.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zE(g){return g=g.detail,typeof g=="object"&&"data"in g?g.data:null}var gr=!1;function oie(g,s){switch(g){case"compositionend":return zE(s);case"keypress":return s.which!==32?null:(ME=!0,DE);case"textInput":return g=s.data,g===DE&&ME?null:g;default:return null}}function sie(g,s){if(gr)return g==="compositionend"||!Nh&&RE(g,s)?(g=xE(),kI=xh=Wg=null,gr=!1,g):null;switch(g){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:a,offset:s-g};g=C}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=GE(a)}}function VE(g,s){return g&&s?g===s?!0:g&&g.nodeType===3?!1:s&&s.nodeType===3?VE(g,s.parentNode):"contains"in g?g.contains(s):g.compareDocumentPosition?!!(g.compareDocumentPosition(s)&16):!1:!1}function UE(g){g=g!=null&&g.ownerDocument!=null&&g.ownerDocument.defaultView!=null?g.ownerDocument.defaultView:window;for(var s=RI(g.document);s instanceof g.HTMLIFrameElement;){try{var a=typeof s.contentWindow.location.href=="string"}catch{a=!1}if(a)g=s.contentWindow;else break;s=RI(g.document)}return s}function Rh(g){var s=g&&g.nodeName&&g.nodeName.toLowerCase();return s&&(s==="input"&&(g.type==="text"||g.type==="search"||g.type==="tel"||g.type==="url"||g.type==="password")||s==="textarea"||g.contentEditable==="true")}var die=ag&&"documentMode"in document&&11>=document.documentMode,or=null,zh=null,oA=null,kh=!1;function YE(g,s,a){var C=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;kh||or==null||or!==RI(C)||(C=or,"selectionStart"in C&&Rh(C)?C={start:C.selectionStart,end:C.selectionEnd}:(C=(C.ownerDocument&&C.ownerDocument.defaultView||window).getSelection(),C={anchorNode:C.anchorNode,anchorOffset:C.anchorOffset,focusNode:C.focusNode,focusOffset:C.focusOffset}),oA&&gA(oA,C)||(oA=C,C=Tl(zh,"onSelect"),0>=v,d-=v,Vi=1<<32-Wn(s)+d|a<Ve?(qe=be,be=null):qe=be.sibling;var gt=L(k,be,Z[Ve],J);if(gt===null){be===null&&(be=qe);break}g&&be&>.alternate===null&&s(k,be),D=u(gt,D,Ve),it===null?Se=gt:it.sibling=gt,it=gt,be=qe}if(Ve===Z.length)return a(k,be),et&&Cg(k,Ve),Se;if(be===null){for(;VeVe?(qe=be,be=null):qe=be.sibling;var fo=L(k,be,gt.value,J);if(fo===null){be===null&&(be=qe);break}g&&be&&fo.alternate===null&&s(k,be),D=u(fo,D,Ve),it===null?Se=fo:it.sibling=fo,it=fo,be=qe}if(gt.done)return a(k,be),et&&Cg(k,Ve),Se;if(be===null){for(;!gt.done;Ve++,gt=Z.next())gt=te(k,gt.value,J),gt!==null&&(D=u(gt,D,Ve),it===null?Se=gt:it.sibling=gt,it=gt);return et&&Cg(k,Ve),Se}for(be=C(be);!gt.done;Ve++,gt=Z.next())gt=H(be,k,Ve,gt.value,J),gt!==null&&(g&>.alternate!==null&&be.delete(gt.key===null?Ve:gt.key),D=u(gt,D,Ve),it===null?Se=gt:it.sibling=gt,it=gt);return g&&be.forEach(function(kge){return s(k,kge)}),et&&Cg(k,Ve),Se}function pt(k,D,Z,J){if(typeof Z=="object"&&Z!==null&&Z.type===O&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:e:{for(var Se=Z.key;D!==null;){if(D.key===Se){if(Se=Z.type,Se===O){if(D.tag===7){a(k,D.sibling),J=d(D,Z.props.children),J.return=k,k=J;break e}}else if(D.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===V&&es(Se)===D.type){a(k,D.sibling),J=d(D,Z.props),IA(J,Z),J.return=k,k=J;break e}a(k,D);break}else s(k,D);D=D.sibling}Z.type===O?(J=Qo(Z.props.children,k.mode,J,Z.key),J.return=k,k=J):(J=UI(Z.type,Z.key,Z.props,null,k.mode,J),IA(J,Z),J.return=k,k=J)}return v(k);case w:e:{for(Se=Z.key;D!==null;){if(D.key===Se)if(D.tag===4&&D.stateNode.containerInfo===Z.containerInfo&&D.stateNode.implementation===Z.implementation){a(k,D.sibling),J=d(D,Z.children||[]),J.return=k,k=J;break e}else{a(k,D);break}else s(k,D);D=D.sibling}J=Gh(Z,k.mode,J),J.return=k,k=J}return v(k);case V:return Z=es(Z),pt(k,D,Z,J)}if(le(Z))return pe(k,D,Z,J);if(xe(Z)){if(Se=xe(Z),typeof Se!="function")throw Error(i(150));return Z=Se.call(Z),Re(k,D,Z,J)}if(typeof Z.then=="function")return pt(k,D,$I(Z),J);if(Z.$$typeof===_)return pt(k,D,KI(k,Z),J);qI(k,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,D!==null&&D.tag===6?(a(k,D.sibling),J=d(D,Z),J.return=k,k=J):(a(k,D),J=Lh(Z,k.mode,J),J.return=k,k=J),v(k)):a(k,D)}return function(k,D,Z,J){try{CA=0;var Se=pt(k,D,Z,J);return hr=null,Se}catch(be){if(be===ur||be===QI)throw be;var it=Xn(29,be,null,k.mode);return it.lanes=J,it.return=k,it}}}var ns=dS(!0),uS=dS(!1),Jg=!1;function Jh(g){g.updateQueue={baseState:g.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ef(g,s){g=g.updateQueue,s.updateQueue===g&&(s.updateQueue={baseState:g.baseState,firstBaseUpdate:g.firstBaseUpdate,lastBaseUpdate:g.lastBaseUpdate,shared:g.shared,callbacks:null})}function eo(g){return{lane:g,tag:0,payload:null,callback:null,next:null}}function to(g,s,a){var C=g.updateQueue;if(C===null)return null;if(C=C.shared,(rt&2)!==0){var d=C.pending;return d===null?s.next=s:(s.next=d.next,d.next=s),C.pending=s,s=VI(g),qE(g,null,a),s}return FI(g,C,s,a),VI(g)}function lA(g,s,a){if(s=s.updateQueue,s!==null&&(s=s.shared,(a&4194048)!==0)){var C=s.lanes;C&=g.pendingLanes,a|=C,s.lanes=a,sE(g,a)}}function tf(g,s){var a=g.updateQueue,C=g.alternate;if(C!==null&&(C=C.updateQueue,a===C)){var d=null,u=null;if(a=a.firstBaseUpdate,a!==null){do{var v={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};u===null?d=u=v:u=u.next=v,a=a.next}while(a!==null);u===null?d=u=s:u=u.next=s}else d=u=s;a={baseState:C.baseState,firstBaseUpdate:d,lastBaseUpdate:u,shared:C.shared,callbacks:C.callbacks},g.updateQueue=a;return}g=a.lastBaseUpdate,g===null?a.firstBaseUpdate=s:g.next=s,a.lastBaseUpdate=s}var nf=!1;function cA(){if(nf){var g=dr;if(g!==null)throw g}}function dA(g,s,a,C){nf=!1;var d=g.updateQueue;Jg=!1;var u=d.firstBaseUpdate,v=d.lastBaseUpdate,y=d.shared.pending;if(y!==null){d.shared.pending=null;var N=y,P=N.next;N.next=null,v===null?u=P:v.next=P,v=N;var $=g.alternate;$!==null&&($=$.updateQueue,y=$.lastBaseUpdate,y!==v&&(y===null?$.firstBaseUpdate=P:y.next=P,$.lastBaseUpdate=N))}if(u!==null){var te=d.baseState;v=0,$=P=N=null,y=u;do{var L=y.lane&-536870913,H=L!==y.lane;if(H?($e&L)===L:(C&L)===L){L!==0&&L===cr&&(nf=!0),$!==null&&($=$.next={lane:0,tag:y.tag,payload:y.payload,callback:null,next:null});e:{var pe=g,Re=y;L=s;var pt=a;switch(Re.tag){case 1:if(pe=Re.payload,typeof pe=="function"){te=pe.call(pt,te,L);break e}te=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=Re.payload,L=typeof pe=="function"?pe.call(pt,te,L):pe,L==null)break e;te=p({},te,L);break e;case 2:Jg=!0}}L=y.callback,L!==null&&(g.flags|=64,H&&(g.flags|=8192),H=d.callbacks,H===null?d.callbacks=[L]:H.push(L))}else H={lane:L,tag:y.tag,payload:y.payload,callback:y.callback,next:null},$===null?(P=$=H,N=te):$=$.next=H,v|=L;if(y=y.next,y===null){if(y=d.shared.pending,y===null)break;H=y,y=H.next,H.next=null,d.lastBaseUpdate=H,d.shared.pending=null}}while(!0);$===null&&(N=te),d.baseState=N,d.firstBaseUpdate=P,d.lastBaseUpdate=$,u===null&&(d.shared.lanes=0),so|=v,g.lanes=v,g.memoizedState=te}}function hS(g,s){if(typeof g!="function")throw Error(i(191,g));g.call(s)}function fS(g,s){var a=g.callbacks;if(a!==null)for(g.callbacks=null,g=0;gu?u:8;var v=M.T,y={};M.T=y,yf(g,!1,s,a);try{var N=d(),P=M.S;if(P!==null&&P(y,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var $=wie(N,C);fA(g,s,$,ti(g))}else fA(g,s,C,ti(g))}catch(te){fA(g,s,{then:function(){},status:"rejected",reason:te},ti())}finally{Q.p=u,v!==null&&y.types!==null&&(v.types=y.types),M.T=v}}function Nie(){}function vf(g,s,a,C){if(g.tag!==5)throw Error(i(476));var d=QS(g).queue;WS(g,d,s,W,a===null?Nie:function(){return XS(g),a(C)})}function QS(g){var s=g.memoizedState;if(s!==null)return s;s={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dg,lastRenderedState:W},next:null};var a={};return s.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dg,lastRenderedState:a},next:null},g.memoizedState=s,g=g.alternate,g!==null&&(g.memoizedState=s),s}function XS(g){var s=QS(g);s.next===null&&(s=g.alternate.memoizedState),fA(g,s.next.queue,{},ti())}function bf(){return vn(kA)}function $S(){return Wt().memoizedState}function qS(){return Wt().memoizedState}function Die(g){for(var s=g.return;s!==null;){switch(s.tag){case 24:case 3:var a=ti();g=eo(a);var C=to(s,g,a);C!==null&&(Un(C,s,a),lA(C,s,a)),s={cache:Qh()},g.payload=s;return}s=s.return}}function Mie(g,s,a){var C=ti();a={lane:C,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},al(g)?eT(s,a):(a=Ph(g,s,a,C),a!==null&&(Un(a,g,C),tT(a,s,C)))}function JS(g,s,a){var C=ti();fA(g,s,a,C)}function fA(g,s,a,C){var d={lane:C,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(al(g))eT(s,d);else{var u=g.alternate;if(g.lanes===0&&(u===null||u.lanes===0)&&(u=s.lastRenderedReducer,u!==null))try{var v=s.lastRenderedState,y=u(v,a);if(d.hasEagerState=!0,d.eagerState=y,Qn(y,v))return FI(g,s,d,0),mt===null&&GI(),!1}catch{}if(a=Ph(g,s,d,C),a!==null)return Un(a,g,C),tT(a,s,C),!0}return!1}function yf(g,s,a,C){if(C={lane:2,revertLane:ep(),gesture:null,action:C,hasEagerState:!1,eagerState:null,next:null},al(g)){if(s)throw Error(i(479))}else s=Ph(g,a,C,2),s!==null&&Un(s,g,2)}function al(g){var s=g.alternate;return g===Le||s!==null&&s===Le}function eT(g,s){pr=tl=!0;var a=g.pending;a===null?s.next=s:(s.next=a.next,a.next=s),g.pending=s}function tT(g,s,a){if((a&4194048)!==0){var C=s.lanes;C&=g.pendingLanes,a|=C,s.lanes=a,sE(g,a)}}var pA={readContext:vn,use:gl,useCallback:Gt,useContext:Gt,useEffect:Gt,useImperativeHandle:Gt,useLayoutEffect:Gt,useInsertionEffect:Gt,useMemo:Gt,useReducer:Gt,useRef:Gt,useState:Gt,useDebugValue:Gt,useDeferredValue:Gt,useTransition:Gt,useSyncExternalStore:Gt,useId:Gt,useHostTransitionStatus:Gt,useFormState:Gt,useActionState:Gt,useOptimistic:Gt,useMemoCache:Gt,useCacheRefresh:Gt};pA.useEffectEvent=Gt;var nT={readContext:vn,use:gl,useCallback:function(g,s){return Rn().memoizedState=[g,s===void 0?null:s],g},useContext:vn,useEffect:BS,useImperativeHandle:function(g,s,a){a=a!=null?a.concat([g]):null,sl(4194308,4,VS.bind(null,s,g),a)},useLayoutEffect:function(g,s){return sl(4194308,4,g,s)},useInsertionEffect:function(g,s){sl(4,2,g,s)},useMemo:function(g,s){var a=Rn();s=s===void 0?null:s;var C=g();if(is){Hg(!0);try{g()}finally{Hg(!1)}}return a.memoizedState=[C,s],C},useReducer:function(g,s,a){var C=Rn();if(a!==void 0){var d=a(s);if(is){Hg(!0);try{a(s)}finally{Hg(!1)}}}else d=s;return C.memoizedState=C.baseState=d,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:g,lastRenderedState:d},C.queue=g,g=g.dispatch=Mie.bind(null,Le,g),[C.memoizedState,g]},useRef:function(g){var s=Rn();return g={current:g},s.memoizedState=g},useState:function(g){g=uf(g);var s=g.queue,a=JS.bind(null,Le,s);return s.dispatch=a,[g.memoizedState,a]},useDebugValue:pf,useDeferredValue:function(g,s){var a=Rn();return mf(a,g,s)},useTransition:function(){var g=uf(!1);return g=WS.bind(null,Le,g.queue,!0,!1),Rn().memoizedState=g,[!1,g]},useSyncExternalStore:function(g,s,a){var C=Le,d=Rn();if(et){if(a===void 0)throw Error(i(407));a=a()}else{if(a=s(),mt===null)throw Error(i(349));($e&127)!==0||wS(C,s,a)}d.memoizedState=a;var u={value:a,getSnapshot:s};return d.queue=u,BS(ES.bind(null,C,u,g),[g]),C.flags|=2048,vr(9,{destroy:void 0},xS.bind(null,C,u,a,s),null),a},useId:function(){var g=Rn(),s=mt.identifierPrefix;if(et){var a=Ui,C=Vi;a=(C&~(1<<32-Wn(C)-1)).toString(32)+a,s="_"+s+"R_"+a,a=nl++,0<\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof C.is=="string"?v.createElement("select",{is:C.is}):v.createElement("select"),C.multiple?u.multiple=!0:C.size&&(u.size=C.size);break;default:u=typeof C.is=="string"?v.createElement(d,{is:C.is}):v.createElement(d)}}u[pn]=s,u[Pn]=C;e:for(v=s.child;v!==null;){if(v.tag===5||v.tag===6)u.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===s)break e;for(;v.sibling===null;){if(v.return===null||v.return===s)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}s.stateNode=u;e:switch(yn(u,d,C),d){case"button":case"input":case"select":case"textarea":C=!!C.autoFocus;break e;case"img":C=!0;break e;default:C=!1}C&&hg(s)}}return Tt(s),jf(s,s.type,g===null?null:g.memoizedProps,s.pendingProps,a),null;case 6:if(g&&s.stateNode!=null)g.memoizedProps!==C&&hg(s);else{if(typeof C!="string"&&s.stateNode===null)throw Error(i(166));if(g=me.current,Ir(s)){if(g=s.stateNode,a=s.memoizedProps,C=null,d=mn,d!==null)switch(d.tag){case 27:case 5:C=d.memoizedProps}g[pn]=s,g=!!(g.nodeValue===a||C!==null&&C.suppressHydrationWarning===!0||bO(g.nodeValue,a)),g||$g(s,!0)}else g=Ol(g).createTextNode(C),g[pn]=s,s.stateNode=g}return Tt(s),null;case 31:if(a=s.memoizedState,g===null||g.memoizedState!==null){if(C=Ir(s),a!==null){if(g===null){if(!C)throw Error(i(318));if(g=s.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(i(557));g[pn]=s}else Xo(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Tt(s),g=!1}else a=Yh(),g!==null&&g.memoizedState!==null&&(g.memoizedState.hydrationErrors=a),g=!0;if(!g)return s.flags&256?(qn(s),s):(qn(s),null);if((s.flags&128)!==0)throw Error(i(558))}return Tt(s),null;case 13:if(C=s.memoizedState,g===null||g.memoizedState!==null&&g.memoizedState.dehydrated!==null){if(d=Ir(s),C!==null&&C.dehydrated!==null){if(g===null){if(!d)throw Error(i(318));if(d=s.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(i(317));d[pn]=s}else Xo(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Tt(s),d=!1}else d=Yh(),g!==null&&g.memoizedState!==null&&(g.memoizedState.hydrationErrors=d),d=!0;if(!d)return s.flags&256?(qn(s),s):(qn(s),null)}return qn(s),(s.flags&128)!==0?(s.lanes=a,s):(a=C!==null,g=g!==null&&g.memoizedState!==null,a&&(C=s.child,d=null,C.alternate!==null&&C.alternate.memoizedState!==null&&C.alternate.memoizedState.cachePool!==null&&(d=C.alternate.memoizedState.cachePool.pool),u=null,C.memoizedState!==null&&C.memoizedState.cachePool!==null&&(u=C.memoizedState.cachePool.pool),u!==d&&(C.flags|=2048)),a!==g&&a&&(s.child.flags|=8192),cl(s,s.updateQueue),Tt(s),null);case 4:return _e(),g===null&&gp(s.stateNode.containerInfo),Tt(s),null;case 10:return lg(s.type),Tt(s),null;case 19:if(U(Kt),C=s.memoizedState,C===null)return Tt(s),null;if(d=(s.flags&128)!==0,u=C.rendering,u===null)if(d)vA(C,!1);else{if(Ft!==0||g!==null&&(g.flags&128)!==0)for(g=s.child;g!==null;){if(u=el(g),u!==null){for(s.flags|=128,vA(C,!1),g=u.updateQueue,s.updateQueue=g,cl(s,g),s.subtreeFlags=0,g=a,a=s.child;a!==null;)JE(a,g),a=a.sibling;return ie(Kt,Kt.current&1|2),et&&Cg(s,C.treeForkCount),s.child}g=g.sibling}C.tail!==null&&Ae()>pl&&(s.flags|=128,d=!0,vA(C,!1),s.lanes=4194304)}else{if(!d)if(g=el(u),g!==null){if(s.flags|=128,d=!0,g=g.updateQueue,s.updateQueue=g,cl(s,g),vA(C,!0),C.tail===null&&C.tailMode==="hidden"&&!u.alternate&&!et)return Tt(s),null}else 2*Ae()-C.renderingStartTime>pl&&a!==536870912&&(s.flags|=128,d=!0,vA(C,!1),s.lanes=4194304);C.isBackwards?(u.sibling=s.child,s.child=u):(g=C.last,g!==null?g.sibling=u:s.child=u,C.last=u)}return C.tail!==null?(g=C.tail,C.rendering=g,C.tail=g.sibling,C.renderingStartTime=Ae(),g.sibling=null,a=Kt.current,ie(Kt,d?a&1|2:a&1),et&&Cg(s,C.treeForkCount),g):(Tt(s),null);case 22:case 23:return qn(s),of(),C=s.memoizedState!==null,g!==null?g.memoizedState!==null!==C&&(s.flags|=8192):C&&(s.flags|=8192),C?(a&536870912)!==0&&(s.flags&128)===0&&(Tt(s),s.subtreeFlags&6&&(s.flags|=8192)):Tt(s),a=s.updateQueue,a!==null&&cl(s,a.retryQueue),a=null,g!==null&&g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(a=g.memoizedState.cachePool.pool),C=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(C=s.memoizedState.cachePool.pool),C!==a&&(s.flags|=2048),g!==null&&U(Jo),null;case 24:return a=null,g!==null&&(a=g.memoizedState.cache),s.memoizedState.cache!==a&&(s.flags|=2048),lg(tn),Tt(s),null;case 25:return null;case 30:return null}throw Error(i(156,s.tag))}function jie(g,s){switch(Vh(s),s.tag){case 1:return g=s.flags,g&65536?(s.flags=g&-65537|128,s):null;case 3:return lg(tn),_e(),g=s.flags,(g&65536)!==0&&(g&128)===0?(s.flags=g&-65537|128,s):null;case 26:case 27:case 5:return fn(s),null;case 31:if(s.memoizedState!==null){if(qn(s),s.alternate===null)throw Error(i(340));Xo()}return g=s.flags,g&65536?(s.flags=g&-65537|128,s):null;case 13:if(qn(s),g=s.memoizedState,g!==null&&g.dehydrated!==null){if(s.alternate===null)throw Error(i(340));Xo()}return g=s.flags,g&65536?(s.flags=g&-65537|128,s):null;case 19:return U(Kt),null;case 4:return _e(),null;case 10:return lg(s.type),null;case 22:case 23:return qn(s),of(),g!==null&&U(Jo),g=s.flags,g&65536?(s.flags=g&-65537|128,s):null;case 24:return lg(tn),null;case 25:return null;default:return null}}function ST(g,s){switch(Vh(s),s.tag){case 3:lg(tn),_e();break;case 26:case 27:case 5:fn(s);break;case 4:_e();break;case 31:s.memoizedState!==null&&qn(s);break;case 13:qn(s);break;case 19:U(Kt);break;case 10:lg(s.type);break;case 22:case 23:qn(s),of(),g!==null&&U(Jo);break;case 24:lg(tn)}}function bA(g,s){try{var a=s.updateQueue,C=a!==null?a.lastEffect:null;if(C!==null){var d=C.next;a=d;do{if((a.tag&g)===g){C=void 0;var u=a.create,v=a.inst;C=u(),v.destroy=C}a=a.next}while(a!==d)}}catch(y){ct(s,s.return,y)}}function go(g,s,a){try{var C=s.updateQueue,d=C!==null?C.lastEffect:null;if(d!==null){var u=d.next;C=u;do{if((C.tag&g)===g){var v=C.inst,y=v.destroy;if(y!==void 0){v.destroy=void 0,d=s;var N=a,P=y;try{P()}catch($){ct(d,N,$)}}}C=C.next}while(C!==u)}}catch($){ct(s,s.return,$)}}function TT(g){var s=g.updateQueue;if(s!==null){var a=g.stateNode;try{fS(s,a)}catch(C){ct(g,g.return,C)}}}function OT(g,s,a){a.props=gs(g.type,g.memoizedProps),a.state=g.memoizedState;try{a.componentWillUnmount()}catch(C){ct(g,s,C)}}function yA(g,s){try{var a=g.ref;if(a!==null){switch(g.tag){case 26:case 27:case 5:var C=g.stateNode;break;case 30:C=g.stateNode;break;default:C=g.stateNode}typeof a=="function"?g.refCleanup=a(C):a.current=C}}catch(d){ct(g,s,d)}}function Yi(g,s){var a=g.ref,C=g.refCleanup;if(a!==null)if(typeof C=="function")try{C()}catch(d){ct(g,s,d)}finally{g.refCleanup=null,g=g.alternate,g!=null&&(g.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(d){ct(g,s,d)}else a.current=null}function NT(g){var s=g.type,a=g.memoizedProps,C=g.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":a.autoFocus&&C.focus();break e;case"img":a.src?C.src=a.src:a.srcSet&&(C.srcset=a.srcSet)}}catch(d){ct(g,g.return,d)}}function Zf(g,s,a){try{var C=g.stateNode;gge(C,g.type,a,s),C[Pn]=s}catch(d){ct(g,g.return,d)}}function DT(g){return g.tag===5||g.tag===3||g.tag===26||g.tag===27&&Io(g.type)||g.tag===4}function Pf(g){e:for(;;){for(;g.sibling===null;){if(g.return===null||DT(g.return))return null;g=g.return}for(g.sibling.return=g.return,g=g.sibling;g.tag!==5&&g.tag!==6&&g.tag!==18;){if(g.tag===27&&Io(g.type)||g.flags&2||g.child===null||g.tag===4)continue e;g.child.return=g,g=g.child}if(!(g.flags&2))return g.stateNode}}function Bf(g,s,a){var C=g.tag;if(C===5||C===6)g=g.stateNode,s?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(g,s):(s=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,s.appendChild(g),a=a._reactRootContainer,a!=null||s.onclick!==null||(s.onclick=rg));else if(C!==4&&(C===27&&Io(g.type)&&(a=g.stateNode,s=null),g=g.child,g!==null))for(Bf(g,s,a),g=g.sibling;g!==null;)Bf(g,s,a),g=g.sibling}function dl(g,s,a){var C=g.tag;if(C===5||C===6)g=g.stateNode,s?a.insertBefore(g,s):a.appendChild(g);else if(C!==4&&(C===27&&Io(g.type)&&(a=g.stateNode),g=g.child,g!==null))for(dl(g,s,a),g=g.sibling;g!==null;)dl(g,s,a),g=g.sibling}function MT(g){var s=g.stateNode,a=g.memoizedProps;try{for(var C=g.type,d=s.attributes;d.length;)s.removeAttributeNode(d[0]);yn(s,C,a),s[pn]=g,s[Pn]=a}catch(u){ct(g,g.return,u)}}var fg=!1,on=!1,Lf=!1,RT=typeof WeakSet=="function"?WeakSet:Set,cn=null;function Zie(g,s){if(g=g.containerInfo,rp=_l,g=UE(g),Rh(g)){if("selectionStart"in g)var a={start:g.selectionStart,end:g.selectionEnd};else e:{a=(a=g.ownerDocument)&&a.defaultView||window;var C=a.getSelection&&a.getSelection();if(C&&C.rangeCount!==0){a=C.anchorNode;var d=C.anchorOffset,u=C.focusNode;C=C.focusOffset;try{a.nodeType,u.nodeType}catch{a=null;break e}var v=0,y=-1,N=-1,P=0,$=0,te=g,L=null;t:for(;;){for(var H;te!==a||d!==0&&te.nodeType!==3||(y=v+d),te!==u||C!==0&&te.nodeType!==3||(N=v+C),te.nodeType===3&&(v+=te.nodeValue.length),(H=te.firstChild)!==null;)L=te,te=H;for(;;){if(te===g)break t;if(L===a&&++P===d&&(y=v),L===u&&++$===C&&(N=v),(H=te.nextSibling)!==null)break;te=L,L=te.parentNode}te=H}a=y===-1||N===-1?null:{start:y,end:N}}else a=null}a=a||{start:0,end:0}}else a=null;for(ap={focusedElem:g,selectionRange:a},_l=!1,cn=s;cn!==null;)if(s=cn,g=s.child,(s.subtreeFlags&1028)!==0&&g!==null)g.return=s,cn=g;else for(;cn!==null;){switch(s=cn,u=s.alternate,g=s.flags,s.tag){case 0:if((g&4)!==0&&(g=s.updateQueue,g=g!==null?g.events:null,g!==null))for(a=0;a title"))),yn(u,C,a),u[pn]=g,ln(u),C=u;break e;case"link":var v=PO("link","href",d).get(C+(a.href||""));if(v){for(var y=0;ypt&&(v=pt,pt=Re,Re=v);var k=FE(y,Re),D=FE(y,pt);if(k&&D&&(H.rangeCount!==1||H.anchorNode!==k.node||H.anchorOffset!==k.offset||H.focusNode!==D.node||H.focusOffset!==D.offset)){var Z=te.createRange();Z.setStart(k.node,k.offset),H.removeAllRanges(),Re>pt?(H.addRange(Z),H.extend(D.node,D.offset)):(Z.setEnd(D.node,D.offset),H.addRange(Z))}}}}for(te=[],H=y;H=H.parentNode;)H.nodeType===1&&te.push({element:H,left:H.scrollLeft,top:H.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;ya?32:a,M.T=null,a=Kf,Kf=null;var u=ao,v=yg;if(An=0,Er=ao=null,yg=0,(rt&6)!==0)throw Error(i(331));var y=rt;if(rt|=4,VT(u.current),LT(u,u.current,v,a),rt=y,OA(0,!1),Kn&&typeof Kn.onPostCommitFiberRoot=="function")try{Kn.onPostCommitFiberRoot(Ha,u)}catch{}return!0}finally{Q.p=d,M.T=C,rO(g,s)}}function AO(g,s,a){s=li(a,s),s=Sf(g.stateNode,s,2),g=to(g,s,2),g!==null&&(Wa(g,2),Hi(g))}function ct(g,s,a){if(g.tag===3)AO(g,g,a);else for(;s!==null;){if(s.tag===3){AO(s,g,a);break}else if(s.tag===1){var C=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof C.componentDidCatch=="function"&&(ro===null||!ro.has(C))){g=li(a,g),a=CT(2),C=to(s,a,2),C!==null&&(IT(a,C,s,g),Wa(C,2),Hi(C));break}}s=s.return}}function $f(g,s,a){var C=g.pingCache;if(C===null){C=g.pingCache=new Lie;var d=new Set;C.set(s,d)}else d=C.get(s),d===void 0&&(d=new Set,C.set(s,d));d.has(a)||(Vf=!0,d.add(a),g=Yie.bind(null,g,s,a),s.then(g,g))}function Yie(g,s,a){var C=g.pingCache;C!==null&&C.delete(s),g.pingedLanes|=g.suspendedLanes&a,g.warmLanes&=~a,mt===g&&($e&a)===a&&(Ft===4||Ft===3&&($e&62914560)===$e&&300>Ae()-fl?(rt&2)===0&&Sr(g,0):Uf|=a,xr===$e&&(xr=0)),Hi(g)}function CO(g,s){s===0&&(s=gE()),g=Wo(g,s),g!==null&&(Wa(g,s),Hi(g))}function Hie(g){var s=g.memoizedState,a=0;s!==null&&(a=s.retryLane),CO(g,a)}function Kie(g,s){var a=0;switch(g.tag){case 31:case 13:var C=g.stateNode,d=g.memoizedState;d!==null&&(a=d.retryLane);break;case 19:C=g.stateNode;break;case 22:C=g.stateNode._retryCache;break;default:throw Error(i(314))}C!==null&&C.delete(s),CO(g,a)}function Wie(g,s){return ke(g,s)}var xl=null,Or=null,qf=!1,El=!1,Jf=!1,Co=0;function Hi(g){g!==Or&&g.next===null&&(Or===null?xl=Or=g:Or=Or.next=g),El=!0,qf||(qf=!0,Xie())}function OA(g,s){if(!Jf&&El){Jf=!0;do for(var a=!1,C=xl;C!==null;){if(g!==0){var d=C.pendingLanes;if(d===0)var u=0;else{var v=C.suspendedLanes,y=C.pingedLanes;u=(1<<31-Wn(42|g)+1)-1,u&=d&~(v&~y),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(a=!0,dO(C,u))}else u=$e,u=NI(C,C===mt?u:0,C.cancelPendingCommit!==null||C.timeoutHandle!==-1),(u&3)===0||Ka(C,u)||(a=!0,dO(C,u));C=C.next}while(a);Jf=!1}}function Qie(){IO()}function IO(){El=qf=!1;var g=0;Co!==0&&sge()&&(g=Co);for(var s=Ae(),a=null,C=xl;C!==null;){var d=C.next,u=lO(C,s);u===0?(C.next=null,a===null?xl=d:a.next=d,d===null&&(Or=a)):(a=C,(g!==0||(u&3)!==0)&&(El=!0)),C=d}An!==0&&An!==5||OA(g),Co!==0&&(Co=0)}function lO(g,s){for(var a=g.suspendedLanes,C=g.pingedLanes,d=g.expirationTimes,u=g.pendingLanes&-62914561;0y)break;var $=N.transferSize,te=N.initiatorType;$&&yO(te)&&(N=N.responseEnd,v+=$*(N"u"?null:document;function kO(g,s,a){var C=Nr;if(C&&typeof s=="string"&&s){var d=Ci(s);d='link[rel="'+g+'"][href="'+d+'"]',typeof a=="string"&&(d+='[crossorigin="'+a+'"]'),zO.has(d)||(zO.add(d),g={rel:g,crossOrigin:a,href:s},C.querySelector(d)===null&&(s=C.createElement("link"),yn(s,"link",g),ln(s),C.head.appendChild(s)))}}function uge(g){wg.D(g),kO("dns-prefetch",g,null)}function hge(g,s){wg.C(g,s),kO("preconnect",g,s)}function fge(g,s,a){wg.L(g,s,a);var C=Nr;if(C&&g&&s){var d='link[rel="preload"][as="'+Ci(s)+'"]';s==="image"&&a&&a.imageSrcSet?(d+='[imagesrcset="'+Ci(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(d+='[imagesizes="'+Ci(a.imageSizes)+'"]')):d+='[href="'+Ci(g)+'"]';var u=d;switch(s){case"style":u=Dr(g);break;case"script":u=Mr(g)}pi.has(u)||(g=p({rel:"preload",href:s==="image"&&a&&a.imageSrcSet?void 0:g,as:s},a),pi.set(u,g),C.querySelector(d)!==null||s==="style"&&C.querySelector(RA(u))||s==="script"&&C.querySelector(zA(u))||(s=C.createElement("link"),yn(s,"link",g),ln(s),C.head.appendChild(s)))}}function pge(g,s){wg.m(g,s);var a=Nr;if(a&&g){var C=s&&typeof s.as=="string"?s.as:"script",d='link[rel="modulepreload"][as="'+Ci(C)+'"][href="'+Ci(g)+'"]',u=d;switch(C){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Mr(g)}if(!pi.has(u)&&(g=p({rel:"modulepreload",href:g},s),pi.set(u,g),a.querySelector(d)===null)){switch(C){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(zA(u)))return}C=a.createElement("link"),yn(C,"link",g),ln(C),a.head.appendChild(C)}}}function mge(g,s,a){wg.S(g,s,a);var C=Nr;if(C&&g){var d=qs(C).hoistableStyles,u=Dr(g);s=s||"default";var v=d.get(u);if(!v){var y={loading:0,preload:null};if(v=C.querySelector(RA(u)))y.loading=5;else{g=p({rel:"stylesheet",href:g,"data-precedence":s},a),(a=pi.get(u))&&up(g,a);var N=v=C.createElement("link");ln(N),yn(N,"link",g),N._p=new Promise(function(P,$){N.onload=P,N.onerror=$}),N.addEventListener("load",function(){y.loading|=1}),N.addEventListener("error",function(){y.loading|=2}),y.loading|=4,Dl(v,s,C)}v={type:"stylesheet",instance:v,count:1,state:y},d.set(u,v)}}}function vge(g,s){wg.X(g,s);var a=Nr;if(a&&g){var C=qs(a).hoistableScripts,d=Mr(g),u=C.get(d);u||(u=a.querySelector(zA(d)),u||(g=p({src:g,async:!0},s),(s=pi.get(d))&&hp(g,s),u=a.createElement("script"),ln(u),yn(u,"link",g),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},C.set(d,u))}}function bge(g,s){wg.M(g,s);var a=Nr;if(a&&g){var C=qs(a).hoistableScripts,d=Mr(g),u=C.get(d);u||(u=a.querySelector(zA(d)),u||(g=p({src:g,async:!0,type:"module"},s),(s=pi.get(d))&&hp(g,s),u=a.createElement("script"),ln(u),yn(u,"link",g),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},C.set(d,u))}}function _O(g,s,a,C){var d=(d=me.current)?Nl(d):null;if(!d)throw Error(i(446));switch(g){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(s=Dr(a.href),a=qs(d).hoistableStyles,C=a.get(s),C||(C={type:"style",instance:null,count:0,state:null},a.set(s,C)),C):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){g=Dr(a.href);var u=qs(d).hoistableStyles,v=u.get(g);if(v||(d=d.ownerDocument||d,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(g,v),(u=d.querySelector(RA(g)))&&!u._p&&(v.instance=u,v.state.loading=5),pi.has(g)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},pi.set(g,a),u||yge(d,g,a,v.state))),s&&C===null)throw Error(i(528,""));return v}if(s&&C!==null)throw Error(i(529,""));return null;case"script":return s=a.async,a=a.src,typeof a=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Mr(a),a=qs(d).hoistableScripts,C=a.get(s),C||(C={type:"script",instance:null,count:0,state:null},a.set(s,C)),C):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,g))}}function Dr(g){return'href="'+Ci(g)+'"'}function RA(g){return'link[rel="stylesheet"]['+g+"]"}function jO(g){return p({},g,{"data-precedence":g.precedence,precedence:null})}function yge(g,s,a,C){g.querySelector('link[rel="preload"][as="style"]['+s+"]")?C.loading=1:(s=g.createElement("link"),C.preload=s,s.addEventListener("load",function(){return C.loading|=1}),s.addEventListener("error",function(){return C.loading|=2}),yn(s,"link",a),ln(s),g.head.appendChild(s))}function Mr(g){return'[src="'+Ci(g)+'"]'}function zA(g){return"script[async]"+g}function ZO(g,s,a){if(s.count++,s.instance===null)switch(s.type){case"style":var C=g.querySelector('style[data-href~="'+Ci(a.href)+'"]');if(C)return s.instance=C,ln(C),C;var d=p({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return C=(g.ownerDocument||g).createElement("style"),ln(C),yn(C,"style",d),Dl(C,a.precedence,g),s.instance=C;case"stylesheet":d=Dr(a.href);var u=g.querySelector(RA(d));if(u)return s.state.loading|=4,s.instance=u,ln(u),u;C=jO(a),(d=pi.get(d))&&up(C,d),u=(g.ownerDocument||g).createElement("link"),ln(u);var v=u;return v._p=new Promise(function(y,N){v.onload=y,v.onerror=N}),yn(u,"link",C),s.state.loading|=4,Dl(u,a.precedence,g),s.instance=u;case"script":return u=Mr(a.src),(d=g.querySelector(zA(u)))?(s.instance=d,ln(d),d):(C=a,(d=pi.get(u))&&(C=p({},a),hp(C,d)),g=g.ownerDocument||g,d=g.createElement("script"),ln(d),yn(d,"link",C),g.head.appendChild(d),s.instance=d);case"void":return null;default:throw Error(i(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(C=s.instance,s.state.loading|=4,Dl(C,a.precedence,g));return s.instance}function Dl(g,s,a){for(var C=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=C.length?C[C.length-1]:null,u=d,v=0;v title"):null)}function wge(g,s,a){if(a===1||s.itemProp!=null)return!1;switch(g){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(g=s.disabled,typeof s.precedence=="string"&&g==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function LO(g){return!(g.type==="stylesheet"&&(g.state.loading&3)===0)}function xge(g,s,a,C){if(a.type==="stylesheet"&&(typeof C.media!="string"||matchMedia(C.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var d=Dr(C.href),u=s.querySelector(RA(d));if(u){s=u._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(g.count++,g=Rl.bind(g),s.then(g,g)),a.state.loading|=4,a.instance=u,ln(u);return}u=s.ownerDocument||s,C=jO(C),(d=pi.get(d))&&up(C,d),u=u.createElement("link"),ln(u);var v=u;v._p=new Promise(function(y,N){v.onload=y,v.onerror=N}),yn(u,"link",C),a.instance=u}g.stylesheets===null&&(g.stylesheets=new Map),g.stylesheets.set(a,s),(s=a.state.preload)&&(a.state.loading&3)===0&&(g.count++,a=Rl.bind(g),s.addEventListener("load",a),s.addEventListener("error",a))}}var fp=0;function Ege(g,s){return g.stylesheets&&g.count===0&&kl(g,g.stylesheets),0fp?50:800)+s);return g.unsuspend=a,function(){g.unsuspend=null,clearTimeout(C),clearTimeout(d)}}:null}function Rl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)kl(this,this.stylesheets);else if(this.unsuspend){var g=this.unsuspend;this.unsuspend=null,g()}}}var zl=null;function kl(g,s){g.stylesheets=null,g.unsuspend!==null&&(g.count++,zl=new Map,s.forEach(Sge,g),zl=null,Rl.call(g))}function Sge(g,s){if(!(s.state.loading&4)){var a=zl.get(g);if(a)var C=a.get(null);else{a=new Map,zl.set(g,a);for(var d=g.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),Vl.exports=AN(),Vl.exports}var IN=CN(),kp;function q(n,e,t){function i(I,l){if(I._zod||Object.defineProperty(I,"_zod",{value:{def:l,constr:A,traits:new Set},enumerable:!1}),I._zod.traits.has(n))return;I._zod.traits.add(n),e(I,l);const c=A.prototype,h=Object.keys(c);for(let p=0;pt?.Parent&&I instanceof t.Parent?!0:I?._zod?.traits?.has(n)}),Object.defineProperty(A,"name",{value:n}),A}class rs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class _p extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(kp=globalThis).__zod_globalConfig??(kp.__zod_globalConfig={});const Ql=globalThis.__zod_globalConfig;function Ki(n){return Ql}function jp(n){const e=Object.values(n).filter(i=>typeof i=="number");return Object.entries(n).filter(([i,o])=>e.indexOf(+i)===-1).map(([i,o])=>o)}function Xl(n,e){return typeof e=="bigint"?e.toString():e}function PA(n){return{get value(){{const e=n();return Object.defineProperty(this,"value",{value:e}),e}}}}function $l(n){return n==null}function ql(n){const e=n.startsWith("^")?1:0,t=n.endsWith("$")?n.length-1:n.length;return n.slice(e,t)}function lN(n,e){const t=n/e,i=Math.round(t),o=Number.EPSILON*Math.max(Math.abs(t),1);return Math.abs(t-i){};function _r(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const dN=PA(()=>{if(Ql.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const n=Function;return new n(""),!0}catch{return!1}});function as(n){if(_r(n)===!1)return!1;const e=n.constructor;if(e===void 0||typeof e!="function")return!0;const t=e.prototype;return!(_r(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function Lp(n){return as(n)?{...n}:Array.isArray(n)?[...n]:n instanceof Map?new Map(n):n instanceof Set?new Set(n):n}const uN=new Set(["string","number","symbol"]);function As(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Eg(n,e,t){const i=new n._zod.constr(e??n._zod.def);return(!e||t?.parent)&&(i._zod.parent=n),i}function ye(n){const e=n;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function hN(n){return Object.keys(n).filter(e=>n[e]._zod.optin==="optional"&&n[e]._zod.optout==="optional")}const fN={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function pN(n,e){const t=n._zod.def,i=t.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const r=xg(n._zod.def,{get shape(){const A={};for(const I in e){if(!(I in t.shape))throw new Error(`Unrecognized key: "${I}"`);e[I]&&(A[I]=t.shape[I])}return po(this,"shape",A),A},checks:[]});return Eg(n,r)}function mN(n,e){const t=n._zod.def,i=t.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const r=xg(n._zod.def,{get shape(){const A={...n._zod.def.shape};for(const I in e){if(!(I in t.shape))throw new Error(`Unrecognized key: "${I}"`);e[I]&&delete A[I]}return po(this,"shape",A),A},checks:[]});return Eg(n,r)}function vN(n,e){if(!as(e))throw new Error("Invalid input to extend: expected a plain object");const t=n._zod.def.checks;if(t&&t.length>0){const r=n._zod.def.shape;for(const A in e)if(Object.getOwnPropertyDescriptor(r,A)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=xg(n._zod.def,{get shape(){const r={...n._zod.def.shape,...e};return po(this,"shape",r),r}});return Eg(n,o)}function bN(n,e){if(!as(e))throw new Error("Invalid input to safeExtend: expected a plain object");const t=xg(n._zod.def,{get shape(){const i={...n._zod.def.shape,...e};return po(this,"shape",i),i}});return Eg(n,t)}function yN(n,e){if(n._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const t=xg(n._zod.def,{get shape(){const i={...n._zod.def.shape,...e._zod.def.shape};return po(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Eg(n,t)}function wN(n,e,t){const o=e._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const A=xg(e._zod.def,{get shape(){const I=e._zod.def.shape,l={...I};if(t)for(const c in t){if(!(c in I))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(l[c]=n?new n({type:"optional",innerType:I[c]}):I[c])}else for(const c in I)l[c]=n?new n({type:"optional",innerType:I[c]}):I[c];return po(this,"shape",l),l},checks:[]});return Eg(e,A)}function xN(n,e,t){const i=xg(e._zod.def,{get shape(){const o=e._zod.def.shape,r={...o};if(t)for(const A in t){if(!(A in r))throw new Error(`Unrecognized key: "${A}"`);t[A]&&(r[A]=new n({type:"nonoptional",innerType:o[A]}))}else for(const A in o)r[A]=new n({type:"nonoptional",innerType:o[A]});return po(this,"shape",r),r}});return Eg(e,i)}function Cs(n,e=0){if(n.aborted===!0)return!0;for(let t=e;t{var i;return(i=t).path??(i.path=[]),t.path.unshift(n),t})}function BA(n){return typeof n=="string"?n:n?.message}function Wi(n,e,t){const i=n.message?n.message:BA(n.inst?._zod.def?.error?.(n))??BA(e?.error?.(n))??BA(t.customError?.(n))??BA(t.localeError?.(n))??"Invalid input",{inst:o,continue:r,input:A,...I}=n;return I.path??(I.path=[]),I.message=i,e?.reportInput&&(I.input=A),I}function Jl(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function jr(...n){const[e,t,i]=n;return typeof e=="string"?{message:e,code:"custom",input:t,inst:i}:{...e}}const Gp=(n,e)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:e,enumerable:!1}),n.message=JSON.stringify(e,Xl,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},Fp=q("$ZodError",Gp),Vp=q("$ZodError",Gp,{Parent:Error});function SN(n,e=t=>t.message){const t={},i=[];for(const o of n.issues)o.path.length>0?(t[o.path[0]]=t[o.path[0]]||[],t[o.path[0]].push(e(o))):i.push(e(o));return{formErrors:i,fieldErrors:t}}function TN(n,e=t=>t.message){const t={_errors:[]},i=(o,r=[])=>{for(const A of o.issues)if(A.code==="invalid_union"&&A.errors.length)A.errors.map(I=>i({issues:I},[...r,...A.path]));else if(A.code==="invalid_key")i({issues:A.issues},[...r,...A.path]);else if(A.code==="invalid_element")i({issues:A.issues},[...r,...A.path]);else{const I=[...r,...A.path];if(I.length===0)t._errors.push(e(A));else{let l=t,c=0;for(;c(e,t,i,o)=>{const r=i?{...i,async:!1}:{async:!1},A=e._zod.run({value:t,issues:[]},r);if(A instanceof Promise)throw new rs;if(A.issues.length){const I=new(o?.Err??n)(A.issues.map(l=>Wi(l,r,Ki())));throw Bp(I,o?.callee),I}return A.value},tc=n=>async(e,t,i,o)=>{const r=i?{...i,async:!0}:{async:!0};let A=e._zod.run({value:t,issues:[]},r);if(A instanceof Promise&&(A=await A),A.issues.length){const I=new(o?.Err??n)(A.issues.map(l=>Wi(l,r,Ki())));throw Bp(I,o?.callee),I}return A.value},LA=n=>(e,t,i)=>{const o=i?{...i,async:!1}:{async:!1},r=e._zod.run({value:t,issues:[]},o);if(r instanceof Promise)throw new rs;return r.issues.length?{success:!1,error:new(n??Fp)(r.issues.map(A=>Wi(A,o,Ki())))}:{success:!0,data:r.value}},ON=LA(Vp),GA=n=>async(e,t,i)=>{const o=i?{...i,async:!0}:{async:!0};let r=e._zod.run({value:t,issues:[]},o);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new n(r.issues.map(A=>Wi(A,o,Ki())))}:{success:!0,data:r.value}},NN=GA(Vp),DN=n=>(e,t,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return ec(n)(e,t,o)},MN=n=>(e,t,i)=>ec(n)(e,t,i),RN=n=>async(e,t,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return tc(n)(e,t,o)},zN=n=>async(e,t,i)=>tc(n)(e,t,i),kN=n=>(e,t,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return LA(n)(e,t,o)},_N=n=>(e,t,i)=>LA(n)(e,t,i),jN=n=>async(e,t,i)=>{const o=i?{...i,direction:"backward"}:{direction:"backward"};return GA(n)(e,t,o)},ZN=n=>async(e,t,i)=>GA(n)(e,t,i),PN=/^[cC][0-9a-z]{6,}$/,BN=/^[0-9a-z]+$/,LN=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,GN=/^[0-9a-vA-V]{20}$/,FN=/^[A-Za-z0-9]{27}$/,VN=/^[a-zA-Z0-9_-]{21}$/,UN=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,YN=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Up=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,HN=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,KN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function WN(){return new RegExp(KN,"u")}const QN=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,XN=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,$N=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,qN=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,JN=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Yp=/^[A-Za-z0-9_-]*$/,eD=/^https?$/,tD=/^\+[1-9]\d{6,14}$/,Hp="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",nD=new RegExp(`^${Hp}$`);function Kp(n){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${e}`:n.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${n.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function iD(n){return new RegExp(`^${Kp(n)}$`)}function gD(n){const e=Kp({precision:n.precision}),t=["Z"];n.local&&t.push(""),n.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${e}(?:${t.join("|")})`;return new RegExp(`^${Hp}T(?:${i})$`)}const oD=n=>{const e=n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},sD=/^-?\d+$/,Wp=/^-?\d+(?:\.\d+)?$/,rD=/^(?:true|false)$/i,aD=/^[^A-Z]*$/,AD=/^[^a-z]*$/,zn=q("$ZodCheck",(n,e)=>{var t;n._zod??(n._zod={}),n._zod.def=e,(t=n._zod).onattach??(t.onattach=[])}),Qp={number:"number",bigint:"bigint",object:"date"},Xp=q("$ZodCheckLessThan",(n,e)=>{zn.init(n,e);const t=Qp[typeof e.value];n._zod.onattach.push(i=>{const o=i._zod.bag,r=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?i.value<=e.value:i.value{zn.init(n,e);const t=Qp[typeof e.value];n._zod.onattach.push(i=>{const o=i._zod.bag,r=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>r&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),n._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:t,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:n,continue:!e.abort})}}),CD=q("$ZodCheckMultipleOf",(n,e)=>{zn.init(n,e),n._zod.onattach.push(t=>{var i;(i=t._zod.bag).multipleOf??(i.multipleOf=e.value)}),n._zod.check=t=>{if(typeof t.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof t.value=="bigint"?t.value%e.value===BigInt(0):lN(t.value,e.value)===0)||t.issues.push({origin:typeof t.value,code:"not_multiple_of",divisor:e.value,input:t.value,inst:n,continue:!e.abort})}}),ID=q("$ZodCheckNumberFormat",(n,e)=>{zn.init(n,e),e.format=e.format||"float64";const t=e.format?.includes("int"),i=t?"int":"number",[o,r]=fN[e.format];n._zod.onattach.push(A=>{const I=A._zod.bag;I.format=e.format,I.minimum=o,I.maximum=r,t&&(I.pattern=sD)}),n._zod.check=A=>{const I=A.value;if(t){if(!Number.isInteger(I)){A.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:I,inst:n});return}if(!Number.isSafeInteger(I)){I>0?A.issues.push({input:I,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:i,inclusive:!0,continue:!e.abort}):A.issues.push({input:I,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:i,inclusive:!0,continue:!e.abort});return}}Ir&&A.issues.push({origin:"number",input:I,code:"too_big",maximum:r,inclusive:!0,inst:n,continue:!e.abort})}}),lD=q("$ZodCheckMaxLength",(n,e)=>{var t;zn.init(n,e),(t=n._zod.def).when??(t.when=i=>{const o=i.value;return!$l(o)&&o.length!==void 0}),n._zod.onattach.push(i=>{const o=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{const o=i.value;if(o.length<=e.maximum)return;const A=Jl(o);i.issues.push({origin:A,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:n,continue:!e.abort})}}),cD=q("$ZodCheckMinLength",(n,e)=>{var t;zn.init(n,e),(t=n._zod.def).when??(t.when=i=>{const o=i.value;return!$l(o)&&o.length!==void 0}),n._zod.onattach.push(i=>{const o=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(i._zod.bag.minimum=e.minimum)}),n._zod.check=i=>{const o=i.value;if(o.length>=e.minimum)return;const A=Jl(o);i.issues.push({origin:A,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:n,continue:!e.abort})}}),dD=q("$ZodCheckLengthEquals",(n,e)=>{var t;zn.init(n,e),(t=n._zod.def).when??(t.when=i=>{const o=i.value;return!$l(o)&&o.length!==void 0}),n._zod.onattach.push(i=>{const o=i._zod.bag;o.minimum=e.length,o.maximum=e.length,o.length=e.length}),n._zod.check=i=>{const o=i.value,r=o.length;if(r===e.length)return;const A=Jl(o),I=r>e.length;i.issues.push({origin:A,...I?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:n,continue:!e.abort})}}),FA=q("$ZodCheckStringFormat",(n,e)=>{var t,i;zn.init(n,e),n._zod.onattach.push(o=>{const r=o._zod.bag;r.format=e.format,e.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(e.pattern))}),e.pattern?(t=n._zod).check??(t.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:n,continue:!e.abort})}):(i=n._zod).check??(i.check=()=>{})}),uD=q("$ZodCheckRegex",(n,e)=>{FA.init(n,e),n._zod.check=t=>{e.pattern.lastIndex=0,!e.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:e.pattern.toString(),inst:n,continue:!e.abort})}}),hD=q("$ZodCheckLowerCase",(n,e)=>{e.pattern??(e.pattern=aD),FA.init(n,e)}),fD=q("$ZodCheckUpperCase",(n,e)=>{e.pattern??(e.pattern=AD),FA.init(n,e)}),pD=q("$ZodCheckIncludes",(n,e)=>{zn.init(n,e);const t=As(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${t}`:t);e.pattern=i,n._zod.onattach.push(o=>{const r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(i)}),n._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:n,continue:!e.abort})}}),mD=q("$ZodCheckStartsWith",(n,e)=>{zn.init(n,e);const t=new RegExp(`^${As(e.prefix)}.*`);e.pattern??(e.pattern=t),n._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(t)}),n._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:n,continue:!e.abort})}}),vD=q("$ZodCheckEndsWith",(n,e)=>{zn.init(n,e);const t=new RegExp(`.*${As(e.suffix)}$`);e.pattern??(e.pattern=t),n._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(t)}),n._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:n,continue:!e.abort})}}),bD=q("$ZodCheckOverwrite",(n,e)=>{zn.init(n,e),n._zod.check=t=>{t.value=e.tx(t.value)}});class yD{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const i=e.split(` `).filter(A=>A),o=Math.min(...i.map(A=>A.length-A.trimStart().length)),r=i.map(A=>A.slice(o)).map(A=>" ".repeat(this.indent*2)+A);for(const A of r)this.content.push(A)}compile(){const e=Function,t=this?.args,o=[...(this?.content??[""]).map(r=>` ${r}`)];return new e(...t,o.join(` -`))}}const hD={major:4,minor:4,patch:3},Mt=$("$ZodType",(n,e)=>{var t;n??(n={}),n._zod.def=e,n._zod.bag=n._zod.bag||{},n._zod.version=hD;const i=[...n._zod.def.checks??[]];n._zod.traits.has("$ZodCheck")&&i.unshift(n);for(const o of i)for(const r of o._zod.onattach)r(n);if(i.length===0)(t=n._zod).deferred??(t.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{const o=(A,I,l)=>{let c=As(A),h;for(const p of I){if(p._zod.def.when){if(pN(A)||!p._zod.def.when(A))continue}else if(c)continue;const m=A.issues.length,b=p._zod.check(A);if(b instanceof Promise&&l?.async===!1)throw new ss;if(h||b instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await b,A.issues.length!==m&&(c||(c=As(A,m)))});else{if(A.issues.length===m)continue;c||(c=As(A,m))}}return h?h.then(()=>A):A},r=(A,I,l)=>{if(As(A))return A.aborted=!0,A;const c=o(I,i,l);if(c instanceof Promise){if(l.async===!1)throw new ss;return c.then(h=>n._zod.parse(h,l))}return n._zod.parse(c,l)};n._zod.run=(A,I)=>{if(I.skipChecks)return n._zod.parse(A,I);if(I.direction==="backward"){const c=n._zod.parse({value:A.value,issues:[]},{...I,skipChecks:!0});return c instanceof Promise?c.then(h=>r(h,A,I)):r(c,A,I)}const l=n._zod.parse(A,I);if(l instanceof Promise){if(I.async===!1)throw new ss;return l.then(c=>o(c,i,I))}return o(l,i,I)}}at(n,"~standard",()=>({validate:o=>{try{const r=bN(n,o);return r.success?{value:r.data}:{issues:r.error?.issues}}catch{return yN(n,o).then(A=>A.success?{value:A.data}:{issues:A.error?.issues})}},vendor:"zod",version:1}))}),ec=$("$ZodString",(n,e)=>{Mt.init(n,e),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??qN(n._zod.bag),n._zod.parse=(t,i)=>{if(e.coerce)try{t.value=String(t.value)}catch{}return typeof t.value=="string"||t.issues.push({expected:"string",code:"invalid_type",input:t.value,inst:n}),t}}),Ot=$("$ZodStringFormat",(n,e)=>{FA.init(n,e),ec.init(n,e)}),fD=$("$ZodGUID",(n,e)=>{e.pattern??(e.pattern=BN),Ot.init(n,e)}),pD=$("$ZodUUID",(n,e)=>{if(e.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Vp(i))}else e.pattern??(e.pattern=Vp());Ot.init(n,e)}),mD=$("$ZodEmail",(n,e)=>{e.pattern??(e.pattern=PN),Ot.init(n,e)}),vD=$("$ZodURL",(n,e)=>{Ot.init(n,e),n._zod.check=t=>{try{const i=t.value.trim();if(!e.normalize&&e.protocol?.source===KN.source&&!/^https?:\/\//i.test(i)){t.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:t.value,inst:n,continue:!e.abort});return}const o=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(o.hostname)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:t.value,inst:n,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:t.value,inst:n,continue:!e.abort})),e.normalize?t.value=o.href:t.value=i;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:n,continue:!e.abort})}}}),bD=$("$ZodEmoji",(n,e)=>{e.pattern??(e.pattern=GN()),Ot.init(n,e)}),yD=$("$ZodNanoID",(n,e)=>{e.pattern??(e.pattern=jN),Ot.init(n,e)}),wD=$("$ZodCUID",(n,e)=>{e.pattern??(e.pattern=MN),Ot.init(n,e)}),xD=$("$ZodCUID2",(n,e)=>{e.pattern??(e.pattern=zN),Ot.init(n,e)}),SD=$("$ZodULID",(n,e)=>{e.pattern??(e.pattern=kN),Ot.init(n,e)}),ED=$("$ZodXID",(n,e)=>{e.pattern??(e.pattern=RN),Ot.init(n,e)}),TD=$("$ZodKSUID",(n,e)=>{e.pattern??(e.pattern=_N),Ot.init(n,e)}),OD=$("$ZodISODateTime",(n,e)=>{e.pattern??(e.pattern=$N(e)),Ot.init(n,e)}),ND=$("$ZodISODate",(n,e)=>{e.pattern??(e.pattern=QN),Ot.init(n,e)}),DD=$("$ZodISOTime",(n,e)=>{e.pattern??(e.pattern=XN(e)),Ot.init(n,e)}),MD=$("$ZodISODuration",(n,e)=>{e.pattern??(e.pattern=ZN),Ot.init(n,e)}),zD=$("$ZodIPv4",(n,e)=>{e.pattern??(e.pattern=FN),Ot.init(n,e),n._zod.bag.format="ipv4"}),kD=$("$ZodIPv6",(n,e)=>{e.pattern??(e.pattern=VN),Ot.init(n,e),n._zod.bag.format="ipv6",n._zod.check=t=>{try{new URL(`http://[${t.value}]`)}catch{t.issues.push({code:"invalid_format",format:"ipv6",input:t.value,inst:n,continue:!e.abort})}}}),RD=$("$ZodCIDRv4",(n,e)=>{e.pattern??(e.pattern=UN),Ot.init(n,e)}),_D=$("$ZodCIDRv6",(n,e)=>{e.pattern??(e.pattern=YN),Ot.init(n,e),n._zod.check=t=>{const i=t.value.split("/");try{if(i.length!==2)throw new Error;const[o,r]=i;if(!r)throw new Error;const A=Number(r);if(`${A}`!==r)throw new Error;if(A<0||A>128)throw new Error;new URL(`http://[${o}]`)}catch{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:n,continue:!e.abort})}}});function $p(n){if(n==="")return!0;if(/\s/.test(n)||n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const jD=$("$ZodBase64",(n,e)=>{e.pattern??(e.pattern=HN),Ot.init(n,e),n._zod.bag.contentEncoding="base64",n._zod.check=t=>{$p(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:n,continue:!e.abort})}});function ZD(n){if(!Up.test(n))return!1;const e=n.replace(/[-_]/g,i=>i==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return $p(t)}const BD=$("$ZodBase64URL",(n,e)=>{e.pattern??(e.pattern=Up),Ot.init(n,e),n._zod.bag.contentEncoding="base64url",n._zod.check=t=>{ZD(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:n,continue:!e.abort})}}),PD=$("$ZodE164",(n,e)=>{e.pattern??(e.pattern=WN),Ot.init(n,e)});function LD(n,e=null){try{const t=n.split(".");if(t.length!==3)return!1;const[i]=t;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}const GD=$("$ZodJWT",(n,e)=>{Ot.init(n,e),n._zod.check=t=>{LD(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:n,continue:!e.abort})}}),qp=$("$ZodNumber",(n,e)=>{Mt.init(n,e),n._zod.pattern=n._zod.bag.pattern??Kp,n._zod.parse=(t,i)=>{if(e.coerce)try{t.value=Number(t.value)}catch{}const o=t.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return t;const r=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return t.issues.push({expected:"number",code:"invalid_type",input:o,inst:n,...r?{received:r}:{}}),t}}),FD=$("$ZodNumberFormat",(n,e)=>{gD.init(n,e),qp.init(n,e)}),VD=$("$ZodBoolean",(n,e)=>{Mt.init(n,e),n._zod.pattern=eD,n._zod.parse=(t,i)=>{if(e.coerce)try{t.value=!!t.value}catch{}const o=t.value;return typeof o=="boolean"||t.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:n}),t}}),UD=$("$ZodUnknown",(n,e)=>{Mt.init(n,e),n._zod.parse=t=>t}),YD=$("$ZodNever",(n,e)=>{Mt.init(n,e),n._zod.parse=(t,i)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:n}),t)});function Jp(n,e,t){n.issues.length&&e.issues.push(...Cs(t,n.issues)),e.value[t]=n.value}const HD=$("$ZodArray",(n,e)=>{Mt.init(n,e),n._zod.parse=(t,i)=>{const o=t.value;if(!Array.isArray(o))return t.issues.push({expected:"array",code:"invalid_type",input:o,inst:n}),t;t.value=Array(o.length);const r=[];for(let A=0;AJp(c,t,A))):Jp(l,t,A)}return r.length?Promise.all(r).then(()=>t):t}});function VA(n,e,t,i,o,r){const A=t in i;if(n.issues.length){if(o&&r&&!A)return;e.issues.push(...Cs(t,n.issues))}if(!A&&!o){n.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[t]});return}n.value===void 0?A&&(e.value[t]=void 0):e.value[t]=n.value}function em(n){const e=Object.keys(n.shape);for(const i of e)if(!n.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const t=AN(n.shape);return{...n,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)}}function tm(n,e,t,i,o,r){const A=[],I=o.keySet,l=o.catchall._zod,c=l.def.type,h=l.optin==="optional",p=l.optout==="optional";for(const m in e){if(m==="__proto__"||I.has(m))continue;if(c==="never"){A.push(m);continue}const b=l.run({value:e[m],issues:[]},i);b instanceof Promise?n.push(b.then(w=>VA(w,t,m,e,h,p))):VA(b,t,m,e,h,p)}return A.length&&t.issues.push({code:"unrecognized_keys",keys:A,input:e,inst:r}),n.length?Promise.all(n).then(()=>t):t}const KD=$("$ZodObject",(n,e)=>{if(Mt.init(n,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){const I=e.shape;Object.defineProperty(e,"shape",{get:()=>{const l={...I};return Object.defineProperty(e,"shape",{value:l}),l}})}const i=BA(()=>em(e));at(n._zod,"propValues",()=>{const I=e.shape,l={};for(const c in I){const h=I[c]._zod;if(h.values){l[c]??(l[c]=new Set);for(const p of h.values)l[c].add(p)}}return l});const o=_r,r=e.catchall;let A;n._zod.parse=(I,l)=>{A??(A=i.value);const c=I.value;if(!o(c))return I.issues.push({expected:"object",code:"invalid_type",input:c,inst:n}),I;I.value={};const h=[],p=A.shape;for(const m of A.keys){const b=p[m],w=b._zod.optin==="optional",S=b._zod.optout==="optional",x=b._zod.run({value:c[m],issues:[]},l);x instanceof Promise?h.push(x.then(O=>VA(O,I,m,c,w,S))):VA(x,I,m,c,w,S)}return r?tm(h,c,I,l,i.value,n):h.length?Promise.all(h).then(()=>I):I}}),WD=$("$ZodObjectJIT",(n,e)=>{KD.init(n,e);const t=n._zod.parse,i=BA(()=>em(e)),o=m=>{const b=new uD(["shape","payload","ctx"]),w=i.value,S=R=>{const B=Zp(R);return`shape[${B}]._zod.run({ value: input[${B}], issues: [] }, ctx)`};b.write("const input = payload.value;");const x=Object.create(null);let O=0;for(const R of w.keys)x[R]=`key_${O++}`;b.write("const newResult = {};");for(const R of w.keys){const B=x[R],W=Zp(R),ne=m[R],L=ne?._zod?.optin==="optional",G=ne?._zod?.optout==="optional";b.write(`const ${B} = ${S(R)};`),L&&G?b.write(` - if (${B}.issues.length) { - if (${W} in input) { - payload.issues = payload.issues.concat(${B}.issues.map(iss => ({ +`))}}const wD={major:4,minor:4,patch:3},Rt=q("$ZodType",(n,e)=>{var t;n??(n={}),n._zod.def=e,n._zod.bag=n._zod.bag||{},n._zod.version=wD;const i=[...n._zod.def.checks??[]];n._zod.traits.has("$ZodCheck")&&i.unshift(n);for(const o of i)for(const r of o._zod.onattach)r(n);if(i.length===0)(t=n._zod).deferred??(t.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{const o=(A,I,l)=>{let c=Cs(A),h;for(const p of I){if(p._zod.def.when){if(EN(A)||!p._zod.def.when(A))continue}else if(c)continue;const m=A.issues.length,b=p._zod.check(A);if(b instanceof Promise&&l?.async===!1)throw new rs;if(h||b instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await b,A.issues.length!==m&&(c||(c=Cs(A,m)))});else{if(A.issues.length===m)continue;c||(c=Cs(A,m))}}return h?h.then(()=>A):A},r=(A,I,l)=>{if(Cs(A))return A.aborted=!0,A;const c=o(I,i,l);if(c instanceof Promise){if(l.async===!1)throw new rs;return c.then(h=>n._zod.parse(h,l))}return n._zod.parse(c,l)};n._zod.run=(A,I)=>{if(I.skipChecks)return n._zod.parse(A,I);if(I.direction==="backward"){const c=n._zod.parse({value:A.value,issues:[]},{...I,skipChecks:!0});return c instanceof Promise?c.then(h=>r(h,A,I)):r(c,A,I)}const l=n._zod.parse(A,I);if(l instanceof Promise){if(I.async===!1)throw new rs;return l.then(c=>o(c,i,I))}return o(l,i,I)}}Ct(n,"~standard",()=>({validate:o=>{try{const r=ON(n,o);return r.success?{value:r.data}:{issues:r.error?.issues}}catch{return NN(n,o).then(A=>A.success?{value:A.data}:{issues:A.error?.issues})}},vendor:"zod",version:1}))}),nc=q("$ZodString",(n,e)=>{Rt.init(n,e),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??oD(n._zod.bag),n._zod.parse=(t,i)=>{if(e.coerce)try{t.value=String(t.value)}catch{}return typeof t.value=="string"||t.issues.push({expected:"string",code:"invalid_type",input:t.value,inst:n}),t}}),Ot=q("$ZodStringFormat",(n,e)=>{FA.init(n,e),nc.init(n,e)}),xD=q("$ZodGUID",(n,e)=>{e.pattern??(e.pattern=YN),Ot.init(n,e)}),ED=q("$ZodUUID",(n,e)=>{if(e.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Up(i))}else e.pattern??(e.pattern=Up());Ot.init(n,e)}),SD=q("$ZodEmail",(n,e)=>{e.pattern??(e.pattern=HN),Ot.init(n,e)}),TD=q("$ZodURL",(n,e)=>{Ot.init(n,e),n._zod.check=t=>{try{const i=t.value.trim();if(!e.normalize&&e.protocol?.source===eD.source&&!/^https?:\/\//i.test(i)){t.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:t.value,inst:n,continue:!e.abort});return}const o=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(o.hostname)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:t.value,inst:n,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:t.value,inst:n,continue:!e.abort})),e.normalize?t.value=o.href:t.value=i;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:n,continue:!e.abort})}}}),OD=q("$ZodEmoji",(n,e)=>{e.pattern??(e.pattern=WN()),Ot.init(n,e)}),ND=q("$ZodNanoID",(n,e)=>{e.pattern??(e.pattern=VN),Ot.init(n,e)}),DD=q("$ZodCUID",(n,e)=>{e.pattern??(e.pattern=PN),Ot.init(n,e)}),MD=q("$ZodCUID2",(n,e)=>{e.pattern??(e.pattern=BN),Ot.init(n,e)}),RD=q("$ZodULID",(n,e)=>{e.pattern??(e.pattern=LN),Ot.init(n,e)}),zD=q("$ZodXID",(n,e)=>{e.pattern??(e.pattern=GN),Ot.init(n,e)}),kD=q("$ZodKSUID",(n,e)=>{e.pattern??(e.pattern=FN),Ot.init(n,e)}),_D=q("$ZodISODateTime",(n,e)=>{e.pattern??(e.pattern=gD(e)),Ot.init(n,e)}),jD=q("$ZodISODate",(n,e)=>{e.pattern??(e.pattern=nD),Ot.init(n,e)}),ZD=q("$ZodISOTime",(n,e)=>{e.pattern??(e.pattern=iD(e)),Ot.init(n,e)}),PD=q("$ZodISODuration",(n,e)=>{e.pattern??(e.pattern=UN),Ot.init(n,e)}),BD=q("$ZodIPv4",(n,e)=>{e.pattern??(e.pattern=QN),Ot.init(n,e),n._zod.bag.format="ipv4"}),LD=q("$ZodIPv6",(n,e)=>{e.pattern??(e.pattern=XN),Ot.init(n,e),n._zod.bag.format="ipv6",n._zod.check=t=>{try{new URL(`http://[${t.value}]`)}catch{t.issues.push({code:"invalid_format",format:"ipv6",input:t.value,inst:n,continue:!e.abort})}}}),GD=q("$ZodCIDRv4",(n,e)=>{e.pattern??(e.pattern=$N),Ot.init(n,e)}),FD=q("$ZodCIDRv6",(n,e)=>{e.pattern??(e.pattern=qN),Ot.init(n,e),n._zod.check=t=>{const i=t.value.split("/");try{if(i.length!==2)throw new Error;const[o,r]=i;if(!r)throw new Error;const A=Number(r);if(`${A}`!==r)throw new Error;if(A<0||A>128)throw new Error;new URL(`http://[${o}]`)}catch{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:n,continue:!e.abort})}}});function qp(n){if(n==="")return!0;if(/\s/.test(n)||n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const VD=q("$ZodBase64",(n,e)=>{e.pattern??(e.pattern=JN),Ot.init(n,e),n._zod.bag.contentEncoding="base64",n._zod.check=t=>{qp(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:n,continue:!e.abort})}});function UD(n){if(!Yp.test(n))return!1;const e=n.replace(/[-_]/g,i=>i==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return qp(t)}const YD=q("$ZodBase64URL",(n,e)=>{e.pattern??(e.pattern=Yp),Ot.init(n,e),n._zod.bag.contentEncoding="base64url",n._zod.check=t=>{UD(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:n,continue:!e.abort})}}),HD=q("$ZodE164",(n,e)=>{e.pattern??(e.pattern=tD),Ot.init(n,e)});function KD(n,e=null){try{const t=n.split(".");if(t.length!==3)return!1;const[i]=t;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}const WD=q("$ZodJWT",(n,e)=>{Ot.init(n,e),n._zod.check=t=>{KD(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:n,continue:!e.abort})}}),Jp=q("$ZodNumber",(n,e)=>{Rt.init(n,e),n._zod.pattern=n._zod.bag.pattern??Wp,n._zod.parse=(t,i)=>{if(e.coerce)try{t.value=Number(t.value)}catch{}const o=t.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return t;const r=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return t.issues.push({expected:"number",code:"invalid_type",input:o,inst:n,...r?{received:r}:{}}),t}}),QD=q("$ZodNumberFormat",(n,e)=>{ID.init(n,e),Jp.init(n,e)}),XD=q("$ZodBoolean",(n,e)=>{Rt.init(n,e),n._zod.pattern=rD,n._zod.parse=(t,i)=>{if(e.coerce)try{t.value=!!t.value}catch{}const o=t.value;return typeof o=="boolean"||t.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:n}),t}}),$D=q("$ZodUnknown",(n,e)=>{Rt.init(n,e),n._zod.parse=t=>t}),qD=q("$ZodNever",(n,e)=>{Rt.init(n,e),n._zod.parse=(t,i)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:n}),t)});function em(n,e,t){n.issues.length&&e.issues.push(...Is(t,n.issues)),e.value[t]=n.value}const JD=q("$ZodArray",(n,e)=>{Rt.init(n,e),n._zod.parse=(t,i)=>{const o=t.value;if(!Array.isArray(o))return t.issues.push({expected:"array",code:"invalid_type",input:o,inst:n}),t;t.value=Array(o.length);const r=[];for(let A=0;Aem(c,t,A))):em(l,t,A)}return r.length?Promise.all(r).then(()=>t):t}});function VA(n,e,t,i,o,r){const A=t in i;if(n.issues.length){if(o&&r&&!A)return;e.issues.push(...Is(t,n.issues))}if(!A&&!o){n.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[t]});return}n.value===void 0?A&&(e.value[t]=void 0):e.value[t]=n.value}function tm(n){const e=Object.keys(n.shape);for(const i of e)if(!n.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const t=hN(n.shape);return{...n,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)}}function nm(n,e,t,i,o,r){const A=[],I=o.keySet,l=o.catchall._zod,c=l.def.type,h=l.optin==="optional",p=l.optout==="optional";for(const m in e){if(m==="__proto__"||I.has(m))continue;if(c==="never"){A.push(m);continue}const b=l.run({value:e[m],issues:[]},i);b instanceof Promise?n.push(b.then(w=>VA(w,t,m,e,h,p))):VA(b,t,m,e,h,p)}return A.length&&t.issues.push({code:"unrecognized_keys",keys:A,input:e,inst:r}),n.length?Promise.all(n).then(()=>t):t}const eM=q("$ZodObject",(n,e)=>{if(Rt.init(n,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){const I=e.shape;Object.defineProperty(e,"shape",{get:()=>{const l={...I};return Object.defineProperty(e,"shape",{value:l}),l}})}const i=PA(()=>tm(e));Ct(n._zod,"propValues",()=>{const I=e.shape,l={};for(const c in I){const h=I[c]._zod;if(h.values){l[c]??(l[c]=new Set);for(const p of h.values)l[c].add(p)}}return l});const o=_r,r=e.catchall;let A;n._zod.parse=(I,l)=>{A??(A=i.value);const c=I.value;if(!o(c))return I.issues.push({expected:"object",code:"invalid_type",input:c,inst:n}),I;I.value={};const h=[],p=A.shape;for(const m of A.keys){const b=p[m],w=b._zod.optin==="optional",O=b._zod.optout==="optional",x=b._zod.run({value:c[m],issues:[]},l);x instanceof Promise?h.push(x.then(S=>VA(S,I,m,c,w,O))):VA(x,I,m,c,w,O)}return r?nm(h,c,I,l,i.value,n):h.length?Promise.all(h).then(()=>I):I}}),tM=q("$ZodObjectJIT",(n,e)=>{eM.init(n,e);const t=n._zod.parse,i=PA(()=>tm(e)),o=m=>{const b=new yD(["shape","payload","ctx"]),w=i.value,O=_=>{const j=Pp(_);return`shape[${j}]._zod.run({ value: input[${j}], issues: [] }, ctx)`};b.write("const input = payload.value;");const x=Object.create(null);let S=0;for(const _ of w.keys)x[_]=`key_${S++}`;b.write("const newResult = {};");for(const _ of w.keys){const j=x[_],X=Pp(_),ne=m[_],F=ne?._zod?.optin==="optional",V=ne?._zod?.optout==="optional";b.write(`const ${j} = ${O(_)};`),F&&V?b.write(` + if (${j}.issues.length) { + if (${X} in input) { + payload.issues = payload.issues.concat(${j}.issues.map(iss => ({ ...iss, - path: iss.path ? [${W}, ...iss.path] : [${W}] + path: iss.path ? [${X}, ...iss.path] : [${X}] }))); } } - if (${B}.value === undefined) { - if (${W} in input) { - newResult[${W}] = undefined; + if (${j}.value === undefined) { + if (${X} in input) { + newResult[${X}] = undefined; } } else { - newResult[${W}] = ${B}.value; + newResult[${X}] = ${j}.value; } - `):L?b.write(` - if (${B}.issues.length) { - payload.issues = payload.issues.concat(${B}.issues.map(iss => ({ + `):F?b.write(` + if (${j}.issues.length) { + payload.issues = payload.issues.concat(${j}.issues.map(iss => ({ ...iss, - path: iss.path ? [${W}, ...iss.path] : [${W}] + path: iss.path ? [${X}, ...iss.path] : [${X}] }))); } - if (${B}.value === undefined) { - if (${W} in input) { - newResult[${W}] = undefined; + if (${j}.value === undefined) { + if (${X} in input) { + newResult[${X}] = undefined; } } else { - newResult[${W}] = ${B}.value; + newResult[${X}] = ${j}.value; } `):b.write(` - const ${B}_present = ${W} in input; - if (${B}.issues.length) { - payload.issues = payload.issues.concat(${B}.issues.map(iss => ({ + const ${j}_present = ${X} in input; + if (${j}.issues.length) { + payload.issues = payload.issues.concat(${j}.issues.map(iss => ({ ...iss, - path: iss.path ? [${W}, ...iss.path] : [${W}] + path: iss.path ? [${X}, ...iss.path] : [${X}] }))); } - if (!${B}_present && !${B}.issues.length) { + if (!${j}_present && !${j}.issues.length) { payload.issues.push({ code: "invalid_type", expected: "nonoptional", input: undefined, - path: [${W}] + path: [${X}] }); } - if (${B}_present) { - if (${B}.value === undefined) { - newResult[${W}] = undefined; + if (${j}_present) { + if (${j}.value === undefined) { + newResult[${X}] = undefined; } else { - newResult[${W}] = ${B}.value; + newResult[${X}] = ${j}.value; } } - `)}b.write("payload.value = newResult;"),b.write("return payload;");const E=b.compile();return(R,B)=>E(m,R,B)};let r;const A=_r,I=!Kl.jitless,c=I&&rN.value,h=e.catchall;let p;n._zod.parse=(m,b)=>{p??(p=i.value);const w=m.value;return A(w)?I&&c&&b?.async===!1&&b.jitless!==!0?(r||(r=o(e.shape)),m=r(m,b),h?tm([],w,m,b,p,n):m):t(m,b):(m.issues.push({expected:"object",code:"invalid_type",input:w,inst:n}),m)}});function nm(n,e,t,i){for(const r of n)if(r.issues.length===0)return e.value=r.value,e;const o=n.filter(r=>!As(r));return o.length===1?(e.value=o[0].value,o[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:n.map(r=>r.issues.map(A=>Wi(A,i,Ki())))}),e)}const im=$("$ZodUnion",(n,e)=>{Mt.init(n,e),at(n._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),at(n._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),at(n._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),at(n._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){const i=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>Xl(o.source)).join("|")})$`)}});const t=e.options.length===1?e.options[0]._zod.run:null;n._zod.parse=(i,o)=>{if(t)return t(i,o);let r=!1;const A=[];for(const I of e.options){const l=I._zod.run({value:i.value,issues:[]},o);if(l instanceof Promise)A.push(l),r=!0;else{if(l.issues.length===0)return l;A.push(l)}}return r?Promise.all(A).then(I=>nm(I,i,n,o)):nm(A,i,n,o)}}),QD=$("$ZodDiscriminatedUnion",(n,e)=>{e.inclusive=!1,im.init(n,e);const t=n._zod.parse;at(n._zod,"propValues",()=>{const o={};for(const r of e.options){const A=r._zod.propValues;if(!A||Object.keys(A).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(const[I,l]of Object.entries(A)){o[I]||(o[I]=new Set);for(const c of l)o[I].add(c)}}return o});const i=BA(()=>{const o=e.options,r=new Map;for(const A of o){const I=A._zod.propValues?.[e.discriminator];if(!I||I.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(A)}"`);for(const l of I){if(r.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);r.set(l,A)}}return r});n._zod.parse=(o,r)=>{const A=o.value;if(!_r(A))return o.issues.push({code:"invalid_type",expected:"object",input:A,inst:n}),o;const I=i.value.get(A?.[e.discriminator]);return I?I._zod.run(o,r):e.unionFallback||r.direction==="backward"?t(o,r):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(i.value.keys()),input:A,path:[e.discriminator],inst:n}),o)}}),XD=$("$ZodIntersection",(n,e)=>{Mt.init(n,e),n._zod.parse=(t,i)=>{const o=t.value,r=e.left._zod.run({value:o,issues:[]},i),A=e.right._zod.run({value:o,issues:[]},i);return r instanceof Promise||A instanceof Promise?Promise.all([r,A]).then(([l,c])=>gm(t,l,c)):gm(t,r,A)}});function tc(n,e){if(n===e)return{valid:!0,data:n};if(n instanceof Date&&e instanceof Date&&+n==+e)return{valid:!0,data:n};if(rs(n)&&rs(e)){const t=Object.keys(e),i=Object.keys(n).filter(r=>t.indexOf(r)!==-1),o={...n,...e};for(const r of i){const A=tc(n[r],e[r]);if(!A.valid)return{valid:!1,mergeErrorPath:[r,...A.mergeErrorPath]};o[r]=A.data}return{valid:!0,data:o}}if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return{valid:!1,mergeErrorPath:[]};const t=[];for(let i=0;iI.l&&I.r).map(([I])=>I);if(r.length&&o&&n.issues.push({...o,keys:r}),As(n))return n;const A=tc(e.value,t.value);if(!A.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(A.mergeErrorPath)}`);return n.value=A.data,n}const $D=$("$ZodRecord",(n,e)=>{Mt.init(n,e),n._zod.parse=(t,i)=>{const o=t.value;if(!rs(o))return t.issues.push({expected:"record",code:"invalid_type",input:o,inst:n}),t;const r=[],A=e.keyType._zod.values;if(A){t.value={};const I=new Set;for(const c of A)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){I.add(typeof c=="number"?c.toString():c);const h=e.keyType._zod.run({value:c,issues:[]},i);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(h.issues.length){t.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(b=>Wi(b,i,Ki())),input:c,path:[c],inst:n});continue}const p=h.value,m=e.valueType._zod.run({value:o[c],issues:[]},i);m instanceof Promise?r.push(m.then(b=>{b.issues.length&&t.issues.push(...Cs(c,b.issues)),t.value[p]=b.value})):(m.issues.length&&t.issues.push(...Cs(c,m.issues)),t.value[p]=m.value)}let l;for(const c in o)I.has(c)||(l=l??[],l.push(c));l&&l.length>0&&t.issues.push({code:"unrecognized_keys",input:o,inst:n,keys:l})}else{t.value={};for(const I of Reflect.ownKeys(o)){if(I==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,I))continue;let l=e.keyType._zod.run({value:I,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof I=="string"&&Kp.test(I)&&l.issues.length){const p=e.keyType._zod.run({value:Number(I),issues:[]},i);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(l=p)}if(l.issues.length){e.mode==="loose"?t.value[I]=o[I]:t.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>Wi(p,i,Ki())),input:I,path:[I],inst:n});continue}const h=e.valueType._zod.run({value:o[I],issues:[]},i);h instanceof Promise?r.push(h.then(p=>{p.issues.length&&t.issues.push(...Cs(I,p.issues)),t.value[l.value]=p.value})):(h.issues.length&&t.issues.push(...Cs(I,h.issues)),t.value[l.value]=h.value)}}return r.length?Promise.all(r).then(()=>t):t}}),qD=$("$ZodEnum",(n,e)=>{Mt.init(n,e);const t=_p(e.entries),i=new Set(t);n._zod.values=i,n._zod.pattern=new RegExp(`^(${t.filter(o=>aN.has(typeof o)).map(o=>typeof o=="string"?as(o):o.toString()).join("|")})$`),n._zod.parse=(o,r)=>{const A=o.value;return i.has(A)||o.issues.push({code:"invalid_value",values:t,input:A,inst:n}),o}}),JD=$("$ZodLiteral",(n,e)=>{if(Mt.init(n,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");const t=new Set(e.values);n._zod.values=t,n._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?as(i):i?as(i.toString()):String(i)).join("|")})$`),n._zod.parse=(i,o)=>{const r=i.value;return t.has(r)||i.issues.push({code:"invalid_value",values:e.values,input:r,inst:n}),i}}),eM=$("$ZodTransform",(n,e)=>{Mt.init(n,e),n._zod.optin="optional",n._zod.parse=(t,i)=>{if(i.direction==="backward")throw new Rp(n.constructor.name);const o=e.transform(t.value,t);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then(A=>(t.value=A,t.fallback=!0,t));if(o instanceof Promise)throw new ss;return t.value=o,t.fallback=!0,t}});function om(n,e){return e===void 0&&(n.issues.length||n.fallback)?{issues:[],value:void 0}:n}const sm=$("$ZodOptional",(n,e)=>{Mt.init(n,e),n._zod.optin="optional",n._zod.optout="optional",at(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),at(n._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${Xl(t.source)})?$`):void 0}),n._zod.parse=(t,i)=>{if(e.innerType._zod.optin==="optional"){const o=t.value,r=e.innerType._zod.run(t,i);return r instanceof Promise?r.then(A=>om(A,o)):om(r,o)}return t.value===void 0?t:e.innerType._zod.run(t,i)}}),tM=$("$ZodExactOptional",(n,e)=>{sm.init(n,e),at(n._zod,"values",()=>e.innerType._zod.values),at(n._zod,"pattern",()=>e.innerType._zod.pattern),n._zod.parse=(t,i)=>e.innerType._zod.run(t,i)}),nM=$("$ZodNullable",(n,e)=>{Mt.init(n,e),at(n._zod,"optin",()=>e.innerType._zod.optin),at(n._zod,"optout",()=>e.innerType._zod.optout),at(n._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${Xl(t.source)}|null)$`):void 0}),at(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),n._zod.parse=(t,i)=>t.value===null?t:e.innerType._zod.run(t,i)}),iM=$("$ZodDefault",(n,e)=>{Mt.init(n,e),n._zod.optin="optional",at(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(t,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);if(t.value===void 0)return t.value=e.defaultValue,t;const o=e.innerType._zod.run(t,i);return o instanceof Promise?o.then(r=>rm(r,e)):rm(o,e)}});function rm(n,e){return n.value===void 0&&(n.value=e.defaultValue),n}const gM=$("$ZodPrefault",(n,e)=>{Mt.init(n,e),n._zod.optin="optional",at(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(t,i)=>(i.direction==="backward"||t.value===void 0&&(t.value=e.defaultValue),e.innerType._zod.run(t,i))}),oM=$("$ZodNonOptional",(n,e)=>{Mt.init(n,e),at(n._zod,"values",()=>{const t=e.innerType._zod.values;return t?new Set([...t].filter(i=>i!==void 0)):void 0}),n._zod.parse=(t,i)=>{const o=e.innerType._zod.run(t,i);return o instanceof Promise?o.then(r=>am(r,n)):am(o,n)}});function am(n,e){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:e}),n}const sM=$("$ZodCatch",(n,e)=>{Mt.init(n,e),n._zod.optin="optional",at(n._zod,"optout",()=>e.innerType._zod.optout),at(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(t,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);const o=e.innerType._zod.run(t,i);return o instanceof Promise?o.then(r=>(t.value=r.value,r.issues.length&&(t.value=e.catchValue({...t,error:{issues:r.issues.map(A=>Wi(A,i,Ki()))},input:t.value}),t.issues=[],t.fallback=!0),t)):(t.value=o.value,o.issues.length&&(t.value=e.catchValue({...t,error:{issues:o.issues.map(r=>Wi(r,i,Ki()))},input:t.value}),t.issues=[],t.fallback=!0),t)}}),rM=$("$ZodPipe",(n,e)=>{Mt.init(n,e),at(n._zod,"values",()=>e.in._zod.values),at(n._zod,"optin",()=>e.in._zod.optin),at(n._zod,"optout",()=>e.out._zod.optout),at(n._zod,"propValues",()=>e.in._zod.propValues),n._zod.parse=(t,i)=>{if(i.direction==="backward"){const r=e.out._zod.run(t,i);return r instanceof Promise?r.then(A=>UA(A,e.in,i)):UA(r,e.in,i)}const o=e.in._zod.run(t,i);return o instanceof Promise?o.then(r=>UA(r,e.out,i)):UA(o,e.out,i)}});function UA(n,e,t){return n.issues.length?(n.aborted=!0,n):e._zod.run({value:n.value,issues:n.issues,fallback:n.fallback},t)}const aM=$("$ZodReadonly",(n,e)=>{Mt.init(n,e),at(n._zod,"propValues",()=>e.innerType._zod.propValues),at(n._zod,"values",()=>e.innerType._zod.values),at(n._zod,"optin",()=>e.innerType?._zod?.optin),at(n._zod,"optout",()=>e.innerType?._zod?.optout),n._zod.parse=(t,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);const o=e.innerType._zod.run(t,i);return o instanceof Promise?o.then(Am):Am(o)}});function Am(n){return n.value=Object.freeze(n.value),n}const AM=$("$ZodCustom",(n,e)=>{kn.init(n,e),Mt.init(n,e),n._zod.parse=(t,i)=>t,n._zod.check=t=>{const i=t.value,o=e.fn(i);if(o instanceof Promise)return o.then(r=>Cm(r,t,i,n));Cm(o,t,i,n)}});function Cm(n,e,t,i){if(!n){const o={code:"custom",input:t,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(o.params=i._zod.def.params),e.issues.push(jr(o))}}var Im;class CM{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const i=t[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const i={...this.get(t)??{}};delete i.id;const o={...i,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function IM(){return new CM}(Im=globalThis).__zod_globalRegistry??(Im.__zod_globalRegistry=IM());const Zr=globalThis.__zod_globalRegistry;function lM(n,e){return new n({type:"string",...ye(e)})}function cM(n,e){return new n({type:"string",format:"email",check:"string_format",abort:!1,...ye(e)})}function lm(n,e){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...ye(e)})}function dM(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...ye(e)})}function uM(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ye(e)})}function hM(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ye(e)})}function fM(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ye(e)})}function pM(n,e){return new n({type:"string",format:"url",check:"string_format",abort:!1,...ye(e)})}function mM(n,e){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...ye(e)})}function vM(n,e){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...ye(e)})}function bM(n,e){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...ye(e)})}function yM(n,e){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...ye(e)})}function wM(n,e){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...ye(e)})}function xM(n,e){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...ye(e)})}function SM(n,e){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...ye(e)})}function EM(n,e){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...ye(e)})}function TM(n,e){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...ye(e)})}function OM(n,e){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ye(e)})}function NM(n,e){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ye(e)})}function DM(n,e){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...ye(e)})}function MM(n,e){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...ye(e)})}function zM(n,e){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...ye(e)})}function kM(n,e){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...ye(e)})}function RM(n,e){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ye(e)})}function _M(n,e){return new n({type:"string",format:"date",check:"string_format",...ye(e)})}function jM(n,e){return new n({type:"string",format:"time",check:"string_format",precision:null,...ye(e)})}function ZM(n,e){return new n({type:"string",format:"duration",check:"string_format",...ye(e)})}function BM(n,e){return new n({type:"number",checks:[],...ye(e)})}function PM(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...ye(e)})}function LM(n,e){return new n({type:"boolean",...ye(e)})}function GM(n){return new n({type:"unknown"})}function FM(n,e){return new n({type:"never",...ye(e)})}function cm(n,e){return new Qp({check:"less_than",...ye(e),value:n,inclusive:!1})}function nc(n,e){return new Qp({check:"less_than",...ye(e),value:n,inclusive:!0})}function dm(n,e){return new Xp({check:"greater_than",...ye(e),value:n,inclusive:!1})}function ic(n,e){return new Xp({check:"greater_than",...ye(e),value:n,inclusive:!0})}function um(n,e){return new iD({check:"multiple_of",...ye(e),value:n})}function hm(n,e){return new oD({check:"max_length",...ye(e),maximum:n})}function YA(n,e){return new sD({check:"min_length",...ye(e),minimum:n})}function fm(n,e){return new rD({check:"length_equals",...ye(e),length:n})}function VM(n,e){return new aD({check:"string_format",format:"regex",...ye(e),pattern:n})}function UM(n){return new AD({check:"string_format",format:"lowercase",...ye(n)})}function YM(n){return new CD({check:"string_format",format:"uppercase",...ye(n)})}function HM(n,e){return new ID({check:"string_format",format:"includes",...ye(e),includes:n})}function KM(n,e){return new lD({check:"string_format",format:"starts_with",...ye(e),prefix:n})}function WM(n,e){return new cD({check:"string_format",format:"ends_with",...ye(e),suffix:n})}function Is(n){return new dD({check:"overwrite",tx:n})}function QM(n){return Is(e=>e.normalize(n))}function XM(){return Is(n=>n.trim())}function $M(){return Is(n=>n.toLowerCase())}function qM(){return Is(n=>n.toUpperCase())}function JM(){return Is(n=>sN(n))}function ez(n,e,t){return new n({type:"array",element:e,...ye(t)})}function tz(n,e,t){return new n({type:"custom",check:"custom",fn:e,...ye(t)})}function nz(n,e){const t=iz(i=>(i.addIssue=o=>{if(typeof o=="string")i.issues.push(jr(o,i.value,t._zod.def));else{const r=o;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=i.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),i.issues.push(jr(r))}},n(i.value,i)),e);return t}function iz(n,e){const t=new kn({check:"custom",...ye(e)});return t._zod.check=n,t}function pm(n){let e=n?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:n.processors??{},metadataRegistry:n?.metadata??Zr,target:e,unrepresentable:n?.unrepresentable??"throw",override:n?.override??(()=>{}),io:n?.io??"output",counter:0,seen:new Map,cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0}}function Qt(n,e,t={path:[],schemaPath:[]}){var i;const o=n._zod.def,r=e.seen.get(n);if(r)return r.count++,t.schemaPath.includes(n)&&(r.cycle=t.path),r.schema;const A={schema:{},count:1,cycle:void 0,path:t.path};e.seen.set(n,A);const I=n._zod.toJSONSchema?.();if(I)A.schema=I;else{const h={...t,schemaPath:[...t.schemaPath,n],path:t.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(e,A.schema,h);else{const m=A.schema,b=e.processors[o.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);b(n,e,m,h)}const p=n._zod.parent;p&&(A.ref||(A.ref=p),Qt(p,e,h),e.seen.get(p).isParent=!0)}const l=e.metadataRegistry.get(n);return l&&Object.assign(A.schema,l),e.io==="input"&&En(n)&&(delete A.schema.examples,delete A.schema.default),e.io==="input"&&"_prefault"in A.schema&&((i=A.schema).default??(i.default=A.schema._prefault)),delete A.schema._prefault,e.seen.get(n).schema}function mm(n,e){const t=n.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const A of n.seen.entries()){const I=n.metadataRegistry.get(A[0])?.id;if(I){const l=i.get(I);if(l&&l!==A[0])throw new Error(`Duplicate schema id "${I}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(I,A[0])}}const o=A=>{const I=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const p=n.external.registry.get(A[0])?.id,m=n.external.uri??(w=>w);if(p)return{ref:m(p)};const b=A[1].defId??A[1].schema.id??`schema${n.counter++}`;return A[1].defId=b,{defId:b,ref:`${m("__shared")}#/${I}/${b}`}}if(A[1]===t)return{ref:"#"};const c=`#/${I}/`,h=A[1].schema.id??`__schema${n.counter++}`;return{defId:h,ref:c+h}},r=A=>{if(A[1].schema.$ref)return;const I=A[1],{ref:l,defId:c}=o(A);I.def={...I.schema},c&&(I.defId=c);const h=I.schema;for(const p in h)delete h[p];h.$ref=l};if(n.cycles==="throw")for(const A of n.seen.entries()){const I=A[1];if(I.cycle)throw new Error(`Cycle detected: #/${I.cycle?.join("/")}/ + `)}b.write("payload.value = newResult;"),b.write("return payload;");const E=b.compile();return(_,j)=>E(m,_,j)};let r;const A=_r,I=!Ql.jitless,c=I&&dN.value,h=e.catchall;let p;n._zod.parse=(m,b)=>{p??(p=i.value);const w=m.value;return A(w)?I&&c&&b?.async===!1&&b.jitless!==!0?(r||(r=o(e.shape)),m=r(m,b),h?nm([],w,m,b,p,n):m):t(m,b):(m.issues.push({expected:"object",code:"invalid_type",input:w,inst:n}),m)}});function im(n,e,t,i){for(const r of n)if(r.issues.length===0)return e.value=r.value,e;const o=n.filter(r=>!Cs(r));return o.length===1?(e.value=o[0].value,o[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:n.map(r=>r.issues.map(A=>Wi(A,i,Ki())))}),e)}const gm=q("$ZodUnion",(n,e)=>{Rt.init(n,e),Ct(n._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Ct(n._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Ct(n._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),Ct(n._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){const i=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>ql(o.source)).join("|")})$`)}});const t=e.options.length===1?e.options[0]._zod.run:null;n._zod.parse=(i,o)=>{if(t)return t(i,o);let r=!1;const A=[];for(const I of e.options){const l=I._zod.run({value:i.value,issues:[]},o);if(l instanceof Promise)A.push(l),r=!0;else{if(l.issues.length===0)return l;A.push(l)}}return r?Promise.all(A).then(I=>im(I,i,n,o)):im(A,i,n,o)}}),nM=q("$ZodDiscriminatedUnion",(n,e)=>{e.inclusive=!1,gm.init(n,e);const t=n._zod.parse;Ct(n._zod,"propValues",()=>{const o={};for(const r of e.options){const A=r._zod.propValues;if(!A||Object.keys(A).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(const[I,l]of Object.entries(A)){o[I]||(o[I]=new Set);for(const c of l)o[I].add(c)}}return o});const i=PA(()=>{const o=e.options,r=new Map;for(const A of o){const I=A._zod.propValues?.[e.discriminator];if(!I||I.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(A)}"`);for(const l of I){if(r.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);r.set(l,A)}}return r});n._zod.parse=(o,r)=>{const A=o.value;if(!_r(A))return o.issues.push({code:"invalid_type",expected:"object",input:A,inst:n}),o;const I=i.value.get(A?.[e.discriminator]);return I?I._zod.run(o,r):e.unionFallback||r.direction==="backward"?t(o,r):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(i.value.keys()),input:A,path:[e.discriminator],inst:n}),o)}}),iM=q("$ZodIntersection",(n,e)=>{Rt.init(n,e),n._zod.parse=(t,i)=>{const o=t.value,r=e.left._zod.run({value:o,issues:[]},i),A=e.right._zod.run({value:o,issues:[]},i);return r instanceof Promise||A instanceof Promise?Promise.all([r,A]).then(([l,c])=>om(t,l,c)):om(t,r,A)}});function ic(n,e){if(n===e)return{valid:!0,data:n};if(n instanceof Date&&e instanceof Date&&+n==+e)return{valid:!0,data:n};if(as(n)&&as(e)){const t=Object.keys(e),i=Object.keys(n).filter(r=>t.indexOf(r)!==-1),o={...n,...e};for(const r of i){const A=ic(n[r],e[r]);if(!A.valid)return{valid:!1,mergeErrorPath:[r,...A.mergeErrorPath]};o[r]=A.data}return{valid:!0,data:o}}if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return{valid:!1,mergeErrorPath:[]};const t=[];for(let i=0;iI.l&&I.r).map(([I])=>I);if(r.length&&o&&n.issues.push({...o,keys:r}),Cs(n))return n;const A=ic(e.value,t.value);if(!A.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(A.mergeErrorPath)}`);return n.value=A.data,n}const gM=q("$ZodRecord",(n,e)=>{Rt.init(n,e),n._zod.parse=(t,i)=>{const o=t.value;if(!as(o))return t.issues.push({expected:"record",code:"invalid_type",input:o,inst:n}),t;const r=[],A=e.keyType._zod.values;if(A){t.value={};const I=new Set;for(const c of A)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){I.add(typeof c=="number"?c.toString():c);const h=e.keyType._zod.run({value:c,issues:[]},i);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(h.issues.length){t.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(b=>Wi(b,i,Ki())),input:c,path:[c],inst:n});continue}const p=h.value,m=e.valueType._zod.run({value:o[c],issues:[]},i);m instanceof Promise?r.push(m.then(b=>{b.issues.length&&t.issues.push(...Is(c,b.issues)),t.value[p]=b.value})):(m.issues.length&&t.issues.push(...Is(c,m.issues)),t.value[p]=m.value)}let l;for(const c in o)I.has(c)||(l=l??[],l.push(c));l&&l.length>0&&t.issues.push({code:"unrecognized_keys",input:o,inst:n,keys:l})}else{t.value={};for(const I of Reflect.ownKeys(o)){if(I==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,I))continue;let l=e.keyType._zod.run({value:I,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof I=="string"&&Wp.test(I)&&l.issues.length){const p=e.keyType._zod.run({value:Number(I),issues:[]},i);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(l=p)}if(l.issues.length){e.mode==="loose"?t.value[I]=o[I]:t.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>Wi(p,i,Ki())),input:I,path:[I],inst:n});continue}const h=e.valueType._zod.run({value:o[I],issues:[]},i);h instanceof Promise?r.push(h.then(p=>{p.issues.length&&t.issues.push(...Is(I,p.issues)),t.value[l.value]=p.value})):(h.issues.length&&t.issues.push(...Is(I,h.issues)),t.value[l.value]=h.value)}}return r.length?Promise.all(r).then(()=>t):t}}),oM=q("$ZodEnum",(n,e)=>{Rt.init(n,e);const t=jp(e.entries),i=new Set(t);n._zod.values=i,n._zod.pattern=new RegExp(`^(${t.filter(o=>uN.has(typeof o)).map(o=>typeof o=="string"?As(o):o.toString()).join("|")})$`),n._zod.parse=(o,r)=>{const A=o.value;return i.has(A)||o.issues.push({code:"invalid_value",values:t,input:A,inst:n}),o}}),sM=q("$ZodLiteral",(n,e)=>{if(Rt.init(n,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");const t=new Set(e.values);n._zod.values=t,n._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?As(i):i?As(i.toString()):String(i)).join("|")})$`),n._zod.parse=(i,o)=>{const r=i.value;return t.has(r)||i.issues.push({code:"invalid_value",values:e.values,input:r,inst:n}),i}}),rM=q("$ZodTransform",(n,e)=>{Rt.init(n,e),n._zod.optin="optional",n._zod.parse=(t,i)=>{if(i.direction==="backward")throw new _p(n.constructor.name);const o=e.transform(t.value,t);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then(A=>(t.value=A,t.fallback=!0,t));if(o instanceof Promise)throw new rs;return t.value=o,t.fallback=!0,t}});function sm(n,e){return e===void 0&&(n.issues.length||n.fallback)?{issues:[],value:void 0}:n}const rm=q("$ZodOptional",(n,e)=>{Rt.init(n,e),n._zod.optin="optional",n._zod.optout="optional",Ct(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Ct(n._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${ql(t.source)})?$`):void 0}),n._zod.parse=(t,i)=>{if(e.innerType._zod.optin==="optional"){const o=t.value,r=e.innerType._zod.run(t,i);return r instanceof Promise?r.then(A=>sm(A,o)):sm(r,o)}return t.value===void 0?t:e.innerType._zod.run(t,i)}}),aM=q("$ZodExactOptional",(n,e)=>{rm.init(n,e),Ct(n._zod,"values",()=>e.innerType._zod.values),Ct(n._zod,"pattern",()=>e.innerType._zod.pattern),n._zod.parse=(t,i)=>e.innerType._zod.run(t,i)}),AM=q("$ZodNullable",(n,e)=>{Rt.init(n,e),Ct(n._zod,"optin",()=>e.innerType._zod.optin),Ct(n._zod,"optout",()=>e.innerType._zod.optout),Ct(n._zod,"pattern",()=>{const t=e.innerType._zod.pattern;return t?new RegExp(`^(${ql(t.source)}|null)$`):void 0}),Ct(n._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),n._zod.parse=(t,i)=>t.value===null?t:e.innerType._zod.run(t,i)}),CM=q("$ZodDefault",(n,e)=>{Rt.init(n,e),n._zod.optin="optional",Ct(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(t,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);if(t.value===void 0)return t.value=e.defaultValue,t;const o=e.innerType._zod.run(t,i);return o instanceof Promise?o.then(r=>am(r,e)):am(o,e)}});function am(n,e){return n.value===void 0&&(n.value=e.defaultValue),n}const IM=q("$ZodPrefault",(n,e)=>{Rt.init(n,e),n._zod.optin="optional",Ct(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(t,i)=>(i.direction==="backward"||t.value===void 0&&(t.value=e.defaultValue),e.innerType._zod.run(t,i))}),lM=q("$ZodNonOptional",(n,e)=>{Rt.init(n,e),Ct(n._zod,"values",()=>{const t=e.innerType._zod.values;return t?new Set([...t].filter(i=>i!==void 0)):void 0}),n._zod.parse=(t,i)=>{const o=e.innerType._zod.run(t,i);return o instanceof Promise?o.then(r=>Am(r,n)):Am(o,n)}});function Am(n,e){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:e}),n}const cM=q("$ZodCatch",(n,e)=>{Rt.init(n,e),n._zod.optin="optional",Ct(n._zod,"optout",()=>e.innerType._zod.optout),Ct(n._zod,"values",()=>e.innerType._zod.values),n._zod.parse=(t,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);const o=e.innerType._zod.run(t,i);return o instanceof Promise?o.then(r=>(t.value=r.value,r.issues.length&&(t.value=e.catchValue({...t,error:{issues:r.issues.map(A=>Wi(A,i,Ki()))},input:t.value}),t.issues=[],t.fallback=!0),t)):(t.value=o.value,o.issues.length&&(t.value=e.catchValue({...t,error:{issues:o.issues.map(r=>Wi(r,i,Ki()))},input:t.value}),t.issues=[],t.fallback=!0),t)}}),dM=q("$ZodPipe",(n,e)=>{Rt.init(n,e),Ct(n._zod,"values",()=>e.in._zod.values),Ct(n._zod,"optin",()=>e.in._zod.optin),Ct(n._zod,"optout",()=>e.out._zod.optout),Ct(n._zod,"propValues",()=>e.in._zod.propValues),n._zod.parse=(t,i)=>{if(i.direction==="backward"){const r=e.out._zod.run(t,i);return r instanceof Promise?r.then(A=>UA(A,e.in,i)):UA(r,e.in,i)}const o=e.in._zod.run(t,i);return o instanceof Promise?o.then(r=>UA(r,e.out,i)):UA(o,e.out,i)}});function UA(n,e,t){return n.issues.length?(n.aborted=!0,n):e._zod.run({value:n.value,issues:n.issues,fallback:n.fallback},t)}const uM=q("$ZodReadonly",(n,e)=>{Rt.init(n,e),Ct(n._zod,"propValues",()=>e.innerType._zod.propValues),Ct(n._zod,"values",()=>e.innerType._zod.values),Ct(n._zod,"optin",()=>e.innerType?._zod?.optin),Ct(n._zod,"optout",()=>e.innerType?._zod?.optout),n._zod.parse=(t,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);const o=e.innerType._zod.run(t,i);return o instanceof Promise?o.then(Cm):Cm(o)}});function Cm(n){return n.value=Object.freeze(n.value),n}const hM=q("$ZodCustom",(n,e)=>{zn.init(n,e),Rt.init(n,e),n._zod.parse=(t,i)=>t,n._zod.check=t=>{const i=t.value,o=e.fn(i);if(o instanceof Promise)return o.then(r=>Im(r,t,i,n));Im(o,t,i,n)}});function Im(n,e,t,i){if(!n){const o={code:"custom",input:t,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(o.params=i._zod.def.params),e.issues.push(jr(o))}}var lm;class fM{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const i=t[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const i={...this.get(t)??{}};delete i.id;const o={...i,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function pM(){return new fM}(lm=globalThis).__zod_globalRegistry??(lm.__zod_globalRegistry=pM());const Zr=globalThis.__zod_globalRegistry;function mM(n,e){return new n({type:"string",...ye(e)})}function vM(n,e){return new n({type:"string",format:"email",check:"string_format",abort:!1,...ye(e)})}function cm(n,e){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...ye(e)})}function bM(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...ye(e)})}function yM(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ye(e)})}function wM(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ye(e)})}function xM(n,e){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ye(e)})}function EM(n,e){return new n({type:"string",format:"url",check:"string_format",abort:!1,...ye(e)})}function SM(n,e){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...ye(e)})}function TM(n,e){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...ye(e)})}function OM(n,e){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...ye(e)})}function NM(n,e){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...ye(e)})}function DM(n,e){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...ye(e)})}function MM(n,e){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...ye(e)})}function RM(n,e){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...ye(e)})}function zM(n,e){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...ye(e)})}function kM(n,e){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...ye(e)})}function _M(n,e){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ye(e)})}function jM(n,e){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ye(e)})}function ZM(n,e){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...ye(e)})}function PM(n,e){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...ye(e)})}function BM(n,e){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...ye(e)})}function LM(n,e){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...ye(e)})}function GM(n,e){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ye(e)})}function FM(n,e){return new n({type:"string",format:"date",check:"string_format",...ye(e)})}function VM(n,e){return new n({type:"string",format:"time",check:"string_format",precision:null,...ye(e)})}function UM(n,e){return new n({type:"string",format:"duration",check:"string_format",...ye(e)})}function YM(n,e){return new n({type:"number",checks:[],...ye(e)})}function HM(n,e){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...ye(e)})}function KM(n,e){return new n({type:"boolean",...ye(e)})}function WM(n){return new n({type:"unknown"})}function QM(n,e){return new n({type:"never",...ye(e)})}function dm(n,e){return new Xp({check:"less_than",...ye(e),value:n,inclusive:!1})}function gc(n,e){return new Xp({check:"less_than",...ye(e),value:n,inclusive:!0})}function um(n,e){return new $p({check:"greater_than",...ye(e),value:n,inclusive:!1})}function oc(n,e){return new $p({check:"greater_than",...ye(e),value:n,inclusive:!0})}function hm(n,e){return new CD({check:"multiple_of",...ye(e),value:n})}function fm(n,e){return new lD({check:"max_length",...ye(e),maximum:n})}function YA(n,e){return new cD({check:"min_length",...ye(e),minimum:n})}function pm(n,e){return new dD({check:"length_equals",...ye(e),length:n})}function XM(n,e){return new uD({check:"string_format",format:"regex",...ye(e),pattern:n})}function $M(n){return new hD({check:"string_format",format:"lowercase",...ye(n)})}function qM(n){return new fD({check:"string_format",format:"uppercase",...ye(n)})}function JM(n,e){return new pD({check:"string_format",format:"includes",...ye(e),includes:n})}function eR(n,e){return new mD({check:"string_format",format:"starts_with",...ye(e),prefix:n})}function tR(n,e){return new vD({check:"string_format",format:"ends_with",...ye(e),suffix:n})}function ls(n){return new bD({check:"overwrite",tx:n})}function nR(n){return ls(e=>e.normalize(n))}function iR(){return ls(n=>n.trim())}function gR(){return ls(n=>n.toLowerCase())}function oR(){return ls(n=>n.toUpperCase())}function sR(){return ls(n=>cN(n))}function rR(n,e,t){return new n({type:"array",element:e,...ye(t)})}function aR(n,e,t){return new n({type:"custom",check:"custom",fn:e,...ye(t)})}function AR(n,e){const t=CR(i=>(i.addIssue=o=>{if(typeof o=="string")i.issues.push(jr(o,i.value,t._zod.def));else{const r=o;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=i.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),i.issues.push(jr(r))}},n(i.value,i)),e);return t}function CR(n,e){const t=new zn({check:"custom",...ye(e)});return t._zod.check=n,t}function mm(n){let e=n?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:n.processors??{},metadataRegistry:n?.metadata??Zr,target:e,unrepresentable:n?.unrepresentable??"throw",override:n?.override??(()=>{}),io:n?.io??"output",counter:0,seen:new Map,cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0}}function Qt(n,e,t={path:[],schemaPath:[]}){var i;const o=n._zod.def,r=e.seen.get(n);if(r)return r.count++,t.schemaPath.includes(n)&&(r.cycle=t.path),r.schema;const A={schema:{},count:1,cycle:void 0,path:t.path};e.seen.set(n,A);const I=n._zod.toJSONSchema?.();if(I)A.schema=I;else{const h={...t,schemaPath:[...t.schemaPath,n],path:t.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(e,A.schema,h);else{const m=A.schema,b=e.processors[o.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);b(n,e,m,h)}const p=n._zod.parent;p&&(A.ref||(A.ref=p),Qt(p,e,h),e.seen.get(p).isParent=!0)}const l=e.metadataRegistry.get(n);return l&&Object.assign(A.schema,l),e.io==="input"&&Sn(n)&&(delete A.schema.examples,delete A.schema.default),e.io==="input"&&"_prefault"in A.schema&&((i=A.schema).default??(i.default=A.schema._prefault)),delete A.schema._prefault,e.seen.get(n).schema}function vm(n,e){const t=n.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const A of n.seen.entries()){const I=n.metadataRegistry.get(A[0])?.id;if(I){const l=i.get(I);if(l&&l!==A[0])throw new Error(`Duplicate schema id "${I}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(I,A[0])}}const o=A=>{const I=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const p=n.external.registry.get(A[0])?.id,m=n.external.uri??(w=>w);if(p)return{ref:m(p)};const b=A[1].defId??A[1].schema.id??`schema${n.counter++}`;return A[1].defId=b,{defId:b,ref:`${m("__shared")}#/${I}/${b}`}}if(A[1]===t)return{ref:"#"};const c=`#/${I}/`,h=A[1].schema.id??`__schema${n.counter++}`;return{defId:h,ref:c+h}},r=A=>{if(A[1].schema.$ref)return;const I=A[1],{ref:l,defId:c}=o(A);I.def={...I.schema},c&&(I.defId=c);const h=I.schema;for(const p in h)delete h[p];h.$ref=l};if(n.cycles==="throw")for(const A of n.seen.entries()){const I=A[1];if(I.cycle)throw new Error(`Cycle detected: #/${I.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const A of n.seen.entries()){const I=A[1];if(e===A[0]){r(A);continue}if(n.external){const c=n.external.registry.get(A[0])?.id;if(e!==A[0]&&c){r(A);continue}}if(n.metadataRegistry.get(A[0])?.id){r(A);continue}if(I.cycle){r(A);continue}if(I.count>1&&n.reused==="ref"){r(A);continue}}}function vm(n,e){const t=n.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=I=>{const l=n.seen.get(I);if(l.ref===null)return;const c=l.def??l.schema,h={...c},p=l.ref;if(l.ref=null,p){i(p);const b=n.seen.get(p),w=b.schema;if(w.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(w)):Object.assign(c,w),Object.assign(c,h),I._zod.parent===p)for(const x in c)x==="$ref"||x==="allOf"||x in h||delete c[x];if(w.$ref&&b.def)for(const x in c)x==="$ref"||x==="allOf"||x in b.def&&JSON.stringify(c[x])===JSON.stringify(b.def[x])&&delete c[x]}const m=I._zod.parent;if(m&&m!==p){i(m);const b=n.seen.get(m);if(b?.schema.$ref&&(c.$ref=b.schema.$ref,b.def))for(const w in c)w==="$ref"||w==="allOf"||w in b.def&&JSON.stringify(c[w])===JSON.stringify(b.def[w])&&delete c[w]}n.override({zodSchema:I,jsonSchema:c,path:l.path??[]})};for(const I of[...n.seen.entries()].reverse())i(I[0]);const o={};if(n.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":n.target,n.external?.uri){const I=n.external.registry.get(e)?.id;if(!I)throw new Error("Schema is missing an `id` property");o.$id=n.external.uri(I)}Object.assign(o,t.def??t.schema);const r=n.metadataRegistry.get(e)?.id;r!==void 0&&o.id===r&&delete o.id;const A=n.external?.defs??{};for(const I of n.seen.entries()){const l=I[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,A[l.defId]=l.def)}n.external||Object.keys(A).length>0&&(n.target==="draft-2020-12"?o.$defs=A:o.definitions=A);try{const I=JSON.parse(JSON.stringify(o));return Object.defineProperty(I,"~standard",{value:{...e["~standard"],jsonSchema:{input:HA(e,"input",n.processors),output:HA(e,"output",n.processors)}},enumerable:!1,writable:!1}),I}catch{throw new Error("Error converting schema to JSON.")}}function En(n,e){const t=e??{seen:new Set};if(t.seen.has(n))return!1;t.seen.add(n);const i=n._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return En(i.element,t);if(i.type==="set")return En(i.valueType,t);if(i.type==="lazy")return En(i.getter(),t);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return En(i.innerType,t);if(i.type==="intersection")return En(i.left,t)||En(i.right,t);if(i.type==="record"||i.type==="map")return En(i.keyType,t)||En(i.valueType,t);if(i.type==="pipe")return n._zod.traits.has("$ZodCodec")?!0:En(i.in,t)||En(i.out,t);if(i.type==="object"){for(const o in i.shape)if(En(i.shape[o],t))return!0;return!1}if(i.type==="union"){for(const o of i.options)if(En(o,t))return!0;return!1}if(i.type==="tuple"){for(const o of i.items)if(En(o,t))return!0;return!!(i.rest&&En(i.rest,t))}return!1}const gz=(n,e={})=>t=>{const i=pm({...t,processors:e});return Qt(n,i),mm(i,n),vm(i,n)},HA=(n,e,t={})=>i=>{const{libraryOptions:o,target:r}=i??{},A=pm({...o??{},target:r,io:e,processors:t});return Qt(n,A),mm(A,n),vm(A,n)},oz={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},sz=(n,e,t,i)=>{const o=t;o.type="string";const{minimum:r,maximum:A,format:I,patterns:l,contentEncoding:c}=n._zod.bag;if(typeof r=="number"&&(o.minLength=r),typeof A=="number"&&(o.maxLength=A),I&&(o.format=oz[I]??I,o.format===""&&delete o.format,I==="time"&&delete o.format),c&&(o.contentEncoding=c),l&&l.size>0){const h=[...l];h.length===1?o.pattern=h[0].source:h.length>1&&(o.allOf=[...h.map(p=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},rz=(n,e,t,i)=>{const o=t,{minimum:r,maximum:A,format:I,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:h}=n._zod.bag;typeof I=="string"&&I.includes("int")?o.type="integer":o.type="number";const p=typeof h=="number"&&h>=(r??Number.NEGATIVE_INFINITY),m=typeof c=="number"&&c<=(A??Number.POSITIVE_INFINITY),b=e.target==="draft-04"||e.target==="openapi-3.0";p?b?(o.minimum=h,o.exclusiveMinimum=!0):o.exclusiveMinimum=h:typeof r=="number"&&(o.minimum=r),m?b?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c:typeof A=="number"&&(o.maximum=A),typeof l=="number"&&(o.multipleOf=l)},az=(n,e,t,i)=>{t.type="boolean"},Az=(n,e,t,i)=>{t.not={}},Cz=(n,e,t,i)=>{},Iz=(n,e,t,i)=>{const o=n._zod.def,r=_p(o.entries);r.every(A=>typeof A=="number")&&(t.type="number"),r.every(A=>typeof A=="string")&&(t.type="string"),t.enum=r},lz=(n,e,t,i)=>{const o=n._zod.def,r=[];for(const A of o.values)if(A===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof A=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");r.push(Number(A))}else r.push(A);if(r.length!==0)if(r.length===1){const A=r[0];t.type=A===null?"null":typeof A,e.target==="draft-04"||e.target==="openapi-3.0"?t.enum=[A]:t.const=A}else r.every(A=>typeof A=="number")&&(t.type="number"),r.every(A=>typeof A=="string")&&(t.type="string"),r.every(A=>typeof A=="boolean")&&(t.type="boolean"),r.every(A=>A===null)&&(t.type="null"),t.enum=r},cz=(n,e,t,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},dz=(n,e,t,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},uz=(n,e,t,i)=>{const o=t,r=n._zod.def,{minimum:A,maximum:I}=n._zod.bag;typeof A=="number"&&(o.minItems=A),typeof I=="number"&&(o.maxItems=I),o.type="array",o.items=Qt(r.element,e,{...i,path:[...i.path,"items"]})},hz=(n,e,t,i)=>{const o=t,r=n._zod.def;o.type="object",o.properties={};const A=r.shape;for(const c in A)o.properties[c]=Qt(A[c],e,{...i,path:[...i.path,"properties",c]});const I=new Set(Object.keys(A)),l=new Set([...I].filter(c=>{const h=r.shape[c]._zod;return e.io==="input"?h.optin===void 0:h.optout===void 0}));l.size>0&&(o.required=Array.from(l)),r.catchall?._zod.def.type==="never"?o.additionalProperties=!1:r.catchall?r.catchall&&(o.additionalProperties=Qt(r.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(o.additionalProperties=!1)},fz=(n,e,t,i)=>{const o=n._zod.def,r=o.inclusive===!1,A=o.options.map((I,l)=>Qt(I,e,{...i,path:[...i.path,r?"oneOf":"anyOf",l]}));r?t.oneOf=A:t.anyOf=A},pz=(n,e,t,i)=>{const o=n._zod.def,r=Qt(o.left,e,{...i,path:[...i.path,"allOf",0]}),A=Qt(o.right,e,{...i,path:[...i.path,"allOf",1]}),I=c=>"allOf"in c&&Object.keys(c).length===1,l=[...I(r)?r.allOf:[r],...I(A)?A.allOf:[A]];t.allOf=l},mz=(n,e,t,i)=>{const o=t,r=n._zod.def;o.type="object";const A=r.keyType,l=A._zod.bag?.patterns;if(r.mode==="loose"&&l&&l.size>0){const h=Qt(r.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});o.patternProperties={};for(const p of l)o.patternProperties[p.source]=h}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(o.propertyNames=Qt(r.keyType,e,{...i,path:[...i.path,"propertyNames"]})),o.additionalProperties=Qt(r.valueType,e,{...i,path:[...i.path,"additionalProperties"]});const c=A._zod.values;if(c){const h=[...c].filter(p=>typeof p=="string"||typeof p=="number");h.length>0&&(o.required=h)}},vz=(n,e,t,i)=>{const o=n._zod.def,r=Qt(o.innerType,e,i),A=e.seen.get(n);e.target==="openapi-3.0"?(A.ref=o.innerType,t.nullable=!0):t.anyOf=[r,{type:"null"}]},bz=(n,e,t,i)=>{const o=n._zod.def;Qt(o.innerType,e,i);const r=e.seen.get(n);r.ref=o.innerType},yz=(n,e,t,i)=>{const o=n._zod.def;Qt(o.innerType,e,i);const r=e.seen.get(n);r.ref=o.innerType,t.default=JSON.parse(JSON.stringify(o.defaultValue))},wz=(n,e,t,i)=>{const o=n._zod.def;Qt(o.innerType,e,i);const r=e.seen.get(n);r.ref=o.innerType,e.io==="input"&&(t._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},xz=(n,e,t,i)=>{const o=n._zod.def;Qt(o.innerType,e,i);const r=e.seen.get(n);r.ref=o.innerType;let A;try{A=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}t.default=A},Sz=(n,e,t,i)=>{const o=n._zod.def,r=o.in._zod.traits.has("$ZodTransform"),A=e.io==="input"?r?o.out:o.in:o.out;Qt(A,e,i);const I=e.seen.get(n);I.ref=A},Ez=(n,e,t,i)=>{const o=n._zod.def;Qt(o.innerType,e,i);const r=e.seen.get(n);r.ref=o.innerType,t.readOnly=!0},bm=(n,e,t,i)=>{const o=n._zod.def;Qt(o.innerType,e,i);const r=e.seen.get(n);r.ref=o.innerType},Tz=$("ZodISODateTime",(n,e)=>{OD.init(n,e),kt.init(n,e)});function Oz(n){return RM(Tz,n)}const Nz=$("ZodISODate",(n,e)=>{ND.init(n,e),kt.init(n,e)});function Dz(n){return _M(Nz,n)}const Mz=$("ZodISOTime",(n,e)=>{DD.init(n,e),kt.init(n,e)});function zz(n){return jM(Mz,n)}const kz=$("ZodISODuration",(n,e)=>{MD.init(n,e),kt.init(n,e)});function Rz(n){return ZM(kz,n)}const ni=$("ZodError",(n,e)=>{Gp.init(n,e),n.name="ZodError",Object.defineProperties(n,{format:{value:t=>vN(n,t)},flatten:{value:t=>mN(n,t)},addIssue:{value:t=>{n.issues.push(t),n.message=JSON.stringify(n.issues,Wl,2)}},addIssues:{value:t=>{n.issues.push(...t),n.message=JSON.stringify(n.issues,Wl,2)}},isEmpty:{get(){return n.issues.length===0}}})},{Parent:Error}),_z=ql(ni),jz=Jl(ni),Zz=LA(ni),Bz=GA(ni),Pz=wN(ni),Lz=xN(ni),Gz=SN(ni),Fz=EN(ni),Vz=TN(ni),Uz=ON(ni),Yz=NN(ni),Hz=DN(ni),ym=new WeakMap;function Br(n,e,t){const i=Object.getPrototypeOf(n);let o=ym.get(i);if(o||(o=new Set,ym.set(i,o)),!o.has(e)){o.add(e);for(const r in t){const A=t[r];Object.defineProperty(i,r,{configurable:!0,enumerable:!1,get(){const I=A.bind(this);return Object.defineProperty(this,r,{configurable:!0,writable:!0,enumerable:!0,value:I}),I},set(I){Object.defineProperty(this,r,{configurable:!0,writable:!0,enumerable:!0,value:I})}})}}}const zt=$("ZodType",(n,e)=>(Mt.init(n,e),Object.assign(n["~standard"],{jsonSchema:{input:HA(n,"input"),output:HA(n,"output")}}),n.toJSONSchema=gz(n,{}),n.def=e,n.type=e.type,Object.defineProperty(n,"_def",{value:e}),n.parse=(t,i)=>_z(n,t,i,{callee:n.parse}),n.safeParse=(t,i)=>Zz(n,t,i),n.parseAsync=async(t,i)=>jz(n,t,i,{callee:n.parseAsync}),n.safeParseAsync=async(t,i)=>Bz(n,t,i),n.spa=n.safeParseAsync,n.encode=(t,i)=>Pz(n,t,i),n.decode=(t,i)=>Lz(n,t,i),n.encodeAsync=async(t,i)=>Gz(n,t,i),n.decodeAsync=async(t,i)=>Fz(n,t,i),n.safeEncode=(t,i)=>Vz(n,t,i),n.safeDecode=(t,i)=>Uz(n,t,i),n.safeEncodeAsync=async(t,i)=>Yz(n,t,i),n.safeDecodeAsync=async(t,i)=>Hz(n,t,i),Br(n,"ZodType",{check(...t){const i=this.def;return this.clone(xg(i,{checks:[...i.checks??[],...t.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...t){return this.check(...t)},clone(t,i){return Sg(this,t,i)},brand(){return this},register(t,i){return t.add(this,i),this},refine(t,i){return this.check(jk(t,i))},superRefine(t,i){return this.check(Zk(t,i))},overwrite(t){return this.check(Is(t))},optional(){return km(this)},exactOptional(){return wk(this)},nullable(){return Rm(this)},nullish(){return km(Rm(this))},nonoptional(t){return Nk(this,t)},array(){return Fe(this)},or(t){return Dm([this,t])},and(t){return pk(this,t)},transform(t){return jm(this,bk(t))},default(t){return Ek(this,t)},prefault(t){return Ok(this,t)},catch(t){return Mk(this,t)},pipe(t){return jm(this,t)},readonly(){return Rk(this)},describe(t){const i=this.clone();return Zr.add(i,{description:t}),i},meta(...t){if(t.length===0)return Zr.get(this);const i=this.clone();return Zr.add(i,t[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(t){return t(this)}}),Object.defineProperty(n,"description",{get(){return Zr.get(n)?.description},configurable:!0}),n)),wm=$("_ZodString",(n,e)=>{ec.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(i,o,r)=>sz(n,i,o);const t=n._zod.bag;n.format=t.format??null,n.minLength=t.minimum??null,n.maxLength=t.maximum??null,Br(n,"_ZodString",{regex(...i){return this.check(VM(...i))},includes(...i){return this.check(HM(...i))},startsWith(...i){return this.check(KM(...i))},endsWith(...i){return this.check(WM(...i))},min(...i){return this.check(YA(...i))},max(...i){return this.check(hm(...i))},length(...i){return this.check(fm(...i))},nonempty(...i){return this.check(YA(1,...i))},lowercase(i){return this.check(UM(i))},uppercase(i){return this.check(YM(i))},trim(){return this.check(XM())},normalize(...i){return this.check(QM(...i))},toLowerCase(){return this.check($M())},toUpperCase(){return this.check(qM())},slugify(){return this.check(JM())}})}),Kz=$("ZodString",(n,e)=>{ec.init(n,e),wm.init(n,e),n.email=t=>n.check(cM(Wz,t)),n.url=t=>n.check(pM(Qz,t)),n.jwt=t=>n.check(kM(Ck,t)),n.emoji=t=>n.check(mM(Xz,t)),n.guid=t=>n.check(lm(xm,t)),n.uuid=t=>n.check(dM(KA,t)),n.uuidv4=t=>n.check(uM(KA,t)),n.uuidv6=t=>n.check(hM(KA,t)),n.uuidv7=t=>n.check(fM(KA,t)),n.nanoid=t=>n.check(vM($z,t)),n.guid=t=>n.check(lm(xm,t)),n.cuid=t=>n.check(bM(qz,t)),n.cuid2=t=>n.check(yM(Jz,t)),n.ulid=t=>n.check(wM(ek,t)),n.base64=t=>n.check(DM(rk,t)),n.base64url=t=>n.check(MM(ak,t)),n.xid=t=>n.check(xM(tk,t)),n.ksuid=t=>n.check(SM(nk,t)),n.ipv4=t=>n.check(EM(ik,t)),n.ipv6=t=>n.check(TM(gk,t)),n.cidrv4=t=>n.check(OM(ok,t)),n.cidrv6=t=>n.check(NM(sk,t)),n.e164=t=>n.check(zM(Ak,t)),n.datetime=t=>n.check(Oz(t)),n.date=t=>n.check(Dz(t)),n.time=t=>n.check(zz(t)),n.duration=t=>n.check(Rz(t))});function Y(n){return lM(Kz,n)}const kt=$("ZodStringFormat",(n,e)=>{Ot.init(n,e),wm.init(n,e)}),Wz=$("ZodEmail",(n,e)=>{mD.init(n,e),kt.init(n,e)}),xm=$("ZodGUID",(n,e)=>{fD.init(n,e),kt.init(n,e)}),KA=$("ZodUUID",(n,e)=>{pD.init(n,e),kt.init(n,e)}),Qz=$("ZodURL",(n,e)=>{vD.init(n,e),kt.init(n,e)}),Xz=$("ZodEmoji",(n,e)=>{bD.init(n,e),kt.init(n,e)}),$z=$("ZodNanoID",(n,e)=>{yD.init(n,e),kt.init(n,e)}),qz=$("ZodCUID",(n,e)=>{wD.init(n,e),kt.init(n,e)}),Jz=$("ZodCUID2",(n,e)=>{xD.init(n,e),kt.init(n,e)}),ek=$("ZodULID",(n,e)=>{SD.init(n,e),kt.init(n,e)}),tk=$("ZodXID",(n,e)=>{ED.init(n,e),kt.init(n,e)}),nk=$("ZodKSUID",(n,e)=>{TD.init(n,e),kt.init(n,e)}),ik=$("ZodIPv4",(n,e)=>{zD.init(n,e),kt.init(n,e)}),gk=$("ZodIPv6",(n,e)=>{kD.init(n,e),kt.init(n,e)}),ok=$("ZodCIDRv4",(n,e)=>{RD.init(n,e),kt.init(n,e)}),sk=$("ZodCIDRv6",(n,e)=>{_D.init(n,e),kt.init(n,e)}),rk=$("ZodBase64",(n,e)=>{jD.init(n,e),kt.init(n,e)}),ak=$("ZodBase64URL",(n,e)=>{BD.init(n,e),kt.init(n,e)}),Ak=$("ZodE164",(n,e)=>{PD.init(n,e),kt.init(n,e)}),Ck=$("ZodJWT",(n,e)=>{GD.init(n,e),kt.init(n,e)}),Sm=$("ZodNumber",(n,e)=>{qp.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(i,o,r)=>rz(n,i,o),Br(n,"ZodNumber",{gt(i,o){return this.check(dm(i,o))},gte(i,o){return this.check(ic(i,o))},min(i,o){return this.check(ic(i,o))},lt(i,o){return this.check(cm(i,o))},lte(i,o){return this.check(nc(i,o))},max(i,o){return this.check(nc(i,o))},int(i){return this.check(Em(i))},safe(i){return this.check(Em(i))},positive(i){return this.check(dm(0,i))},nonnegative(i){return this.check(ic(0,i))},negative(i){return this.check(cm(0,i))},nonpositive(i){return this.check(nc(0,i))},multipleOf(i,o){return this.check(um(i,o))},step(i,o){return this.check(um(i,o))},finite(){return this}});const t=n._zod.bag;n.minValue=Math.max(t.minimum??Number.NEGATIVE_INFINITY,t.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min(t.maximum??Number.POSITIVE_INFINITY,t.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=(t.format??"").includes("int")||Number.isSafeInteger(t.multipleOf??.5),n.isFinite=!0,n.format=t.format??null});function he(n){return BM(Sm,n)}const Ik=$("ZodNumberFormat",(n,e)=>{FD.init(n,e),Sm.init(n,e)});function Em(n){return PM(Ik,n)}const lk=$("ZodBoolean",(n,e)=>{VD.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>az(n,t,i)});function Un(n){return LM(lk,n)}const ck=$("ZodUnknown",(n,e)=>{UD.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>Cz()});function mo(){return GM(ck)}const dk=$("ZodNever",(n,e)=>{YD.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>Az(n,t,i)});function Tm(n){return FM(dk,n)}const uk=$("ZodArray",(n,e)=>{HD.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>uz(n,t,i,o),n.element=e.element,Br(n,"ZodArray",{min(t,i){return this.check(YA(t,i))},nonempty(t){return this.check(YA(1,t))},max(t,i){return this.check(hm(t,i))},length(t,i){return this.check(fm(t,i))},unwrap(){return this.element}})});function Fe(n,e){return ez(uk,n,e)}const Om=$("ZodObject",(n,e)=>{WD.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>hz(n,t,i,o),at(n,"shape",()=>e.shape),Br(n,"ZodObject",{keyof(){return lt(Object.keys(this._zod.def.shape))},catchall(t){return this.clone({...this._zod.def,catchall:t})},passthrough(){return this.clone({...this._zod.def,catchall:mo()})},loose(){return this.clone({...this._zod.def,catchall:mo()})},strict(){return this.clone({...this._zod.def,catchall:Tm()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(t){return cN(this,t)},safeExtend(t){return dN(this,t)},merge(t){return uN(this,t)},pick(t){return IN(this,t)},omit(t){return lN(this,t)},partial(...t){return hN(zm,this,t[0])},required(...t){return fN(_m,this,t[0])}})});function mt(n,e){const t={type:"object",shape:n??{},...ye(e)};return new Om(t)}function Se(n,e){return new Om({type:"object",shape:n,catchall:Tm(),...ye(e)})}const Nm=$("ZodUnion",(n,e)=>{im.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>fz(n,t,i,o),n.options=e.options});function Dm(n,e){return new Nm({type:"union",options:n,...ye(e)})}const hk=$("ZodDiscriminatedUnion",(n,e)=>{Nm.init(n,e),QD.init(n,e)});function gc(n,e,t){return new hk({type:"union",options:e,discriminator:n,...ye(t)})}const fk=$("ZodIntersection",(n,e)=>{XD.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>pz(n,t,i,o)});function pk(n,e){return new fk({type:"intersection",left:n,right:e})}const Mm=$("ZodRecord",(n,e)=>{$D.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>mz(n,t,i,o),n.keyType=e.keyType,n.valueType=e.valueType});function oc(n,e,t){return!e||!e._zod?new Mm({type:"record",keyType:Y(),valueType:n,...ye(e)}):new Mm({type:"record",keyType:n,valueType:e,...ye(t)})}const sc=$("ZodEnum",(n,e)=>{qD.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(i,o,r)=>Iz(n,i,o),n.enum=e.entries,n.options=Object.values(e.entries);const t=new Set(Object.keys(e.entries));n.extract=(i,o)=>{const r={};for(const A of i)if(t.has(A))r[A]=e.entries[A];else throw new Error(`Key ${A} not found in enum`);return new sc({...e,checks:[],...ye(o),entries:r})},n.exclude=(i,o)=>{const r={...e.entries};for(const A of i)if(t.has(A))delete r[A];else throw new Error(`Key ${A} not found in enum`);return new sc({...e,checks:[],...ye(o),entries:r})}});function lt(n,e){const t=Array.isArray(n)?Object.fromEntries(n.map(i=>[i,i])):n;return new sc({type:"enum",entries:t,...ye(e)})}const mk=$("ZodLiteral",(n,e)=>{JD.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>lz(n,t,i),n.values=new Set(e.values),Object.defineProperty(n,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function ct(n,e){return new mk({type:"literal",values:Array.isArray(n)?n:[n],...ye(e)})}const vk=$("ZodTransform",(n,e)=>{eM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>dz(n,t),n._zod.parse=(t,i)=>{if(i.direction==="backward")throw new Rp(n.constructor.name);t.addIssue=r=>{if(typeof r=="string")t.issues.push(jr(r,t.value,e));else{const A=r;A.fatal&&(A.continue=!1),A.code??(A.code="custom"),A.input??(A.input=t.value),A.inst??(A.inst=n),t.issues.push(jr(A))}};const o=e.transform(t.value,t);return o instanceof Promise?o.then(r=>(t.value=r,t.fallback=!0,t)):(t.value=o,t.fallback=!0,t)}});function bk(n){return new vk({type:"transform",transform:n})}const zm=$("ZodOptional",(n,e)=>{sm.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>bm(n,t,i,o),n.unwrap=()=>n._zod.def.innerType});function km(n){return new zm({type:"optional",innerType:n})}const yk=$("ZodExactOptional",(n,e)=>{tM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>bm(n,t,i,o),n.unwrap=()=>n._zod.def.innerType});function wk(n){return new yk({type:"optional",innerType:n})}const xk=$("ZodNullable",(n,e)=>{nM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>vz(n,t,i,o),n.unwrap=()=>n._zod.def.innerType});function Rm(n){return new xk({type:"nullable",innerType:n})}const Sk=$("ZodDefault",(n,e)=>{iM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>yz(n,t,i,o),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function Ek(n,e){return new Sk({type:"default",innerType:n,get defaultValue(){return typeof e=="function"?e():Pp(e)}})}const Tk=$("ZodPrefault",(n,e)=>{gM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>wz(n,t,i,o),n.unwrap=()=>n._zod.def.innerType});function Ok(n,e){return new Tk({type:"prefault",innerType:n,get defaultValue(){return typeof e=="function"?e():Pp(e)}})}const _m=$("ZodNonOptional",(n,e)=>{oM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>bz(n,t,i,o),n.unwrap=()=>n._zod.def.innerType});function Nk(n,e){return new _m({type:"nonoptional",innerType:n,...ye(e)})}const Dk=$("ZodCatch",(n,e)=>{sM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>xz(n,t,i,o),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function Mk(n,e){return new Dk({type:"catch",innerType:n,catchValue:typeof e=="function"?e:()=>e})}const zk=$("ZodPipe",(n,e)=>{rM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>Sz(n,t,i,o),n.in=e.in,n.out=e.out});function jm(n,e){return new zk({type:"pipe",in:n,out:e})}const kk=$("ZodReadonly",(n,e)=>{aM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>Ez(n,t,i,o),n.unwrap=()=>n._zod.def.innerType});function Rk(n){return new kk({type:"readonly",innerType:n})}const _k=$("ZodCustom",(n,e)=>{AM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>cz(n,t)});function jk(n,e={}){return tz(_k,n,e)}function Zk(n,e){return nz(n,e)}const Bk="compass.query/1",Pk=["file","module","package","namespace","class","struct","interface","trait","protocol","enum","enum_member","type_alias","function","method","constructor","property","field","variable","constant","parameter","import","export","macro","annotation","route","component","event","message","topic","queue","job","resource","schema","query","migration","config_key","database","database_schema","database_table","database_view","database_column","database_index","database_constraint","database_procedure","database_trigger"],Lk=["contains","calls","imports","exports","extends","implements","references","type_of","returns","instantiates","overrides","decorates","routes_to","reads","writes","aliases","registers","handles","publishes","subscribes","produces","consumes","schedules","triggers","tests","depends_on","documents","maps_to"],Gk=["controller","route_handler","middleware","service","resolver","consumer","producer","subscriber","repository","model","test","fixture","generated"],Fk=["search","callers","callees","impact","explore","node_trail"],rc=Y().min(1).refine(n=>n.includes("\\")||n.startsWith("/")||/^[A-Za-z]:/.test(n)?!1:n.split("/").every(e=>e!==""&&e!=="."&&e!==".."),"source path must be a safe repository-relative path"),Pr=Se({file:rc,startByte:he().int().nonnegative(),endByte:he().int().nonnegative(),startLine:he().int().positive(),startColumn:he().int().nonnegative(),endLine:he().int().positive(),endColumn:he().int().nonnegative()}).refine(n=>n.endByte>=n.startByte&&(n.endLine>n.startLine||n.endLine===n.startLine&&n.endColumn>=n.startColumn),"source anchor must be ordered"),Vk=lt(Pk),Uk=lt(Lk),Yk=lt(Gk),Hk=lt(Fk),Kk=lt(["structural_graph","program_ir"]),Wk=lt(["ast","config","convention","artifact","heuristic"]),ac=lt(["exact","inferred","ambiguous"]),Ac=lt(["exact","ambiguous","unresolved"]),Qk=Se({nodeId:Y().min(1),reason:Y().min(1),confidence:ac,score:he().finite().nullable().optional(),anchor:Pr.nullable().optional()}),WA=Se({layer:Kk,origin:Wk,extractor:Y().min(1),confidence:ac,anchor:Pr.nullable(),rule:Y().min(1).nullable(),wiringSite:Pr.nullable(),resolution:Ac,candidates:Fe(Qk).max(20).default([])}),Xk=Se({type:ct("file"),data:Se({contentDigest:Y().min(1),byteSize:he().int().nonnegative(),generated:Un()})}),$k=Se({type:ct("symbol"),data:Se({signature:Y().nullable().optional(),modifiers:Fe(Y()).default([]),overloadDiscriminator:Y().nullable().optional(),declaringType:Y().nullable().optional(),signatureDigest:Y().nullable().optional(),implementationDigest:Y().nullable().optional(),sourceDigest:Y().nullable().optional()})}),qk=Se({type:ct("import_export"),data:Se({specifier:Y(),importedName:Y().nullable().optional(),localName:Y().nullable().optional(),typeOnly:Un()})}),Jk=Se({type:ct("route"),data:Se({operation:Y(),path:Y(),originalPath:Y().nullable().optional(),declaringScope:Y(),resolution:Ac,middlewareCount:he().int().nonnegative()})}),eR=Se({type:ct("component"),data:Se({componentType:Y()})}),tR=Se({type:ct("resource"),data:Se({resourceKind:lt(["document","paper","image","concept","rationale"]),uri:Y().nullable().optional(),mediaType:Y().nullable().optional()})}),nR=Se({type:ct("messaging"),data:Se({transport:Y(),subject:Y(),declaringScope:Y()})}),iR=Se({type:ct("job"),data:Se({schedule:Y().nullable().optional(),queue:Y().nullable().optional()})}),gR=Se({type:ct("schema"),data:Se({dialect:Y().nullable().optional(),logicalDatabase:Y().nullable().optional(),namespace:Y().nullable().optional()})}),oR=Se({type:ct("query"),data:Se({dialect:Y().nullable().optional(),operation:Y().nullable().optional(),textDigest:Y().nullable().optional()})}),sR=Se({type:ct("config"),data:Se({format:Y(),keyPath:Y()})}),rR=Se({type:ct("database"),data:Se({logicalDatabase:Y(),databaseSchema:Y().nullable().optional()})}),aR=gc("type",[Xk,$k,qk,Jk,eR,tR,nR,iR,gR,oR,sR,rR]),AR=Se({type:ct("call"),data:Se({dispatch:lt(["static","virtual","dynamic"]),receiverType:Y().nullable().optional(),argumentCount:he().int().nonnegative().nullable().optional()})}),CR=Se({type:ct("route"),data:Se({stage:lt(["middleware","handler"]),position:he().int().nonnegative().nullable().optional(),operation:Y().nullable().optional()})}),IR=Se({type:ct("messaging"),data:Se({transport:Y(),subject:Y()})}),lR=Se({type:ct("schedule"),data:Se({expression:Y().nullable().optional()})}),cR=Se({type:ct("mapping"),data:Se({mappingKind:Y()})}),Zm=gc("type",[AR,CR,IR,lR,cR]),dR=Se({maxDepth:he().int().positive(),maxNodes:he().int().positive(),maxEdges:he().int().positive(),maxPaths:he().int().positive(),maxCandidates:he().int().positive(),maxSourceBytes:he().int().positive(),maxResponseBytes:he().int().positive()}),uR=Se({nodeId:Y().min(1),score:he().finite(),matchedFields:Fe(Y())}),hR=Se({id:Y().min(1),kind:Vk,roles:Fe(Yk),name:Y().min(1),qualifiedName:Y().min(1),language:Y().nullable(),framework:Y().nullable(),source:Pr.nullable(),details:aR.nullable(),evidence:Fe(WA)}),fR=Se({id:Y().min(1),source:Y().min(1),target:Y().min(1),kind:Uk,relationshipSite:Pr.nullable(),details:Zm.nullable(),evidence:Fe(WA)}),pR=Se({path:rc,contentDigest:Y().min(1),source:Y().nullable(),truncated:Un()}),mR=Se({id:Y().min(1),nodeIds:Fe(Y().min(1)),edgeIds:Fe(Y().min(1)),weakestResolution:Ac,weakestConfidence:ac}),vR=Se({code:lt(["no_match","ambiguous_match","direction_mismatch","unresolved_handler","incomplete_coverage","stale_source_digest","bounded_truncation","program_orphan","program_conflict","program_unavailable"]),message:Y().min(1),nodeId:Y().nullable(),path:rc.nullable()}),bR=Se({schema:ct(Bk),operation:Hk,results:Fe(uR),nodes:Fe(hR),edges:Fe(fR),files:Fe(pR),paths:Fe(mR),diagnostics:Fe(vR),limits:dR,truncated:Un()}),yR="compass.viewer.graph/1",Cc=mt({file:Y(),startLine:he().int().positive().optional(),endLine:he().int().positive().optional(),startByte:he().int().nonnegative().optional(),endByte:he().int().nonnegative().optional()}).passthrough(),wR=mt({field:Y().min(1),before:mo().optional(),after:mo().optional()}),Bm=mt({before:oc(Y(),mo()).optional(),after:oc(Y(),mo()).optional(),fields:Fe(wR)}),xR=mt({id:Y().min(1),label:Y(),kind:Y().optional(),community:he().int(),communityName:Y().optional(),degree:he().int().nonnegative().optional(),language:Y().optional(),signature:Y().optional(),size:he().positive().optional(),memberCount:he().int().nonnegative().optional(),detailAvailable:Un().optional(),learningStatus:Y().optional(),learningStale:Un().optional(),depth:he().int().nonnegative().optional(),root:Un().optional(),change:lt(["added","removed","changed","unchanged"]).optional(),evidence:Bm.optional(),codeEvidence:Fe(WA).optional(),source:Cc.optional(),color:mt({background:Y(),border:Y()}).passthrough().optional()}).passthrough(),SR=mt({id:Y().min(1),source:Y().min(1),target:Y().min(1),relation:Y(),weight:he().int().positive().optional(),change:lt(["added","removed","changed","unchanged"]).optional(),evidence:Bm.optional(),codeEvidence:Fe(WA).optional(),details:Zm.nullable().optional(),relationshipSite:Cc.optional(),confidence:lt(["extracted","inferred","ambiguous","aggregated"]).optional()}).passthrough(),ER=mt({id:he().int(),label:Y(),color:Y(),hidden:Un().default(!1)}).passthrough(),Eg=mt({schema:ct(yR),title:Y(),stats:mt({nodes:he().int().nonnegative(),edges:he().int().nonnegative(),communities:he().int().nonnegative(),aggregated:Un()}).passthrough(),nodes:Fe(xR),edges:Fe(SR),communities:Fe(ER),hyperedges:Fe(mo()).default([])}).passthrough(),TR=lt(["resolved","inferred","ambiguous","unresolved"]),Pm=mt({source_file:Y(),start_byte:he().int().nonnegative(),end_byte:he().int().nonnegative()}),OR=mt({id:Y(),symbol:Y().nullable(),name:Y(),file:Y().nullable(),anchor:Pm.nullable().optional(),startLine:he().int().positive().nullable().optional(),endLine:he().int().positive().nullable().optional(),startByte:he().int().nonnegative().nullable().optional(),endByte:he().int().nonnegative().nullable().optional(),graphNodeId:Y().nullable(),unresolved:Un(),evidenceLayer:lt(["structural_graph","program_ir","combined"]).optional()}),NR=Dm([mt({anchor:Pm,evidence:Fe(Y())}),mt({sourceFile:Y().nullable(),line:he().int().positive().nullable(),startByte:he().int().nonnegative().nullable(),endByte:he().int().nonnegative().nullable(),evidence:Fe(Y())})]),DR=mt({id:Y(),source:Y(),target:Y(),callee:Y(),resolution:TR,confidence:Y().nullable().optional(),callSites:Fe(NR),evidenceLayer:lt(["structural_graph","program_ir","combined"]).optional()}),MR=mt({schema:lt(["compass.program.call_graph/1","compass.call_graph/1"]),rootSymbol:Y(),direction:lt(["callers","callees","both"]),depth:he().int().positive(),nodes:Fe(OR),edges:Fe(DR),truncated:Un(),continuations:Fe(mt({symbol:Y(),direction:lt(["callers","callees","both"]),nextDepth:he().int().positive()})),coverage:mt({resolved:he().int().nonnegative(),inferred:he().int().nonnegative(),ambiguous:he().int().nonnegative(),unresolved:he().int().nonnegative(),evidenceLayer:lt(["structural_graph","program_ir","combined"]).optional(),partial:Un().optional(),limitations:Fe(Y()).optional(),warning:Y()})}),Lm=lt(["extracted","inferred","ambiguous"]),zR=lt(["production","test","generated","vendor","unknown"]),kR=mt({schema:ct("compass.viewer.callflow/1"),title:Y(),sections:Fe(mt({id:Y(),name:Y(),communities:Fe(Y()),nodeCount:he().int().nonnegative(),internalCallCount:he().int().nonnegative(),nodes:Fe(mt({id:Y(),label:Y(),kind:Y(),sourceFile:Y().nullable(),scope:zR})),edges:Fe(mt({source:Y(),target:Y(),relation:Y(),confidence:Lm}))})),overviewLinks:Fe(mt({sourceSection:Y(),targetSection:Y(),calls:he().int().nonnegative()})),crossSectionCalls:Fe(mt({source:Y(),target:Y(),sourceSection:Y(),targetSection:Y(),relation:Y(),confidence:Lm})),coverage:mt({internal:he().int().nonnegative(),crossSection:he().int().nonnegative(),unassigned:he().int().nonnegative()}),reportHighlights:Fe(Y()),statistics:mt({nodes:he().int().nonnegative(),edges:he().int().nonnegative(),communities:he().int().nonnegative(),hyperedges:he().int().nonnegative(),extracted:he().int().nonnegative(),inferred:he().int().nonnegative(),ambiguous:he().int().nonnegative()}),provenance:mt({projectName:Y(),builtAtCommit:Y().nullable(),generatedAt:Y().nullable()})}),RR="compass.viewer.workbench/1",_R=Se({status:lt(["complete","summary","partial"]),truncated:Un(),nodes:he().int().nonnegative(),edges:he().int().nonnegative(),limitations:Fe(Y()).default([])}),vo={id:Y().min(1),title:Y().min(1),description:Y(),coverage:_R},jR=lt(["dependencies","routes","data","messaging","tests","provenance"]),ZR=gc("kind",[Se({...vo,kind:ct("code"),model:Eg,communityDetails:oc(Y(),Eg).default({})}),Se({...vo,kind:ct("call"),root:Y(),graph:MR}),Se({...vo,kind:ct("impact"),root:Y(),result:bR}),Se({...vo,kind:ct("architecture"),model:kR}),Se({...vo,kind:ct("history"),baseRevision:Y(),targetRevision:Y(),before:Eg,after:Eg}),Se({...vo,kind:ct("affected"),root:Y(),relations:Fe(Y()),depth:he().int().nonnegative(),model:Eg}),Se({...vo,kind:ct("artifact"),lens:jR,relations:Fe(Y()),model:Eg})]),BR=Se({schema:ct(RR),title:Y(),graphIdentity:Y().min(1),defaultView:Y(),views:Fe(ZR).min(1)}).superRefine((n,e)=>{const t=new Set;for(const[i,o]of n.views.entries())t.has(o.id)&&e.addIssue({code:"custom",path:["views",i,"id"],message:`duplicate workbench view id '${o.id}'`}),t.add(o.id);t.has(n.defaultView)||e.addIssue({code:"custom",path:["defaultView"],message:"defaultView must identify one included view"})});var Z=Yl();const PR=KO({__proto__:null,default:WO(Z)},[Z]);const LR=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),GR=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,i)=>i?i.toUpperCase():t.toLowerCase()),Gm=n=>{const e=GR(n);return e.charAt(0).toUpperCase()+e.slice(1)},Fm=(...n)=>n.filter((e,t,i)=>!!e&&e.trim()!==""&&i.indexOf(e)===t).join(" ").trim(),FR=n=>{for(const e in n)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var VR={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const UR=Z.forwardRef(({color:n="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:i,className:o="",children:r,iconNode:A,...I},l)=>Z.createElement("svg",{ref:l,...VR,width:e,height:e,stroke:n,strokeWidth:i?Number(t)*24/Number(e):t,className:Fm("lucide",o),...!r&&!FR(I)&&{"aria-hidden":"true"},...I},[...A.map(([c,h])=>Z.createElement(c,h)),...Array.isArray(r)?r:[r]]));const _e=(n,e)=>{const t=Z.forwardRef(({className:i,...o},r)=>Z.createElement(UR,{ref:r,iconNode:e,className:Fm(`lucide-${LR(Gm(n))}`,`lucide-${n}`,i),...o}));return t.displayName=Gm(n),t};const YR=_e("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);const HR=_e("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const KR=_e("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const WR=_e("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);const QR=_e("badge-check",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const XR=_e("boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);const $R=_e("braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const qR=_e("circle-dot-dashed",[["path",{d:"M10.1 2.18a9.93 9.93 0 0 1 3.8 0",key:"1qdqn0"}],["path",{d:"M17.6 3.71a9.95 9.95 0 0 1 2.69 2.7",key:"1bq7p6"}],["path",{d:"M21.82 10.1a9.93 9.93 0 0 1 0 3.8",key:"1rlaqf"}],["path",{d:"M20.29 17.6a9.95 9.95 0 0 1-2.7 2.69",key:"1xk03u"}],["path",{d:"M13.9 21.82a9.94 9.94 0 0 1-3.8 0",key:"l7re25"}],["path",{d:"M6.4 20.29a9.95 9.95 0 0 1-2.69-2.7",key:"1v18p6"}],["path",{d:"M2.18 13.9a9.93 9.93 0 0 1 0-3.8",key:"xdo6bj"}],["path",{d:"M3.71 6.4a9.95 9.95 0 0 1 2.7-2.69",key:"1jjmaz"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);const Vm=_e("circle-question-mark",[["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"}]]);const JR=_e("compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const QA=_e("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const e3=_e("file-code-2",[["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"}]]);const t3=_e("file-cog",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m2.305 15.53.923-.382",key:"yfp9st"}],["path",{d:"m3.228 12.852-.924-.383",key:"bckynb"}],["path",{d:"M4.677 21.5a2 2 0 0 0 1.313.5H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2.5",key:"1yo3oz"}],["path",{d:"m4.852 11.228-.383-.923",key:"1j88i9"}],["path",{d:"m4.852 16.772-.383.924",key:"sag1dv"}],["path",{d:"m7.148 11.228.383-.923",key:"rj39hk"}],["path",{d:"m7.53 17.696-.382-.924",key:"1uu5cs"}],["path",{d:"m8.772 12.852.923-.383",key:"13811l"}],["path",{d:"m8.772 15.148.923.383",key:"z1a5l0"}],["circle",{cx:"6",cy:"14",r:"3",key:"a1xfv6"}]]);const n3=_e("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"}]]);const Um=_e("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);const Ym=_e("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]);const Ic=_e("git-fork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);const i3=_e("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"}]]);const g3=_e("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);const o3=_e("map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);const Hm=_e("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]);const s3=_e("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const r3=_e("move",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m19 9 3 3-3 3",key:"1mg7y2"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}],["path",{d:"m9 5 3-3 3 3",key:"l8vdw6"}]]);const lc=_e("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);const a3=_e("panel-left-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);const A3=_e("panel-left-open",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);const Km=_e("panel-right-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);const C3=_e("panel-right-open",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]]);const Wm=_e("pause",[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]);const I3=_e("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);const Qm=_e("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Xm=_e("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const $m=_e("route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);const qm=_e("scan-search",[["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"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);const l3=_e("search-code",[["path",{d:"m13 13.5 2-2.5-2-2.5",key:"1rvxrh"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}],["path",{d:"M9 8.5 7 11l2 2.5",key:"6ffwbx"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const Jm=_e("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const c3=_e("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const d3=_e("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const u3=_e("signpost",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M12 3v3",key:"1n5kay"}],["path",{d:"M18 6a2 2 0 0 1 1.387.56l2.307 2.22a1 1 0 0 1 0 1.44l-2.307 2.22A2 2 0 0 1 18 13H6a2 2 0 0 1-1.387-.56l-2.306-2.22a1 1 0 0 1 0-1.44l2.306-2.22A2 2 0 0 1 6 6z",key:"gqqp9m"}]]);const h3=_e("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);const f3=_e("tags",[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]]);const XA=_e("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const p3=_e("waypoints",[["circle",{cx:"12",cy:"4.5",r:"2.5",key:"r5ysbb"}],["path",{d:"m10.2 6.3-3.9 3.9",key:"1nzqf6"}],["circle",{cx:"4.5",cy:"12",r:"2.5",key:"jydg6v"}],["path",{d:"M7 12h10",key:"b7w52i"}],["circle",{cx:"19.5",cy:"12",r:"2.5",key:"1piiel"}],["path",{d:"m13.8 17.7 3.9-3.9",key:"1wyg1y"}],["circle",{cx:"12",cy:"19.5",r:"2.5",key:"13o1pw"}]]);const m3=_e("zoom-in",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);const v3=_e("zoom-out",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),ev=new Set(["color","change","evidence"]),b3=new Set(["anchor","anchors","columnEnd","columnStart","community","communityName","community_name","degree","endByte","endColumn","endLine","lineEnd","lineStart","line_end","line_start","location","normLabel","norm_label","relationshipSite","relationship_site","size","sourceDigest","sourceFile","sourceHash","source_digest","source_file","source_hash","startByte","startColumn","startLine","wiringSite","wiring_site"]);function $A(n,e){const t=qA(n),i=qA(e);return{...t?{before:t}:{},...i?{after:i}:{},fields:dc(t,i)}}function tv(n,e,t){const i=qA(n),o=qA(e),r=cc(n,t),A=cc(e,t);return{...i?{before:i}:{},...o?{after:o}:{},fields:dc(r,A)}}function y3(n,e){return cc(n,e)??{}}function w3(n,e=240){const t=n===void 0?"Not recorded":typeof n=="string"?n:JSON.stringify(n,null,Lr(n)?2:void 0)??String(n);return t.length<=e?{text:t,truncated:!1}:{text:`${t.slice(0,Math.max(0,e-1)).trimEnd()}…`,truncated:!0}}function qA(n){if(n)return gv(n)}function cc(n,e){return n?iv(n,e==="node"?new Set(["source"]):new Set(["id","key"])):void 0}function nv(n){return Array.isArray(n)?n.map(nv):Lr(n)?iv(n):n}function iv(n,e=new Set){return Object.fromEntries(Object.keys(n).filter(t=>!ev.has(t)&&!b3.has(t)&&!e.has(t)).sort((t,i)=>t.localeCompare(i)).map(t=>[t,nv(n[t])]))}function JA(n){return Array.isArray(n)?n.map(JA):Lr(n)?gv(n):n}function gv(n){return Object.fromEntries(Object.keys(n).filter(e=>!ev.has(e)).sort((e,t)=>e.localeCompare(t)).map(e=>[e,JA(n[e])]))}function dc(n,e,t=""){const i=new Set([...Object.keys(n??{}),...Object.keys(e??{})]),o=[];for(const r of[...i].sort((A,I)=>A.localeCompare(I))){const A=t?`${t}.${r}`:r,I=n?.[r],l=e?.[r];Lr(I)&&Lr(l)?o.push(...dc(I,l,A)):x3(I,l)||o.push({field:A,...I!==void 0?{before:I}:{},...l!==void 0?{after:l}:{}})}return o}function x3(n,e){return JSON.stringify(JA(n))===JSON.stringify(JA(e))}function Lr(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function S3({node:n,edges:e,nodes:t,sourceRevisions:i,onFocus:o,onOpenSource:r}){const A=rv(n.evidence?.before),I=rv(n.evidence?.after);return f.jsxs(f.Fragment,{children:[n.evidence?.fields.length?f.jsxs("section",{className:"compass-record-evidence","aria-labelledby":"compass-node-changes-title",children:[f.jsxs("div",{className:"compass-evidence-heading",children:[f.jsx("h3",{id:"compass-node-changes-title",children:E3(n.change)}),f.jsxs("span",{children:[n.evidence.fields.length," fields"]})]}),f.jsx(ov,{fields:n.evidence.fields}),n.change==="changed"&&(A||I)&&f.jsxs("div",{className:"compass-evidence-source-actions",children:[A&&f.jsxs("button",{type:"button",onClick:()=>r(A,i?.before),children:[f.jsx(QA,{"aria-hidden":"true"}),"Open before"]}),I&&f.jsxs("button",{type:"button",onClick:()=>r(I,i?.after),children:[f.jsx(QA,{"aria-hidden":"true"}),"Open after"]})]})]}):null,f.jsxs("section",{className:"compass-relationship-evidence","aria-labelledby":"compass-relationships-title",children:[f.jsxs("div",{className:"compass-neighbors-heading",children:[f.jsx("span",{id:"compass-relationships-title",children:"Relationships"}),f.jsx("strong",{children:e.length})]}),e.length?f.jsx("div",{className:"compass-relationship-list",children:e.map(l=>{const c=l.source===n.id?l.target:l.source,h=t.get(c);return f.jsxs("details",{children:[f.jsxs("summary",{children:[f.jsx("span",{className:"compass-change-badge","data-change":l.change,children:av(l.change)}),f.jsx("span",{className:"compass-relationship-target",children:h?.label??c}),f.jsx("small",{children:l.relation}),l.confidence&&f.jsx("i",{children:l.confidence})]}),f.jsxs("div",{className:"compass-relationship-detail",children:[l.change==="changed"&&l.evidence?.fields.length?f.jsx(ov,{fields:l.evidence.fields}):f.jsxs("p",{children:[av(l.change)," relationship: ",l.source," → ",l.target]}),f.jsxs("button",{type:"button",onClick:()=>o(c),children:["Focus ",h?.label??c]})]})]},l.id)})}):f.jsx("span",{className:"compass-empty",children:"No connected relationships"})]})]})}function ov({fields:n}){return f.jsx("div",{className:"compass-field-table-wrap",children:f.jsxs("table",{className:"compass-field-table",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:"Field"}),f.jsx("th",{children:"Before"}),f.jsx("th",{children:"After"})]})}),f.jsx("tbody",{children:n.map(e=>f.jsxs("tr",{children:[f.jsx("th",{scope:"row",children:e.field}),f.jsx(sv,{value:e.before}),f.jsx(sv,{value:e.after})]},e.field))})]})})}function sv({value:n}){const e=w3(n);return f.jsxs("td",{children:[f.jsx("code",{children:e.text}),e.truncated&&f.jsx("span",{className:"compass-value-truncated",children:"Value shortened"})]})}function rv(n){const e=Cc.safeParse(n?.source);return e.success?e.data:void 0}function av(n){return!n||n==="unchanged"?"Context":`${n[0]?.toLocaleUpperCase()}${n.slice(1)}`}function E3(n){return n==="added"?"Added symbol metadata":n==="removed"?"Removed symbol metadata":"What changed"}const Av=100,Cv={changed:0,added:1,removed:2,unchanged:3};function T3({nodes:n,query:e,selectedId:t,onFocus:i}){const[o,r]=Z.useState(!1),A=e.trim().toLocaleLowerCase(),I=n.filter(c=>c.change&&c.change!=="unchanged").filter(c=>!A||c.label.toLocaleLowerCase().includes(A)||c.kind?.toLocaleLowerCase().includes(A)||c.source?.file.toLocaleLowerCase().includes(A)).sort((c,h)=>Cv[c.change??"unchanged"]-Cv[h.change??"unchanged"]||c.label.localeCompare(h.label)||c.id.localeCompare(h.id)),l=o?I:I.slice(0,Av);return f.jsxs("section",{className:"compass-changed-symbols","aria-labelledby":"compass-changed-symbols-title",children:[f.jsxs("div",{className:"compass-section-heading",children:[f.jsx("h2",{id:"compass-changed-symbols-title",children:"Changed symbols"}),f.jsx("span",{children:I.length})]}),l.length?f.jsx("div",{className:"compass-changed-symbol-list",children:l.map(c=>f.jsxs("button",{type:"button","aria-pressed":c.id===t,"data-change":c.change,onClick:()=>i(c.id),children:[f.jsx("span",{className:"compass-changed-symbol-status",children:O3(c.change)}),f.jsx("strong",{children:c.label}),f.jsx("small",{children:c.source?.file??c.kind??"Graph symbol"})]},c.id))}):f.jsx("p",{className:"compass-empty",children:A?"No affected symbols match this search.":"No symbol changes."}),!o&&I.length>Av&&f.jsxs("button",{className:"compass-changed-symbol-expand",type:"button",onClick:()=>r(!0),children:["Show all ",I.length.toLocaleString()," affected symbols"]})]})}function O3(n){return!n||n==="unchanged"?"Context":`${n[0]?.toLocaleUpperCase()}${n.slice(1)}`}function Iv({evidence:n,diagnostics:e=[],truncated:t=!1,title:i="Trust evidence",onOpenSource:o}){return!n.length&&!e.length&&!t?null:f.jsxs("section",{className:"compass-code-evidence","aria-label":i,children:[f.jsxs("div",{className:"compass-evidence-heading",children:[f.jsx("h3",{children:i}),f.jsxs("span",{children:[n.length," ",n.length===1?"record":"records"]})]}),t&&f.jsxs("p",{className:"compass-code-diagnostic","data-severity":"warning",role:"status",children:[f.jsx(XA,{"aria-hidden":"true"}),"Results reached a configured limit. Narrow the query or raise one bound."]}),e.map(r=>f.jsxs("p",{className:"compass-code-diagnostic","data-severity":r.code==="no_match"?"info":"warning",role:"status",children:[r.code==="no_match"?f.jsx(Vm,{"aria-hidden":"true"}):f.jsx(XA,{"aria-hidden":"true"}),f.jsxs("span",{children:[f.jsx("strong",{children:M3(r.code)}),r.message]})]},`${r.code}:${r.message}`)),f.jsx("div",{className:"compass-code-evidence-ledger",children:n.map((r,A)=>{const I=D3(r),l=r.wiringSite??r.anchor;return f.jsxs("article",{className:"compass-code-evidence-entry","data-status":I.key,children:[f.jsx("span",{className:"compass-code-evidence-icon","aria-hidden":"true",children:f.jsx(N3,{item:r})}),f.jsxs("div",{className:"compass-code-evidence-copy",children:[f.jsxs("div",{className:"compass-code-evidence-status",children:[f.jsx("strong",{children:I.label}),f.jsx("span",{children:r.layer==="program_ir"?"Program IR":"Code graph"})]}),f.jsxs("dl",{children:[f.jsxs("div",{children:[f.jsx("dt",{children:"Extractor"}),f.jsx("dd",{children:r.extractor})]}),f.jsxs("div",{children:[f.jsx("dt",{children:"Confidence"}),f.jsx("dd",{children:r.confidence})]}),r.rule&&f.jsxs("div",{children:[f.jsx("dt",{children:"Rule"}),f.jsx("dd",{children:r.rule})]})]}),l&&(o?f.jsxs("button",{className:"compass-code-evidence-source",type:"button",onClick:()=>o(l),children:[f.jsx(QA,{"aria-hidden":"true"}),lv(r,l)]}):f.jsx("span",{className:"compass-code-evidence-source",children:lv(r,l)})),r.candidates.length>0&&f.jsxs("div",{className:"compass-code-candidates",children:[f.jsx("span",{children:"Retained candidates"}),f.jsx("ul",{children:r.candidates.map(c=>f.jsxs("li",{children:[f.jsx("code",{children:c.nodeId}),f.jsx("span",{children:c.reason}),f.jsx("small",{children:c.confidence})]},`${c.nodeId}:${c.reason}`))})]})]})]},`${r.layer}:${r.extractor}:${A}`)})})]})}function N3({item:n}){return n.resolution==="unresolved"?f.jsx(Vm,{}):n.resolution==="ambiguous"||n.confidence==="ambiguous"?f.jsx(XA,{}):n.origin==="heuristic"?f.jsx(Ic,{}):n.origin==="config"?f.jsx(t3,{}):n.origin==="convention"?f.jsx(u3,{}):f.jsx(QR,{})}function D3(n){return n.resolution==="unresolved"?{key:"unresolved",label:"Unresolved"}:n.resolution==="ambiguous"||n.confidence==="ambiguous"?{key:"ambiguous",label:"Ambiguous"}:n.origin==="heuristic"?{key:"heuristic",label:"Heuristic"}:n.origin==="config"?{key:"config",label:"Configuration"}:n.origin==="convention"?{key:"convention",label:"Convention"}:{key:"exact",label:"Exact"}}function lv(n,e){return`${n.origin==="heuristic"?"Wired at":"Evidence at"} ${e.file}:${e.startLine}`}function M3(n){return`${n.replaceAll("_"," ")}: `}function cv(n){return uv(n.source)}function dv(n){return uv(n.relationshipSite)}function uv(n){return n?.file.trim()&&(n.startLine!==void 0||n.endLine!==void 0||n.startByte!==void 0||n.endByte!==void 0)?n:void 0}const hv=200;function z3(n,e){const t=e.trim().toLocaleLowerCase();return(t?n.filter(o=>o.label.toLocaleLowerCase().includes(t)||String(o.id).includes(t)):n).slice(0,hv)}function k3(n){const e=n.source?.startLine,t=n.source?.endLine;if(e!==void 0)return t!==void 0&&t!==e?`${e}–${t}`:String(e)}function fv(n){const e=n.source?.startLine,t=n.source?.endLine;if(e!==void 0)return t!==void 0&&t!==e?{text:`Lines ${e}–${t}`,action:`at lines ${e}–${t}`}:{text:`Line ${e}`,action:`at line ${e}`};const i=n.source?.startByte,o=n.source?.endByte;if(i!==void 0)return o!==void 0&&o!==i?{text:`Bytes ${i}–${o}`,action:`at bytes ${i}–${o}`}:{text:`Byte ${i}`,action:`at byte ${i}`}}function pv(n,e){const t=fv(n);return`Open source ${e.file}${t?` ${t.action}`:""}`}function mv(n){return n==="unchanged"?"Context":n?`${n[0]?.toLocaleUpperCase()}${n.slice(1)}`:void 0}function R3(n){if(n)return{added:"var(--vscode-gitDecoration-addedResourceForeground, #2ea043)",removed:"var(--vscode-gitDecoration-deletedResourceForeground, #f85149)",changed:"var(--vscode-gitDecoration-modifiedResourceForeground, #d29922)",unchanged:"var(--vscode-descriptionForeground, #6e7781)"}[n]}function _3({model:n,selected:e,neighbors:t,connectedEdges:i,query:o,matches:r,hiddenCommunities:A,comparisonMode:I,sourceRevisions:l,queryResult:c,renderedEdgeCount:h,showHeader:p,onQueryChange:m,onFocus:b,onOpenSource:w,onOpenCommunity:S,onQueryNode:x,onToggleCommunity:O,onSetAllVisible:E,collapsed:R,onToggleCollapsed:B}){const[W,ne]=Z.useState(0),L=e?cv(e):void 0,G=e?k3(e):void 0,Ie=e?fv(e):void 0,fe=Z.useMemo(()=>{const K=new Map;for(const ie of n.nodes)K.set(ie.community,(K.get(ie.community)??0)+1);return K},[n.nodes]),Be=A.size===0,Te=Z.useMemo(()=>new Map(n.nodes.map(K=>[K.id,K])),[n.nodes]),Ve=(e?c?.nodes.find(K=>K.id===e.id):void 0)?.evidence??e?.codeEvidence??[],Ce=e?c?c.edges.filter(K=>K.source===e.id||K.target===e.id).flatMap(K=>K.evidence):i.flatMap(K=>K.codeEvidence??[]):[],M=K=>{b(K.id),m(""),ne(0)},Q=K=>{!r.length&&K.key!=="Escape"||(K.key==="ArrowDown"?(K.preventDefault(),ne((W+1)%r.length)):K.key==="ArrowUp"?(K.preventDefault(),ne((W-1+r.length)%r.length)):K.key==="Enter"&&r[W]?(K.preventDefault(),M(r[W])):K.key==="Escape"&&(m(""),ne(0)))};return R?f.jsxs("aside",{className:"compass-graph-inspector compass-graph-inspector-collapsed","aria-label":"Graph inspector",children:[f.jsx("button",{className:"compass-inspector-disclosure compass-inspector-expand",type:"button","aria-label":"Expand graph inspector",title:"Expand graph inspector",onClick:B,children:f.jsx(C3,{"aria-hidden":"true"})}),f.jsx("span",{className:"compass-inspector-rail-label","aria-hidden":"true",children:"Inspector"})]}):f.jsxs("aside",{className:"compass-graph-inspector","aria-label":"Graph inspector",children:[p&&f.jsxs("header",{className:"compass-inspector-header",children:[f.jsx("span",{className:"compass-product-mark","aria-hidden":"true",children:f.jsx(JR,{})}),f.jsxs("span",{className:"compass-inspector-title",children:[f.jsx("strong",{children:"Compass"}),f.jsx("small",{children:n.title})]}),f.jsx("button",{className:"compass-inspector-disclosure",type:"button","aria-label":"Collapse graph inspector",title:"Collapse graph inspector",onClick:B,children:f.jsx(Km,{"aria-hidden":"true"})})]}),f.jsxs("div",{className:"compass-inspector-search",role:"search",children:[f.jsx("label",{className:"sr-only",htmlFor:"compass-node-search",children:"Search graph nodes"}),f.jsxs("div",{className:"compass-inspector-search-row",children:[f.jsxs("div",{className:"compass-search-field",children:[f.jsx(Jm,{"aria-hidden":"true"}),f.jsx("input",{id:"compass-node-search",type:"search",role:"combobox",value:o,placeholder:"Search nodes and files",autoComplete:"off","aria-controls":"compass-search-results","aria-autocomplete":"list","aria-expanded":r.length>0,"aria-activedescendant":r[W]?`compass-search-result-${W}`:void 0,onChange:K=>{m(K.target.value),ne(0)},onKeyDown:Q})]}),!p&&f.jsx("button",{className:"compass-inspector-disclosure compass-inspector-search-disclosure",type:"button","aria-label":"Collapse graph inspector",title:"Collapse graph inspector",onClick:B,children:f.jsx(Km,{"aria-hidden":"true"})})]}),r.length>0&&f.jsx("div",{id:"compass-search-results",className:"compass-search-results",role:"listbox","aria-label":"Matching nodes",children:r.map((K,ie)=>f.jsxs("button",{id:`compass-search-result-${ie}`,type:"button",role:"option","aria-selected":ie===W,className:"compass-search-item",onMouseEnter:()=>ne(ie),onClick:()=>M(K),children:[f.jsx("strong",{children:K.label}),f.jsx("span",{children:K.source?.file??K.kind??"Graph node"})]},K.id))})]}),f.jsxs("section",{className:"compass-info-panel","aria-labelledby":"compass-info-title",children:[f.jsxs("div",{className:"compass-section-heading",children:[f.jsx("h2",{id:"compass-info-title",children:"Inspector"}),f.jsx("span",{children:e?"Pinned":"Node details"})]}),e?f.jsxs("div",{className:"compass-info-content",children:[f.jsxs("div",{className:"compass-node-identity",children:[f.jsx("span",{className:"compass-node-swatch","aria-hidden":"true",style:{background:R3(e.change)??e.color?.background??n.communities.find(K=>K.id===e.community)?.color}}),f.jsxs("span",{children:[f.jsx("strong",{children:e.label}),f.jsx("small",{children:e.kind??"Symbol"})]}),mv(e.change)&&f.jsx("span",{className:"compass-change-badge","data-change":e.change,children:mv(e.change)})]}),f.jsxs("dl",{className:"compass-metadata-grid",children:[f.jsxs("div",{children:[f.jsx("dt",{children:"Community"}),f.jsx("dd",{children:e.communityName??n.communities.find(K=>K.id===e.community)?.label??e.community})]}),f.jsxs("div",{children:[f.jsx("dt",{children:"Degree"}),f.jsx("dd",{children:e.degree??t.length})]}),e.language&&f.jsxs("div",{children:[f.jsx("dt",{children:"Language"}),f.jsx("dd",{children:e.language})]}),G&&f.jsxs("div",{children:[f.jsx("dt",{children:"Lines"}),f.jsx("dd",{children:G})]}),f.jsx("div",{className:"compass-metadata-wide compass-source-metadata","data-interactive":L!==void 0,children:L?f.jsxs(f.Fragment,{children:[f.jsx("dt",{className:"sr-only",children:"Source"}),f.jsx("dd",{children:f.jsxs("button",{className:"compass-source-card",type:"button","aria-label":pv(e,L),title:pv(e,L),onClick:()=>w(L,e.change==="removed"?l?.before:l?.after),children:[f.jsxs("span",{className:"compass-source-copy",children:[f.jsx("span",{className:"compass-source-eyebrow","aria-hidden":"true",children:"Source"}),f.jsx("span",{className:"compass-source-path",children:L.file}),Ie&&f.jsx("span",{className:"compass-source-range",children:Ie.text})]}),f.jsx(QA,{"aria-hidden":"true"})]})})]}):f.jsxs(f.Fragment,{children:[f.jsx("dt",{children:"Source"}),f.jsx("dd",{title:e.source?.file??"Not recorded",children:e.source?.file??"Not recorded"})]})})]}),e.signature&&f.jsx("code",{className:"compass-signature-block",children:e.signature}),x&&f.jsxs("div",{className:"compass-code-query-actions","aria-label":"Code graph queries",children:[f.jsx("button",{type:"button",onClick:()=>x("callers",e.id),children:"Callers"}),f.jsx("button",{type:"button",onClick:()=>x("callees",e.id),children:"Callees"}),f.jsx("button",{type:"button",onClick:()=>x("impact",e.id),children:"Impact"})]}),f.jsx(Iv,{evidence:Ve,diagnostics:c?.diagnostics,truncated:c?.truncated,title:"Node evidence",onOpenSource:w}),f.jsx(Iv,{evidence:Ce,title:"Relationship evidence",onOpenSource:w}),n.stats.aggregated&&e.memberCount!==void 0&&e.detailAvailable!==!1&&S&&f.jsxs("button",{className:"compass-inspector-action",type:"button",onClick:()=>S(e.community),children:[I?"Inspect changes":"Open community",f.jsxs("span",{children:[e.memberCount.toLocaleString()," ",I?"current symbols":"members"]})]}),n.stats.aggregated&&e.memberCount!==void 0&&e.detailAvailable===!1&&f.jsx("p",{className:"compass-empty",children:"This community detail was omitted to keep the standalone HTML export bounded. Open the graph in VS Code or export this community as JSON for full inspection."}),I?f.jsx(S3,{node:e,edges:i,nodes:Te,sourceRevisions:l,onFocus:b,onOpenSource:w}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"compass-neighbors-heading",children:[f.jsx("span",{children:"Connected nodes"}),f.jsx("strong",{children:t.length})]}),f.jsx("div",{className:"compass-neighbors-list",children:t.length?t.map(K=>f.jsxs("button",{type:"button",className:"compass-neighbor-link",title:K.label,onClick:()=>b(K.id),children:[f.jsx("span",{className:"compass-neighbor-dot","aria-hidden":"true",style:{background:K.color?.background??n.communities.find(ie=>ie.id===K.community)?.color??"var(--border)"}}),f.jsx("span",{className:"compass-neighbor-label",children:K.label})]},K.id)):f.jsx("span",{className:"compass-empty",children:"No connected nodes"})})]})]}):f.jsx("p",{className:"compass-empty",children:"Select a node to inspect its relationships."})]}),I&&!n.stats.aggregated&&f.jsx(T3,{nodes:n.nodes,query:o,selectedId:e?.id,onFocus:b}),f.jsx("section",{className:"compass-community-panel","aria-labelledby":"compass-communities-title","data-secondary":I,children:I?f.jsxs("details",{children:[f.jsxs("summary",{id:"compass-communities-title",children:["Communities",f.jsx("span",{children:n.communities.length})]}),f.jsx(vv,{model:n,communityCounts:fe,hiddenCommunities:A,allVisible:Be,onSetAllVisible:E,onToggleCommunity:O})]}):f.jsxs(f.Fragment,{children:[f.jsx("h2",{id:"compass-communities-title",children:"Communities"}),f.jsx(vv,{model:n,communityCounts:fe,hiddenCommunities:A,allVisible:Be,onSetAllVisible:E,onToggleCommunity:O})]})}),f.jsxs("footer",{className:"compass-graph-stats",children:[n.stats.nodes.toLocaleString()," nodes · ",n.stats.edges.toLocaleString()," edges",hz3(n.communities,A),[n.communities,A]),c=Z.useMemo(()=>{const h=A.trim().toLocaleLowerCase();return h?n.communities.filter(p=>p.label.toLocaleLowerCase().includes(h)||String(p.id).includes(h)).length:n.communities.length},[n.communities,A]);return f.jsxs("div",{className:"compass-community-controls",children:[f.jsxs("label",{className:"compass-community-control",children:[f.jsx("input",{type:"checkbox",checked:i,onChange:h=>o(h.target.checked)}),f.jsx("span",{children:"Select all"})]}),n.communities.length>hv&&f.jsxs("label",{className:"compass-community-search",children:[f.jsx("span",{className:"sr-only",children:"Filter communities"}),f.jsx(Jm,{"aria-hidden":"true"}),f.jsx("input",{type:"search",value:A,placeholder:"Filter communities",onChange:h=>I(h.target.value)})]}),f.jsx("div",{className:"compass-community-list",children:l.map(h=>{const p=!t.has(h.id);return f.jsxs("label",{className:"compass-community-item","data-hidden":!p,children:[f.jsx("input",{type:"checkbox",checked:p,onChange:()=>r(h.id)}),f.jsx("span",{className:"compass-community-dot","aria-hidden":"true",style:{background:h.color}}),f.jsx("span",{className:"compass-community-label",children:h.label}),f.jsx("small",{children:e.get(h.id)??0})]},h.id)})}),c>l.length&&f.jsxs("p",{className:"compass-community-limit",role:"status",children:["Showing ",l.length.toLocaleString()," of"," ",c.toLocaleString()," communities. Filter to find another community."]})]})}function j3({className:n="compass-load-logo"}){return f.jsx("svg",{className:n,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:f.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3.554 21.529c1.797 1.221 4.943-.038 11.236-2.554 1.342-.537 2.013-.806 2.54-1.267q.201-.177.378-.378c.461-.527.73-1.198 1.267-2.54 2.515-6.293 3.775-9.44 2.554-11.236a4.1 4.1 0 0 0-1.083-1.083c-1.797-1.221-4.944.037-11.236 2.554-1.342.537-2.013.806-2.54 1.267q-.201.177-.378.378c-.461.527-.73 1.198-1.267 2.54-2.517 6.292-3.775 9.439-2.554 11.236.29.426.657.793 1.083 1.083M8.25 12a3.75 3.75 0 1 1 7.5 0 3.75 3.75 0 0 1-7.5 0m1.5 0a2.25 2.25 0 1 1 4.5 0 2.25 2.25 0 0 1-4.5 0"})})}const Z3=1e4;function bv(n){const[e,t]=Z.useState(!1);Z.useEffect(()=>{if(n.kind!=="layout"){t(!1);return}const A=window.setTimeout(()=>{t(!0)},Z3);return()=>window.clearTimeout(A)},[n.kind]);const i=n.kind==="community",o=i?`Opening ${n.communityLabel}`:e?"Still arranging this graph":"Arranging graph layout",r=i?"Fetching symbols and relationships for this community.":e?"This graph is taking longer than expected. You can open the current layout now.":"Positioning nodes and relationships for a readable first view.";return f.jsxs("section",{className:"compass-graph-transition","data-kind":n.kind,role:"status","aria-live":"polite","aria-atomic":"true",children:[f.jsxs("div",{className:"compass-load-visual","data-state":"loading","aria-hidden":"true",children:[f.jsx("span",{className:"compass-load-mark",children:f.jsx(j3,{})}),f.jsx("span",{className:"compass-load-progress",children:f.jsx("i",{})})]}),f.jsxs("div",{className:"compass-load-copy",children:[f.jsx("span",{className:"compass-load-eyebrow",children:"Compass graph"}),f.jsx("h1",{children:o}),f.jsx("p",{className:"compass-graph-transition-description",children:r}),!i&&e&&f.jsx("div",{className:"compass-load-actions",children:f.jsx("button",{className:"compass-load-action compass-load-action-primary",type:"button",onClick:n.onShowGraph,children:"Show graph now"})})]})]})}function B3(n){return n instanceof HTMLElement&&(n.isContentEditable||n.tagName==="INPUT"||n.tagName==="TEXTAREA"||n.tagName==="SELECT")}function P3({status:n,physicsRunning:e,layoutStyle:t,forceLabels:i,showEdgeLabels:o,hasSelection:r,isolateSelection:A,neighborhoodDepth:I,edgeDirection:l,layoutSpacing:c,showMinimap:h,leadingControls:p,leadingPanel:m,leadingPanelOpen:b,onLeadingPanelClose:w,onTogglePhysics:S,onLayoutChange:x,onZoomOut:O,onResetZoom:E,onZoomIn:R,onFit:B,onFitSelection:W,onReset:ne,onToggleLabels:L,onToggleEdgeLabels:G,onToggleIsolation:Ie,onNeighborhoodDepthChange:fe,onEdgeDirectionChange:Be,onLayoutSpacingChange:Te,onToggleMinimap:He,onBack:Ve}){const[Ce,M]=Z.useState(!1),Q=Z.useId(),K=Z.useRef(null),ie=Z.useRef(null),ee=Z.useRef(!1);return Z.useEffect(()=>{b&&M(!1)},[b]),Z.useEffect(()=>{Ce||!ee.current||(ee.current=!1,ie.current?.focus())},[Ce]),Z.useEffect(()=>{const T=te=>{if(te.key==="Escape"){Ce&&(ee.current=!0,M(!1));return}te.key!=="?"||B3(te.target)||(te.preventDefault(),w?.(),M(!0))},F=te=>{K.current?.contains(te.target)||M(!1)};return document.addEventListener("keydown",T),document.addEventListener("pointerdown",F),()=>{document.removeEventListener("keydown",T),document.removeEventListener("pointerdown",F)}},[w,Ce]),f.jsxs("div",{ref:K,className:"compass-graph-toolbar compass-glass-panel",role:"toolbar","aria-label":"Graph controls",children:[f.jsxs("div",{className:"compass-viewer-status","data-state":e?"running":"paused",role:"status","aria-live":"polite",children:[f.jsx("span",{className:"compass-viewer-status-dot","aria-hidden":"true"}),f.jsx("span",{className:"compass-viewer-status-text",children:n})]}),f.jsxs("div",{className:"compass-toolbar-actions",children:[Ve&&f.jsxs("button",{className:"compass-tool-button",type:"button","aria-label":"Back to community overview",onClick:Ve,children:[f.jsx(HR,{}),f.jsx("span",{children:"Overview"})]}),f.jsxs("label",{className:"compass-layout-picker",children:[f.jsx(g3,{"aria-hidden":"true"}),f.jsx("span",{className:"sr-only",children:"Graph layout"}),f.jsxs("select",{"aria-label":"Graph layout",value:t,onChange:T=>x(T.target.value),children:[f.jsx("option",{value:"automatic",children:"Automatic"}),f.jsx("option",{value:"circle",children:"Circle"}),f.jsx("option",{value:"concentric",children:"Concentric"}),f.jsx("option",{value:"spiral",children:"Spiral"}),f.jsx("option",{value:"grid",children:"Square grid"})]})]}),f.jsxs("button",{className:"compass-tool-button compass-physics-button",type:"button","aria-label":e?"Stop layout":t==="automatic"?"Run layout":"Fixed layout","aria-pressed":e,disabled:t!=="automatic",title:t==="automatic"?e?"Stop layout":"Run layout":"Physics is available in Automatic layout",onClick:S,children:[e?f.jsx(Wm,{}):t==="automatic"?f.jsx(I3,{}):f.jsx(Wm,{}),f.jsx("span",{children:e?"Stop":t==="automatic"?"Layout":"Fixed"})]}),f.jsx("span",{className:"compass-toolbar-separator","aria-hidden":"true"}),f.jsxs("div",{className:"compass-zoom-controls",role:"group","aria-label":"Zoom controls",children:[f.jsx("button",{className:"compass-tool-button compass-tool-icon-button",type:"button","aria-label":"Zoom out",title:"Zoom out",onClick:O,children:f.jsx(v3,{})}),f.jsx("button",{className:"compass-tool-button compass-zoom-reset",type:"button","aria-label":"Reset zoom to 100%",title:"Reset zoom to 100%",onClick:E,children:"100%"}),f.jsx("button",{className:"compass-tool-button compass-tool-icon-button",type:"button","aria-label":"Zoom in",title:"Zoom in",onClick:R,children:f.jsx(m3,{})})]}),f.jsx("button",{className:"compass-tool-button compass-tool-icon-button",type:"button","aria-label":"Fit graph in view",title:"Fit graph in view",onClick:B,children:f.jsx(Hm,{})}),f.jsx("button",{className:"compass-tool-button compass-tool-icon-button",type:"button","aria-label":"Fit selected neighborhood",title:r?`Fit the selected node and its ${I}-hop neighborhood`:"Select a node to fit its neighborhood",disabled:!r,onClick:W,children:f.jsx(n3,{})}),f.jsx("button",{className:"compass-tool-button compass-tool-icon-button",type:"button","aria-label":"Reset graph view",title:"Reset graph view",onClick:ne,children:f.jsx(Xm,{})}),f.jsx("button",{className:"compass-tool-button compass-tool-icon-button",type:"button","aria-label":i?"Hide labels":"Show labels","aria-pressed":i,title:i?"Hide node labels":"Show all node labels",onClick:L,children:f.jsx(f3,{})}),f.jsx("button",{className:"compass-tool-button compass-tool-icon-button",type:"button","aria-label":o?"Hide relationship labels":"Show relationship labels","aria-pressed":o,title:o?"Hide relationship labels":"Show relationship labels",onClick:G,children:f.jsx($m,{})}),f.jsx("button",{ref:ie,className:"compass-tool-button compass-tool-icon-button",type:"button","aria-label":"Graph settings","aria-expanded":Ce,"aria-controls":Q,title:"Graph settings (?)",onClick:()=>M(T=>{const F=!T;return F&&w?.(),F}),children:f.jsx(c3,{})}),p?f.jsx("div",{className:"compass-toolbar-leading",children:p}):null]}),m,Ce?f.jsxs("div",{id:Q,className:"compass-explore-panel compass-glass-panel",role:"region","aria-label":"Graph exploration controls",children:[f.jsxs("div",{className:"compass-explore-heading",children:[f.jsxs("div",{children:[f.jsx("strong",{children:"Graph settings"}),f.jsx("span",{children:r?"Tune the selected neighborhood and canvas":"Set the next neighborhood, then select a node"})]}),f.jsx("kbd",{children:"?"})]}),r?null:f.jsxs("div",{className:"compass-selection-prompt",role:"note",children:[f.jsx(qm,{"aria-hidden":"true"}),f.jsxs("span",{children:[f.jsx("strong",{children:"Select a node to isolate it"}),f.jsx("small",{children:"Use the canvas or node search. Depth and direction can be set now."})]})]}),f.jsxs("button",{className:"compass-explore-toggle",type:"button","aria-label":"Isolate selection","aria-pressed":A,disabled:!r,onClick:Ie,children:[f.jsx(qm,{"aria-hidden":"true"}),f.jsxs("span",{children:[f.jsx("strong",{children:"Isolate selection"}),f.jsx("small",{children:"Hide everything outside the traversal"})]}),f.jsx("i",{"aria-hidden":"true"})]}),f.jsxs("fieldset",{className:"compass-explore-field",children:[f.jsx("legend",{children:"Neighborhood depth"}),f.jsx("div",{className:"compass-segmented-control","aria-label":"Neighborhood depth",children:[1,2,3,4].map(T=>f.jsx("button",{type:"button","aria-label":`${T} hop${T===1?"":"s"}`,"aria-pressed":I===T,onClick:()=>fe(T),children:T},T))})]}),f.jsxs("fieldset",{className:"compass-explore-field",children:[f.jsx("legend",{children:"Edge direction"}),f.jsx("div",{className:"compass-segmented-control","aria-label":"Edge direction",children:[["both","Both"],["outgoing","Out"],["incoming","In"]].map(([T,F])=>f.jsx("button",{type:"button","aria-label":`${F==="Both"?"Both directions":F==="Out"?"Outgoing edges":"Incoming edges"}`,"aria-pressed":l===T,onClick:()=>Be(T),children:F},T))})]}),f.jsxs("label",{className:"compass-explore-select",children:[f.jsx("span",{children:"Layout spacing"}),f.jsxs("select",{"aria-label":"Layout spacing",value:c,onChange:T=>Te(Number(T.target.value)),children:[f.jsx("option",{value:.75,children:"Compact · 75%"}),f.jsx("option",{value:1,children:"Default · 100%"}),f.jsx("option",{value:1.25,children:"Airy · 125%"}),f.jsx("option",{value:1.5,children:"Wide · 150%"})]})]}),f.jsxs("button",{className:"compass-explore-toggle",type:"button","aria-label":"Show minimap","aria-pressed":h,onClick:He,children:[f.jsx(o3,{"aria-hidden":"true"}),f.jsxs("span",{children:[f.jsx("strong",{children:"Show minimap"}),f.jsx("small",{children:"Track and reposition the visible viewport"})]}),f.jsx("i",{"aria-hidden":"true"})]}),f.jsxs("div",{className:"compass-shortcut-guide","aria-label":"Graph keyboard shortcuts",children:[f.jsxs("div",{className:"compass-shortcut-title",children:[f.jsx(i3,{"aria-hidden":"true"}),f.jsx("strong",{children:"Keyboard"})]}),f.jsxs("dl",{children:[f.jsxs("div",{children:[f.jsx("dt",{children:f.jsx("kbd",{children:"F"})}),f.jsx("dd",{children:"Fit graph"})]}),f.jsxs("div",{children:[f.jsx("dt",{children:f.jsx("kbd",{children:"⇧ F"})}),f.jsx("dd",{children:"Fit selection"})]}),f.jsxs("div",{children:[f.jsxs("dt",{children:[f.jsx("kbd",{children:"+"})," ",f.jsx("kbd",{children:"−"})]}),f.jsx("dd",{children:"Zoom"})]}),f.jsxs("div",{children:[f.jsx("dt",{children:f.jsx("kbd",{children:"0"})}),f.jsx("dd",{children:"100% zoom"})]}),f.jsxs("div",{children:[f.jsx("dt",{children:f.jsx("kbd",{children:"I"})}),f.jsx("dd",{children:"Isolate"})]}),f.jsxs("div",{children:[f.jsxs("dt",{children:[f.jsx("kbd",{children:"["})," ",f.jsx("kbd",{children:"]"})]}),f.jsx("dd",{children:"Depth"})]}),f.jsxs("div",{children:[f.jsx("dt",{children:f.jsx("kbd",{children:"D"})}),f.jsx("dd",{children:"Direction"})]}),f.jsxs("div",{children:[f.jsx("dt",{children:f.jsx("kbd",{children:"M"})}),f.jsx("dd",{children:"Minimap"})]})]})]})]}):null]})}const L3=["callable","type","module","boundary","other"],G3=["execution","dependency","structure","flow","other"],F3=new Set(["closure","constructor","function","lambda","macro","method","procedure","subroutine","database_procedure"]),V3=new Set(["class","component","enum","interface","annotation","protocol","struct","trait","type","type_alias","union"]),U3=new Set(["directory","document","export","file","folder","import","migration","module","namespace","package"]),Y3=new Set(["command","config_key","database","database_column","database_constraint","database_index","database_schema","database_table","database_trigger","database_view","endpoint","event","job","message","query","queue","resource","route","schema","table","topic"]),H3=new Set(["awaits","calls","dispatches","executes","handles","instantiates","invokes","schedules","tests","triggers","spawns"]),K3=new Set(["depends_on","exports","imports","imports_from","links","re_exports","references","returns","type_of","aliases","uses"]),W3=new Set(["contains","decorates","declares","documents","embeds","extends","implements","inherits","member_of","mixes_in","overrides","owns"]),Q3=new Set(["consumes","emits","maps_to","produces","publishes","reads","receives","registers","routes_to","sends","subscribes","writes"]);function yv(n){return(n??"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}function ls(n){const e=yv(n);return F3.has(e)?"callable":V3.has(e)?"type":U3.has(e)?"module":Y3.has(e)?"boundary":"other"}function uc(n){const e=yv(n);return H3.has(e)?"execution":K3.has(e)?"dependency":W3.has(e)?"structure":Q3.has(e)?"flow":"other"}function X3(n){return n==="type"?"diamond":n==="module"?"square":n==="boundary"?"triangle":"dot"}function $3(n){return n==="callable"?"var(--vscode-symbolIcon-functionForeground, #5fa8ff)":n==="type"?"var(--vscode-symbolIcon-classForeground, #e3b341)":n==="module"?"var(--vscode-symbolIcon-moduleForeground, #56d4b4)":n==="boundary"?"var(--vscode-symbolIcon-eventForeground, #ff9b87)":"var(--vscode-descriptionForeground, #8b949e)"}const q3={callable:"Callable",type:"Type",module:"Module / file",boundary:"Boundary / data",other:"Other"},J3={execution:"Execution",dependency:"Dependency",structure:"Structure",flow:"Data / event flow",other:"Other"};function e_({model:n}){const e=Z.useMemo(()=>{const i=new Map;for(const o of n.nodes){const r=ls(o.kind);i.set(r,(i.get(r)??0)+1)}return i},[n.nodes]),t=Z.useMemo(()=>{const i=new Map;for(const o of n.edges){const r=uc(o.relation);i.set(r,(i.get(r)??0)+1)}return i},[n.edges]);return f.jsxs("aside",{className:"compass-semantic-legend compass-glass-panel","aria-label":"Graph visual legend",children:[f.jsxs("section",{"aria-label":"Node categories",children:[f.jsx("strong",{children:"Nodes"}),L3.filter(i=>(e.get(i)??0)>0).map(i=>f.jsxs("span",{className:"compass-semantic-legend-item",children:[f.jsx("i",{"data-node-category":i,"aria-hidden":"true"}),q3[i],f.jsx("small",{children:e.get(i)})]},i))]}),n.edges.length>0?f.jsxs("section",{"aria-label":"Relationship categories",children:[f.jsx("strong",{children:"Edges"}),G3.filter(i=>(t.get(i)??0)>0).map(i=>f.jsxs("span",{className:"compass-semantic-legend-item",children:[f.jsx("i",{"data-edge-category":i,"aria-hidden":"true"}),J3[i],f.jsx("small",{children:t.get(i)})]},i))]}):null]})}const wv=280,xv=560,Sv=24,hc={width:340,collapsed:!1};function Gr(n){return Number.isFinite(n)?Math.min(xv,Math.max(wv,Math.round(n))):hc.width}function Ev(n){return{width:Gr(n?.width??hc.width),collapsed:n?.collapsed??hc.collapsed}}function t_(n,e){return Gr(n-e)}function n_(n,e){return Gr(e==="ArrowLeft"?n+Sv:e==="ArrowRight"?n-Sv:n)}function i_({width:n,onResize:e}){const t=Z.useRef(!1),i=o=>{t.current=!1,o.currentTarget.hasPointerCapture(o.pointerId)&&o.currentTarget.releasePointerCapture(o.pointerId)};return f.jsx("div",{className:"compass-inspector-resizer",role:"separator","aria-label":"Resize graph inspector","aria-orientation":"vertical","aria-valuemin":wv,"aria-valuemax":xv,"aria-valuenow":n,tabIndex:0,onPointerDown:o=>{t.current=!0,o.currentTarget.setPointerCapture(o.pointerId)},onPointerMove:o=>{if(!t.current)return;const r=o.currentTarget.parentElement;r&&e(t_(r.getBoundingClientRect().right,o.clientX))},onPointerUp:i,onPointerCancel:i,onKeyDown:o=>{o.key!=="ArrowLeft"&&o.key!=="ArrowRight"||(o.preventDefault(),e(n_(n,o.key)))},children:f.jsx("span",{"aria-hidden":"true"})})}function Tv(n,e,t){if(t===void 0&&n.stats.aggregated&&e.memberCount!==void 0&&e.detailAvailable!==!1)return{type:"community",communityId:e.community};const i=cv(e);return i?{type:"source",source:i}:{type:"none"}}function g_(n){const e=n.source?.startLine,t=n.source?.endLine;if(e!==void 0)return t!==void 0&&t!==e?`${e}–${t}`:String(e)}function o_({node:n,hover:e,activation:t}){const i={"--compass-hover-x":`${e.x+18}px`,"--compass-hover-y":`${e.y-42}px`},o=g_(n);return f.jsxs("div",{className:"compass-node-hover-card",role:"tooltip",style:i,children:[f.jsxs("div",{className:"compass-hover-heading",children:[f.jsx("strong",{children:n.label}),f.jsx("span",{children:(n.kind??"symbol").toLocaleUpperCase()})]}),n.change&&f.jsx("span",{className:"compass-change-badge","data-change":n.change,children:n.change==="unchanged"?"Context":`${n.change[0]?.toLocaleUpperCase()}${n.change.slice(1)}`}),n.memberCount!==void 0?f.jsxs("p",{children:[n.memberCount.toLocaleString()," symbols"]}):f.jsxs(f.Fragment,{children:[n.language&&f.jsxs("p",{children:["Language: ",n.language]}),n.source?.file&&f.jsx("p",{className:"compass-hover-source",children:n.source.file}),o&&f.jsxs("p",{children:["Lines: ",o]}),n.signature&&f.jsx("code",{children:n.signature})]}),t.type!=="none"&&f.jsxs("p",{className:"compass-hover-hint",children:[t.type==="community"?f.jsx(lc,{"aria-hidden":"true"}):f.jsx(e3,{"aria-hidden":"true"}),f.jsxs("span",{children:[f.jsx("strong",{children:"Double-click"})," ",t.type==="community"?"to open community subgraph":"to open source code"]})]})]})}const s_={routes_to:"routes to",publishes:"publishes",subscribes:"subscribes",produces:"produces",consumes:"consumes",schedules:"schedules",triggers:"triggers",handles:"handles",registers:"registers",reads:"reads",writes:"writes",maps_to:"maps to",depends_on:"depends on"};function r_(n){const e=n.relation.trim(),t=s_[e]??e,i=n.details?.type==="route"?n.details.data:void 0,o=i?`${i.stage}${i.position===null||i.position===void 0?"":` ${i.position+1}`}`:void 0;return[t,o,i?.operation].filter(r=>r!==void 0&&r!=="").join(" · ")}function a_(n){if(!n?.file.trim())return"";const e=n.startLine,t=n.endLine;if(e!==void 0){const i=t!==void 0&&t!==e?`${e}–${t}`:String(e);return`${n.file}:${i}`}return n.startByte!==void 0?`${n.file}:byte ${n.startByte}`:n.file}function A_(n){const e=n.confidence;return e?`${e[0]?.toLocaleUpperCase()}${e.slice(1)}`:"Unspecified"}function C_(n){if(n)return n==="unchanged"?"Context":`${n[0]?.toLocaleUpperCase()}${n.slice(1)}`}function I_({edge:n,sourceNode:e,targetNode:t,hover:i}){const o={"--compass-hover-x":`${i.x+18}px`,"--compass-hover-y":`${i.y-52}px`},r=a_(n.relationshipSite),A=n.codeEvidence?.[0],I=C_(n.change),l=dv(n)!==void 0;return f.jsxs("div",{className:"compass-edge-hover-card",role:"tooltip",style:o,children:[f.jsxs("div",{className:"compass-edge-hover-heading",children:[f.jsxs("span",{className:"compass-edge-hover-eyebrow",children:[f.jsx(Um,{"aria-hidden":"true"}),"Relationship"]}),f.jsx("span",{className:"compass-edge-confidence","data-confidence":n.confidence??"unspecified",children:A_(n)})]}),f.jsxs("div",{className:"compass-edge-trace","aria-label":`${e.label} to ${t.label}`,children:[f.jsx("strong",{children:e.label}),f.jsx("span",{"aria-hidden":"true",children:f.jsx(KR,{})}),f.jsx("strong",{children:t.label})]}),f.jsxs("div",{className:"compass-edge-relation-row",children:[f.jsx("strong",{children:r_(n)||"Relationship"}),I&&f.jsx("span",{className:"compass-change-badge","data-change":n.change,children:I})]}),(A||r)&&f.jsxs("div",{className:"compass-edge-metadata",children:[A&&f.jsxs("p",{children:[f.jsx("span",{children:"Evidence"}),f.jsx("code",{children:A.rule??A.origin})]}),r&&f.jsxs("p",{children:[f.jsx("span",{children:"Source"}),f.jsx("code",{children:r})]})]}),l&&f.jsxs("p",{className:"compass-hover-hint",children:[f.jsx(Um,{"aria-hidden":"true"}),f.jsxs("span",{children:[f.jsx("strong",{children:"Double-click"})," to open relationship source"]})]})]})}var fc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oe(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var eC=function(n){return n&&n.Math===Math&&n},_t=eC(typeof globalThis=="object"&&globalThis)||eC(typeof window=="object"&&window)||eC(typeof self=="object"&&self)||eC(typeof fc=="object"&&fc)||(function(){return this})()||fc||Function("return this")(),gt=function(n){try{return!!n()}catch{return!0}},l_=gt,Fr=!l_(function(){var n=(function(){}).bind();return typeof n!="function"||n.hasOwnProperty("prototype")}),c_=Fr,Ov=Function.prototype,Nv=Ov.apply,Dv=Ov.call,tC=typeof Reflect=="object"&&Reflect.apply||(c_?Dv.bind(Nv):function(){return Dv.apply(Nv,arguments)}),Mv=Fr,zv=Function.prototype,pc=zv.call,d_=Mv&&zv.bind.bind(pc,pc),ot=Mv?d_:function(n){return function(){return pc.apply(n,arguments)}},kv=ot,u_=kv({}.toString),h_=kv("".slice),Qi=function(n){return h_(u_(n),8,-1)},f_=Qi,p_=ot,mc=function(n){if(f_(n)==="Function")return p_(n)},vc=typeof document=="object"&&document.all,m_=typeof vc>"u"&&vc!==void 0,Rv={all:vc,IS_HTMLDDA:m_},_v=Rv,v_=_v.all,dn=_v.IS_HTMLDDA?function(n){return typeof n=="function"||n===v_}:function(n){return typeof n=="function"},Vr={},b_=gt,sn=!b_(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),y_=Fr,nC=Function.prototype.call,mi=y_?nC.bind(nC):function(){return nC.apply(nC,arguments)},Ur={},jv={}.propertyIsEnumerable,Zv=Object.getOwnPropertyDescriptor,w_=Zv&&!jv.call({1:2},1);Ur.f=w_?function(e){var t=Zv(this,e);return!!t&&t.enumerable}:jv;var Yr=function(n,e){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:e}},x_=ot,S_=gt,E_=Qi,bc=Object,T_=x_("".split),iC=S_(function(){return!bc("z").propertyIsEnumerable(0)})?function(n){return E_(n)==="String"?T_(n,""):bc(n)}:bc,cs=function(n){return n==null},O_=cs,N_=TypeError,Hr=function(n){if(O_(n))throw new N_("Can't call method on "+n);return n},D_=iC,M_=Hr,vi=function(n){return D_(M_(n))},Bv=dn,Pv=Rv,z_=Pv.all,xn=Pv.IS_HTMLDDA?function(n){return typeof n=="object"?n!==null:Bv(n)||n===z_}:function(n){return typeof n=="object"?n!==null:Bv(n)},rt={},yc=rt,wc=_t,k_=dn,Lv=function(n){return k_(n)?n:void 0},bi=function(n,e){return arguments.length<2?Lv(yc[n])||Lv(wc[n]):yc[n]&&yc[n][e]||wc[n]&&wc[n][e]},R_=ot,jt=R_({}.isPrototypeOf),Kr=typeof navigator<"u"&&String(navigator.userAgent)||"",Gv=_t,xc=Kr,Fv=Gv.process,Vv=Gv.Deno,Uv=Fv&&Fv.versions||Vv&&Vv.version,Yv=Uv&&Uv.v8,yi,gC;Yv&&(yi=Yv.split("."),gC=yi[0]>0&&yi[0]<4?1:+(yi[0]+yi[1])),!gC&&xc&&(yi=xc.match(/Edge\/(\d+)/),(!yi||yi[1]>=74)&&(yi=xc.match(/Chrome\/(\d+)/),yi&&(gC=+yi[1])));var Wr=gC,Hv=Wr,__=gt,j_=_t,Z_=j_.String,ds=!!Object.getOwnPropertySymbols&&!__(function(){var n=Symbol("symbol detection");return!Z_(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&Hv&&Hv<41}),B_=ds,Kv=B_&&!Symbol.sham&&typeof Symbol.iterator=="symbol",P_=bi,L_=dn,G_=jt,F_=Kv,V_=Object,Qr=F_?function(n){return typeof n=="symbol"}:function(n){var e=P_("Symbol");return L_(e)&&G_(e.prototype,V_(n))},U_=String,Xr=function(n){try{return U_(n)}catch{return"Object"}},Y_=dn,H_=Xr,K_=TypeError,bo=function(n){if(Y_(n))return n;throw new K_(H_(n)+" is not a function")},W_=bo,Q_=cs,Sc=function(n,e){var t=n[e];return Q_(t)?void 0:W_(t)},Ec=mi,Tc=dn,Oc=xn,X_=TypeError,$_=function(n,e){var t,i;if(e==="string"&&Tc(t=n.toString)&&!Oc(i=Ec(t,n))||Tc(t=n.valueOf)&&!Oc(i=Ec(t,n))||e!=="string"&&Tc(t=n.toString)&&!Oc(i=Ec(t,n)))return i;throw new X_("Can't convert object to primitive value")},Wv={exports:{}},Qv=_t,q_=Object.defineProperty,J_=function(n,e){try{q_(Qv,n,{value:e,configurable:!0,writable:!0})}catch{Qv[n]=e}return e},e5=_t,t5=J_,Xv="__core-js_shared__",n5=e5[Xv]||t5(Xv,{}),Nc=n5,$v=Nc;(Wv.exports=function(n,e){return $v[n]||($v[n]=e!==void 0?e:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"});var us=Wv.exports,i5=Hr,g5=Object,Yn=function(n){return g5(i5(n))},o5=ot,s5=Yn,r5=o5({}.hasOwnProperty),rn=Object.hasOwn||function(e,t){return r5(s5(e),t)},a5=ot,A5=0,C5=Math.random(),I5=a5(1 .toString),oC=function(n){return"Symbol("+(n===void 0?"":n)+")_"+I5(++A5+C5,36)},l5=_t,c5=us,qv=rn,d5=oC,u5=ds,h5=Kv,hs=l5.Symbol,Dc=c5("wks"),f5=h5?hs.for||hs:hs&&hs.withoutSetter||d5,Vt=function(n){return qv(Dc,n)||(Dc[n]=u5&&qv(hs,n)?hs[n]:f5("Symbol."+n)),Dc[n]},p5=mi,Jv=xn,eb=Qr,m5=Sc,v5=$_,b5=Vt,y5=TypeError,w5=b5("toPrimitive"),x5=function(n,e){if(!Jv(n)||eb(n))return n;var t=m5(n,w5),i;if(t){if(e===void 0&&(e="default"),i=p5(t,n,e),!Jv(i)||eb(i))return i;throw new y5("Can't convert object to primitive value")}return e===void 0&&(e="number"),v5(n,e)},S5=x5,E5=Qr,sC=function(n){var e=S5(n,"string");return E5(e)?e:e+""},T5=_t,tb=xn,Mc=T5.document,O5=tb(Mc)&&tb(Mc.createElement),nb=function(n){return O5?Mc.createElement(n):{}},N5=sn,D5=gt,M5=nb,ib=!N5&&!D5(function(){return Object.defineProperty(M5("div"),"a",{get:function(){return 7}}).a!==7}),z5=sn,k5=mi,R5=Ur,_5=Yr,j5=vi,Z5=sC,B5=rn,P5=ib,gb=Object.getOwnPropertyDescriptor;Vr.f=z5?gb:function(e,t){if(e=j5(e),t=Z5(t),P5)try{return gb(e,t)}catch{}if(B5(e,t))return _5(!k5(R5.f,e,t),e[t])};var L5=gt,G5=dn,F5=/#|\.prototype\./,$r=function(n,e){var t=U5[V5(n)];return t===H5?!0:t===Y5?!1:G5(e)?L5(e):!!e},V5=$r.normalize=function(n){return String(n).replace(F5,".").toLowerCase()},U5=$r.data={},Y5=$r.NATIVE="N",H5=$r.POLYFILL="P",K5=$r,ob=mc,W5=bo,Q5=Fr,X5=ob(ob.bind),qr=function(n,e){return W5(n),e===void 0?n:Q5?X5(n,e):function(){return n.apply(e,arguments)}},Hn={},$5=sn,q5=gt,sb=$5&&q5(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),J5=xn,ej=String,tj=TypeError,Xi=function(n){if(J5(n))return n;throw new tj(ej(n)+" is not an object")},nj=sn,ij=ib,gj=sb,rC=Xi,rb=sC,oj=TypeError,zc=Object.defineProperty,sj=Object.getOwnPropertyDescriptor,kc="enumerable",Rc="configurable",_c="writable";Hn.f=nj?gj?function(e,t,i){if(rC(e),t=rb(t),rC(i),typeof e=="function"&&t==="prototype"&&"value"in i&&_c in i&&!i[_c]){var o=sj(e,t);o&&o[_c]&&(e[t]=i.value,i={configurable:Rc in i?i[Rc]:o[Rc],enumerable:kc in i?i[kc]:o[kc],writable:!1})}return zc(e,t,i)}:zc:function(e,t,i){if(rC(e),t=rb(t),rC(i),ij)try{return zc(e,t,i)}catch{}if("get"in i||"set"in i)throw new oj("Accessors not supported");return"value"in i&&(e[t]=i.value),e};var rj=sn,aj=Hn,Aj=Yr,fs=rj?function(n,e,t){return aj.f(n,e,Aj(1,t))}:function(n,e,t){return n[e]=t,n},aC=_t,Cj=tC,Ij=mc,lj=dn,cj=Vr.f,dj=K5,ps=rt,uj=qr,ms=fs,ab=rn,hj=function(n){var e=function(t,i,o){if(this instanceof e){switch(arguments.length){case 0:return new n;case 1:return new n(t);case 2:return new n(t,i)}return new n(t,i,o)}return Cj(n,this,arguments)};return e.prototype=n.prototype,e},Me=function(n,e){var t=n.target,i=n.global,o=n.stat,r=n.proto,A=i?aC:o?aC[t]:(aC[t]||{}).prototype,I=i?ps:ps[t]||ms(ps,t,{})[t],l=I.prototype,c,h,p,m,b,w,S,x,O;for(m in e)c=dj(i?m:t+(o?".":"#")+m,n.forced),h=!c&&A&&ab(A,m),w=I[m],h&&(n.dontCallGetSet?(O=cj(A,m),S=O&&O.value):S=A[m]),b=h&&S?S:e[m],!(h&&typeof w==typeof b)&&(n.bind&&h?x=uj(b,aC):n.wrap&&h?x=hj(b):r&&lj(b)?x=Ij(b):x=b,(n.sham||b&&b.sham||w&&w.sham)&&ms(x,"sham",!0),ms(I,m,x),r&&(p=t+"Prototype",ab(ps,p)||ms(ps,p,{}),ms(ps[p],m,b),n.real&&l&&(c||!l[m])&&ms(l,m,b)))},fj=Math.ceil,pj=Math.floor,mj=Math.trunc||function(e){var t=+e;return(t>0?pj:fj)(t)},vj=mj,AC=function(n){var e=+n;return e!==e||e===0?0:vj(e)},bj=AC,yj=Math.max,wj=Math.min,Jr=function(n,e){var t=bj(n);return t<0?yj(t+e,0):wj(t,e)},xj=AC,Sj=Math.min,Ej=function(n){return n>0?Sj(xj(n),9007199254740991):0},Tj=Ej,ii=function(n){return Tj(n.length)},Oj=vi,Nj=Jr,Dj=ii,Ab=function(n){return function(e,t,i){var o=Oj(e),r=Dj(o),A=Nj(i,r),I;if(n&&t!==t){for(;r>A;)if(I=o[A++],I!==I)return!0}else for(;r>A;A++)if((n||A in o)&&o[A]===t)return n||A||0;return!n&&-1}},jc={includes:Ab(!0),indexOf:Ab(!1)},ea={},Mj=ot,Zc=rn,zj=vi,kj=jc.indexOf,Rj=ea,Cb=Mj([].push),Ib=function(n,e){var t=zj(n),i=0,o=[],r;for(r in t)!Zc(Rj,r)&&Zc(t,r)&&Cb(o,r);for(;e.length>i;)Zc(t,r=e[i++])&&(~kj(o,r)||Cb(o,r));return o},Bc=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],_j=Ib,jj=Bc,ta=Object.keys||function(e){return _j(e,jj)},na={};na.f=Object.getOwnPropertySymbols;var lb=sn,Zj=ot,Bj=mi,Pj=gt,Pc=ta,Lj=na,Gj=Ur,Fj=Yn,Vj=iC,vs=Object.assign,cb=Object.defineProperty,Uj=Zj([].concat),Yj=!vs||Pj(function(){if(lb&&vs({b:1},vs(cb({},"a",{enumerable:!0,get:function(){cb(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var n={},e={},t=Symbol("assign detection"),i="abcdefghijklmnopqrst";return n[t]=7,i.split("").forEach(function(o){e[o]=o}),vs({},n)[t]!==7||Pc(vs({},e)).join("")!==i})?function(e,t){for(var i=Fj(e),o=arguments.length,r=1,A=Lj.f,I=Gj.f;o>r;)for(var l=Vj(arguments[r++]),c=A?Uj(Pc(l),A(l)):Pc(l),h=c.length,p=0,m;h>p;)m=c[p++],(!lb||Bj(I,l,m))&&(i[m]=l[m]);return i}:vs,Hj=Me,db=Yj;Hj({target:"Object",stat:!0,forced:Object.assign!==db},{assign:db});var Kj=rt,Wj=Kj.Object.assign,Qj=Wj,Xj=Qj,$j=Xj,Ut=Oe($j),qj=ot,CC=qj([].slice),ub=ot,Jj=bo,e4=xn,t4=rn,hb=CC,n4=Fr,fb=Function,i4=ub([].concat),g4=ub([].join),Lc={},o4=function(n,e,t){if(!t4(Lc,e)){for(var i=[],o=0;o=.1;)w=+r[p++%A],w>h&&(w=h),b=Math.sqrt(w*w/(1+c*c)),b=I<0?-b:b,e+=b,t+=c*b,m===!0?n.lineTo(e,t):n.moveTo(e,t),h-=w,m=!m}function y4(n,e,t,i){n.beginPath();const o=6,r=Math.PI*2/o;n.moveTo(e+i,t);for(let A=1;A1?t-1:0),o=1;o"u")){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",t==="top"&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=n:o.appendChild(document.createTextNode(n))}}var x4=`.vis-overlay { +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const A of n.seen.entries()){const I=A[1];if(e===A[0]){r(A);continue}if(n.external){const c=n.external.registry.get(A[0])?.id;if(e!==A[0]&&c){r(A);continue}}if(n.metadataRegistry.get(A[0])?.id){r(A);continue}if(I.cycle){r(A);continue}if(I.count>1&&n.reused==="ref"){r(A);continue}}}function bm(n,e){const t=n.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=I=>{const l=n.seen.get(I);if(l.ref===null)return;const c=l.def??l.schema,h={...c},p=l.ref;if(l.ref=null,p){i(p);const b=n.seen.get(p),w=b.schema;if(w.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(w)):Object.assign(c,w),Object.assign(c,h),I._zod.parent===p)for(const x in c)x==="$ref"||x==="allOf"||x in h||delete c[x];if(w.$ref&&b.def)for(const x in c)x==="$ref"||x==="allOf"||x in b.def&&JSON.stringify(c[x])===JSON.stringify(b.def[x])&&delete c[x]}const m=I._zod.parent;if(m&&m!==p){i(m);const b=n.seen.get(m);if(b?.schema.$ref&&(c.$ref=b.schema.$ref,b.def))for(const w in c)w==="$ref"||w==="allOf"||w in b.def&&JSON.stringify(c[w])===JSON.stringify(b.def[w])&&delete c[w]}n.override({zodSchema:I,jsonSchema:c,path:l.path??[]})};for(const I of[...n.seen.entries()].reverse())i(I[0]);const o={};if(n.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":n.target,n.external?.uri){const I=n.external.registry.get(e)?.id;if(!I)throw new Error("Schema is missing an `id` property");o.$id=n.external.uri(I)}Object.assign(o,t.def??t.schema);const r=n.metadataRegistry.get(e)?.id;r!==void 0&&o.id===r&&delete o.id;const A=n.external?.defs??{};for(const I of n.seen.entries()){const l=I[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,A[l.defId]=l.def)}n.external||Object.keys(A).length>0&&(n.target==="draft-2020-12"?o.$defs=A:o.definitions=A);try{const I=JSON.parse(JSON.stringify(o));return Object.defineProperty(I,"~standard",{value:{...e["~standard"],jsonSchema:{input:HA(e,"input",n.processors),output:HA(e,"output",n.processors)}},enumerable:!1,writable:!1}),I}catch{throw new Error("Error converting schema to JSON.")}}function Sn(n,e){const t=e??{seen:new Set};if(t.seen.has(n))return!1;t.seen.add(n);const i=n._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Sn(i.element,t);if(i.type==="set")return Sn(i.valueType,t);if(i.type==="lazy")return Sn(i.getter(),t);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Sn(i.innerType,t);if(i.type==="intersection")return Sn(i.left,t)||Sn(i.right,t);if(i.type==="record"||i.type==="map")return Sn(i.keyType,t)||Sn(i.valueType,t);if(i.type==="pipe")return n._zod.traits.has("$ZodCodec")?!0:Sn(i.in,t)||Sn(i.out,t);if(i.type==="object"){for(const o in i.shape)if(Sn(i.shape[o],t))return!0;return!1}if(i.type==="union"){for(const o of i.options)if(Sn(o,t))return!0;return!1}if(i.type==="tuple"){for(const o of i.items)if(Sn(o,t))return!0;return!!(i.rest&&Sn(i.rest,t))}return!1}const IR=(n,e={})=>t=>{const i=mm({...t,processors:e});return Qt(n,i),vm(i,n),bm(i,n)},HA=(n,e,t={})=>i=>{const{libraryOptions:o,target:r}=i??{},A=mm({...o??{},target:r,io:e,processors:t});return Qt(n,A),vm(A,n),bm(A,n)},lR={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},cR=(n,e,t,i)=>{const o=t;o.type="string";const{minimum:r,maximum:A,format:I,patterns:l,contentEncoding:c}=n._zod.bag;if(typeof r=="number"&&(o.minLength=r),typeof A=="number"&&(o.maxLength=A),I&&(o.format=lR[I]??I,o.format===""&&delete o.format,I==="time"&&delete o.format),c&&(o.contentEncoding=c),l&&l.size>0){const h=[...l];h.length===1?o.pattern=h[0].source:h.length>1&&(o.allOf=[...h.map(p=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},dR=(n,e,t,i)=>{const o=t,{minimum:r,maximum:A,format:I,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:h}=n._zod.bag;typeof I=="string"&&I.includes("int")?o.type="integer":o.type="number";const p=typeof h=="number"&&h>=(r??Number.NEGATIVE_INFINITY),m=typeof c=="number"&&c<=(A??Number.POSITIVE_INFINITY),b=e.target==="draft-04"||e.target==="openapi-3.0";p?b?(o.minimum=h,o.exclusiveMinimum=!0):o.exclusiveMinimum=h:typeof r=="number"&&(o.minimum=r),m?b?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c:typeof A=="number"&&(o.maximum=A),typeof l=="number"&&(o.multipleOf=l)},uR=(n,e,t,i)=>{t.type="boolean"},hR=(n,e,t,i)=>{t.not={}},fR=(n,e,t,i)=>{},pR=(n,e,t,i)=>{const o=n._zod.def,r=jp(o.entries);r.every(A=>typeof A=="number")&&(t.type="number"),r.every(A=>typeof A=="string")&&(t.type="string"),t.enum=r},mR=(n,e,t,i)=>{const o=n._zod.def,r=[];for(const A of o.values)if(A===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof A=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");r.push(Number(A))}else r.push(A);if(r.length!==0)if(r.length===1){const A=r[0];t.type=A===null?"null":typeof A,e.target==="draft-04"||e.target==="openapi-3.0"?t.enum=[A]:t.const=A}else r.every(A=>typeof A=="number")&&(t.type="number"),r.every(A=>typeof A=="string")&&(t.type="string"),r.every(A=>typeof A=="boolean")&&(t.type="boolean"),r.every(A=>A===null)&&(t.type="null"),t.enum=r},vR=(n,e,t,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},bR=(n,e,t,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},yR=(n,e,t,i)=>{const o=t,r=n._zod.def,{minimum:A,maximum:I}=n._zod.bag;typeof A=="number"&&(o.minItems=A),typeof I=="number"&&(o.maxItems=I),o.type="array",o.items=Qt(r.element,e,{...i,path:[...i.path,"items"]})},wR=(n,e,t,i)=>{const o=t,r=n._zod.def;o.type="object",o.properties={};const A=r.shape;for(const c in A)o.properties[c]=Qt(A[c],e,{...i,path:[...i.path,"properties",c]});const I=new Set(Object.keys(A)),l=new Set([...I].filter(c=>{const h=r.shape[c]._zod;return e.io==="input"?h.optin===void 0:h.optout===void 0}));l.size>0&&(o.required=Array.from(l)),r.catchall?._zod.def.type==="never"?o.additionalProperties=!1:r.catchall?r.catchall&&(o.additionalProperties=Qt(r.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(o.additionalProperties=!1)},xR=(n,e,t,i)=>{const o=n._zod.def,r=o.inclusive===!1,A=o.options.map((I,l)=>Qt(I,e,{...i,path:[...i.path,r?"oneOf":"anyOf",l]}));r?t.oneOf=A:t.anyOf=A},ER=(n,e,t,i)=>{const o=n._zod.def,r=Qt(o.left,e,{...i,path:[...i.path,"allOf",0]}),A=Qt(o.right,e,{...i,path:[...i.path,"allOf",1]}),I=c=>"allOf"in c&&Object.keys(c).length===1,l=[...I(r)?r.allOf:[r],...I(A)?A.allOf:[A]];t.allOf=l},SR=(n,e,t,i)=>{const o=t,r=n._zod.def;o.type="object";const A=r.keyType,l=A._zod.bag?.patterns;if(r.mode==="loose"&&l&&l.size>0){const h=Qt(r.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});o.patternProperties={};for(const p of l)o.patternProperties[p.source]=h}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(o.propertyNames=Qt(r.keyType,e,{...i,path:[...i.path,"propertyNames"]})),o.additionalProperties=Qt(r.valueType,e,{...i,path:[...i.path,"additionalProperties"]});const c=A._zod.values;if(c){const h=[...c].filter(p=>typeof p=="string"||typeof p=="number");h.length>0&&(o.required=h)}},TR=(n,e,t,i)=>{const o=n._zod.def,r=Qt(o.innerType,e,i),A=e.seen.get(n);e.target==="openapi-3.0"?(A.ref=o.innerType,t.nullable=!0):t.anyOf=[r,{type:"null"}]},OR=(n,e,t,i)=>{const o=n._zod.def;Qt(o.innerType,e,i);const r=e.seen.get(n);r.ref=o.innerType},NR=(n,e,t,i)=>{const o=n._zod.def;Qt(o.innerType,e,i);const r=e.seen.get(n);r.ref=o.innerType,t.default=JSON.parse(JSON.stringify(o.defaultValue))},DR=(n,e,t,i)=>{const o=n._zod.def;Qt(o.innerType,e,i);const r=e.seen.get(n);r.ref=o.innerType,e.io==="input"&&(t._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},MR=(n,e,t,i)=>{const o=n._zod.def;Qt(o.innerType,e,i);const r=e.seen.get(n);r.ref=o.innerType;let A;try{A=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}t.default=A},RR=(n,e,t,i)=>{const o=n._zod.def,r=o.in._zod.traits.has("$ZodTransform"),A=e.io==="input"?r?o.out:o.in:o.out;Qt(A,e,i);const I=e.seen.get(n);I.ref=A},zR=(n,e,t,i)=>{const o=n._zod.def;Qt(o.innerType,e,i);const r=e.seen.get(n);r.ref=o.innerType,t.readOnly=!0},ym=(n,e,t,i)=>{const o=n._zod.def;Qt(o.innerType,e,i);const r=e.seen.get(n);r.ref=o.innerType},kR=q("ZodISODateTime",(n,e)=>{_D.init(n,e),kt.init(n,e)});function _R(n){return GM(kR,n)}const jR=q("ZodISODate",(n,e)=>{jD.init(n,e),kt.init(n,e)});function ZR(n){return FM(jR,n)}const PR=q("ZodISOTime",(n,e)=>{ZD.init(n,e),kt.init(n,e)});function BR(n){return VM(PR,n)}const LR=q("ZodISODuration",(n,e)=>{PD.init(n,e),kt.init(n,e)});function GR(n){return UM(LR,n)}const ni=q("ZodError",(n,e)=>{Fp.init(n,e),n.name="ZodError",Object.defineProperties(n,{format:{value:t=>TN(n,t)},flatten:{value:t=>SN(n,t)},addIssue:{value:t=>{n.issues.push(t),n.message=JSON.stringify(n.issues,Xl,2)}},addIssues:{value:t=>{n.issues.push(...t),n.message=JSON.stringify(n.issues,Xl,2)}},isEmpty:{get(){return n.issues.length===0}}})},{Parent:Error}),FR=ec(ni),VR=tc(ni),UR=LA(ni),YR=GA(ni),HR=DN(ni),KR=MN(ni),WR=RN(ni),QR=zN(ni),XR=kN(ni),$R=_N(ni),qR=jN(ni),JR=ZN(ni),wm=new WeakMap;function Pr(n,e,t){const i=Object.getPrototypeOf(n);let o=wm.get(i);if(o||(o=new Set,wm.set(i,o)),!o.has(e)){o.add(e);for(const r in t){const A=t[r];Object.defineProperty(i,r,{configurable:!0,enumerable:!1,get(){const I=A.bind(this);return Object.defineProperty(this,r,{configurable:!0,writable:!0,enumerable:!0,value:I}),I},set(I){Object.defineProperty(this,r,{configurable:!0,writable:!0,enumerable:!0,value:I})}})}}}const zt=q("ZodType",(n,e)=>(Rt.init(n,e),Object.assign(n["~standard"],{jsonSchema:{input:HA(n,"input"),output:HA(n,"output")}}),n.toJSONSchema=IR(n,{}),n.def=e,n.type=e.type,Object.defineProperty(n,"_def",{value:e}),n.parse=(t,i)=>FR(n,t,i,{callee:n.parse}),n.safeParse=(t,i)=>UR(n,t,i),n.parseAsync=async(t,i)=>VR(n,t,i,{callee:n.parseAsync}),n.safeParseAsync=async(t,i)=>YR(n,t,i),n.spa=n.safeParseAsync,n.encode=(t,i)=>HR(n,t,i),n.decode=(t,i)=>KR(n,t,i),n.encodeAsync=async(t,i)=>WR(n,t,i),n.decodeAsync=async(t,i)=>QR(n,t,i),n.safeEncode=(t,i)=>XR(n,t,i),n.safeDecode=(t,i)=>$R(n,t,i),n.safeEncodeAsync=async(t,i)=>qR(n,t,i),n.safeDecodeAsync=async(t,i)=>JR(n,t,i),Pr(n,"ZodType",{check(...t){const i=this.def;return this.clone(xg(i,{checks:[...i.checks??[],...t.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...t){return this.check(...t)},clone(t,i){return Eg(this,t,i)},brand(){return this},register(t,i){return t.add(this,i),this},refine(t,i){return this.check(Vz(t,i))},superRefine(t,i){return this.check(Uz(t,i))},overwrite(t){return this.check(ls(t))},optional(){return km(this)},exactOptional(){return Dz(this)},nullable(){return _m(this)},nullish(){return km(_m(this))},nonoptional(t){return jz(this,t)},array(){return Oe(this)},or(t){return Mm([this,t])},and(t){return Ez(this,t)},transform(t){return Zm(this,Oz(t))},default(t){return zz(this,t)},prefault(t){return _z(this,t)},catch(t){return Pz(this,t)},pipe(t){return Zm(this,t)},readonly(){return Gz(this)},describe(t){const i=this.clone();return Zr.add(i,{description:t}),i},meta(...t){if(t.length===0)return Zr.get(this);const i=this.clone();return Zr.add(i,t[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(t){return t(this)}}),Object.defineProperty(n,"description",{get(){return Zr.get(n)?.description},configurable:!0}),n)),xm=q("_ZodString",(n,e)=>{nc.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(i,o,r)=>cR(n,i,o);const t=n._zod.bag;n.format=t.format??null,n.minLength=t.minimum??null,n.maxLength=t.maximum??null,Pr(n,"_ZodString",{regex(...i){return this.check(XM(...i))},includes(...i){return this.check(JM(...i))},startsWith(...i){return this.check(eR(...i))},endsWith(...i){return this.check(tR(...i))},min(...i){return this.check(YA(...i))},max(...i){return this.check(fm(...i))},length(...i){return this.check(pm(...i))},nonempty(...i){return this.check(YA(1,...i))},lowercase(i){return this.check($M(i))},uppercase(i){return this.check(qM(i))},trim(){return this.check(iR())},normalize(...i){return this.check(nR(...i))},toLowerCase(){return this.check(gR())},toUpperCase(){return this.check(oR())},slugify(){return this.check(sR())}})}),ez=q("ZodString",(n,e)=>{nc.init(n,e),xm.init(n,e),n.email=t=>n.check(vM(tz,t)),n.url=t=>n.check(EM(nz,t)),n.jwt=t=>n.check(LM(fz,t)),n.emoji=t=>n.check(SM(iz,t)),n.guid=t=>n.check(cm(Em,t)),n.uuid=t=>n.check(bM(KA,t)),n.uuidv4=t=>n.check(yM(KA,t)),n.uuidv6=t=>n.check(wM(KA,t)),n.uuidv7=t=>n.check(xM(KA,t)),n.nanoid=t=>n.check(TM(gz,t)),n.guid=t=>n.check(cm(Em,t)),n.cuid=t=>n.check(OM(oz,t)),n.cuid2=t=>n.check(NM(sz,t)),n.ulid=t=>n.check(DM(rz,t)),n.base64=t=>n.check(ZM(dz,t)),n.base64url=t=>n.check(PM(uz,t)),n.xid=t=>n.check(MM(az,t)),n.ksuid=t=>n.check(RM(Az,t)),n.ipv4=t=>n.check(zM(Cz,t)),n.ipv6=t=>n.check(kM(Iz,t)),n.cidrv4=t=>n.check(_M(lz,t)),n.cidrv6=t=>n.check(jM(cz,t)),n.e164=t=>n.check(BM(hz,t)),n.datetime=t=>n.check(_R(t)),n.date=t=>n.check(ZR(t)),n.time=t=>n.check(BR(t)),n.duration=t=>n.check(GR(t))});function z(n){return mM(ez,n)}const kt=q("ZodStringFormat",(n,e)=>{Ot.init(n,e),xm.init(n,e)}),tz=q("ZodEmail",(n,e)=>{SD.init(n,e),kt.init(n,e)}),Em=q("ZodGUID",(n,e)=>{xD.init(n,e),kt.init(n,e)}),KA=q("ZodUUID",(n,e)=>{ED.init(n,e),kt.init(n,e)}),nz=q("ZodURL",(n,e)=>{TD.init(n,e),kt.init(n,e)}),iz=q("ZodEmoji",(n,e)=>{OD.init(n,e),kt.init(n,e)}),gz=q("ZodNanoID",(n,e)=>{ND.init(n,e),kt.init(n,e)}),oz=q("ZodCUID",(n,e)=>{DD.init(n,e),kt.init(n,e)}),sz=q("ZodCUID2",(n,e)=>{MD.init(n,e),kt.init(n,e)}),rz=q("ZodULID",(n,e)=>{RD.init(n,e),kt.init(n,e)}),az=q("ZodXID",(n,e)=>{zD.init(n,e),kt.init(n,e)}),Az=q("ZodKSUID",(n,e)=>{kD.init(n,e),kt.init(n,e)}),Cz=q("ZodIPv4",(n,e)=>{BD.init(n,e),kt.init(n,e)}),Iz=q("ZodIPv6",(n,e)=>{LD.init(n,e),kt.init(n,e)}),lz=q("ZodCIDRv4",(n,e)=>{GD.init(n,e),kt.init(n,e)}),cz=q("ZodCIDRv6",(n,e)=>{FD.init(n,e),kt.init(n,e)}),dz=q("ZodBase64",(n,e)=>{VD.init(n,e),kt.init(n,e)}),uz=q("ZodBase64URL",(n,e)=>{YD.init(n,e),kt.init(n,e)}),hz=q("ZodE164",(n,e)=>{HD.init(n,e),kt.init(n,e)}),fz=q("ZodJWT",(n,e)=>{WD.init(n,e),kt.init(n,e)}),Sm=q("ZodNumber",(n,e)=>{Jp.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(i,o,r)=>dR(n,i,o),Pr(n,"ZodNumber",{gt(i,o){return this.check(um(i,o))},gte(i,o){return this.check(oc(i,o))},min(i,o){return this.check(oc(i,o))},lt(i,o){return this.check(dm(i,o))},lte(i,o){return this.check(gc(i,o))},max(i,o){return this.check(gc(i,o))},int(i){return this.check(Tm(i))},safe(i){return this.check(Tm(i))},positive(i){return this.check(um(0,i))},nonnegative(i){return this.check(oc(0,i))},negative(i){return this.check(dm(0,i))},nonpositive(i){return this.check(gc(0,i))},multipleOf(i,o){return this.check(hm(i,o))},step(i,o){return this.check(hm(i,o))},finite(){return this}});const t=n._zod.bag;n.minValue=Math.max(t.minimum??Number.NEGATIVE_INFINITY,t.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min(t.maximum??Number.POSITIVE_INFINITY,t.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=(t.format??"").includes("int")||Number.isSafeInteger(t.multipleOf??.5),n.isFinite=!0,n.format=t.format??null});function G(n){return YM(Sm,n)}const pz=q("ZodNumberFormat",(n,e)=>{QD.init(n,e),Sm.init(n,e)});function Tm(n){return HM(pz,n)}const mz=q("ZodBoolean",(n,e)=>{XD.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>uR(n,t,i)});function kn(n){return KM(mz,n)}const vz=q("ZodUnknown",(n,e)=>{$D.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>fR()});function mo(){return WM(vz)}const bz=q("ZodNever",(n,e)=>{qD.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>hR(n,t,i)});function Om(n){return QM(bz,n)}const yz=q("ZodArray",(n,e)=>{JD.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>yR(n,t,i,o),n.element=e.element,Pr(n,"ZodArray",{min(t,i){return this.check(YA(t,i))},nonempty(t){return this.check(YA(1,t))},max(t,i){return this.check(fm(t,i))},length(t,i){return this.check(pm(t,i))},unwrap(){return this.element}})});function Oe(n,e){return rR(yz,n,e)}const Nm=q("ZodObject",(n,e)=>{tM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>wR(n,t,i,o),Ct(n,"shape",()=>e.shape),Pr(n,"ZodObject",{keyof(){return Ge(Object.keys(this._zod.def.shape))},catchall(t){return this.clone({...this._zod.def,catchall:t})},passthrough(){return this.clone({...this._zod.def,catchall:mo()})},loose(){return this.clone({...this._zod.def,catchall:mo()})},strict(){return this.clone({...this._zod.def,catchall:Om()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(t){return vN(this,t)},safeExtend(t){return bN(this,t)},merge(t){return yN(this,t)},pick(t){return pN(this,t)},omit(t){return mN(this,t)},partial(...t){return wN(zm,this,t[0])},required(...t){return xN(jm,this,t[0])}})});function dt(n,e){const t={type:"object",shape:n??{},...ye(e)};return new Nm(t)}function ce(n,e){return new Nm({type:"object",shape:n,catchall:Om(),...ye(e)})}const Dm=q("ZodUnion",(n,e)=>{gm.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>xR(n,t,i,o),n.options=e.options});function Mm(n,e){return new Dm({type:"union",options:n,...ye(e)})}const wz=q("ZodDiscriminatedUnion",(n,e)=>{Dm.init(n,e),nM.init(n,e)});function WA(n,e,t){return new wz({type:"union",options:e,discriminator:n,...ye(t)})}const xz=q("ZodIntersection",(n,e)=>{iM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>ER(n,t,i,o)});function Ez(n,e){return new xz({type:"intersection",left:n,right:e})}const Rm=q("ZodRecord",(n,e)=>{gM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>SR(n,t,i,o),n.keyType=e.keyType,n.valueType=e.valueType});function sc(n,e,t){return!e||!e._zod?new Rm({type:"record",keyType:z(),valueType:n,...ye(e)}):new Rm({type:"record",keyType:n,valueType:e,...ye(t)})}const rc=q("ZodEnum",(n,e)=>{oM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(i,o,r)=>pR(n,i,o),n.enum=e.entries,n.options=Object.values(e.entries);const t=new Set(Object.keys(e.entries));n.extract=(i,o)=>{const r={};for(const A of i)if(t.has(A))r[A]=e.entries[A];else throw new Error(`Key ${A} not found in enum`);return new rc({...e,checks:[],...ye(o),entries:r})},n.exclude=(i,o)=>{const r={...e.entries};for(const A of i)if(t.has(A))delete r[A];else throw new Error(`Key ${A} not found in enum`);return new rc({...e,checks:[],...ye(o),entries:r})}});function Ge(n,e){const t=Array.isArray(n)?Object.fromEntries(n.map(i=>[i,i])):n;return new rc({type:"enum",entries:t,...ye(e)})}const Sz=q("ZodLiteral",(n,e)=>{sM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>mR(n,t,i),n.values=new Set(e.values),Object.defineProperty(n,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function at(n,e){return new Sz({type:"literal",values:Array.isArray(n)?n:[n],...ye(e)})}const Tz=q("ZodTransform",(n,e)=>{rM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>bR(n,t),n._zod.parse=(t,i)=>{if(i.direction==="backward")throw new _p(n.constructor.name);t.addIssue=r=>{if(typeof r=="string")t.issues.push(jr(r,t.value,e));else{const A=r;A.fatal&&(A.continue=!1),A.code??(A.code="custom"),A.input??(A.input=t.value),A.inst??(A.inst=n),t.issues.push(jr(A))}};const o=e.transform(t.value,t);return o instanceof Promise?o.then(r=>(t.value=r,t.fallback=!0,t)):(t.value=o,t.fallback=!0,t)}});function Oz(n){return new Tz({type:"transform",transform:n})}const zm=q("ZodOptional",(n,e)=>{rm.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>ym(n,t,i,o),n.unwrap=()=>n._zod.def.innerType});function km(n){return new zm({type:"optional",innerType:n})}const Nz=q("ZodExactOptional",(n,e)=>{aM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>ym(n,t,i,o),n.unwrap=()=>n._zod.def.innerType});function Dz(n){return new Nz({type:"optional",innerType:n})}const Mz=q("ZodNullable",(n,e)=>{AM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>TR(n,t,i,o),n.unwrap=()=>n._zod.def.innerType});function _m(n){return new Mz({type:"nullable",innerType:n})}const Rz=q("ZodDefault",(n,e)=>{CM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>NR(n,t,i,o),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function zz(n,e){return new Rz({type:"default",innerType:n,get defaultValue(){return typeof e=="function"?e():Lp(e)}})}const kz=q("ZodPrefault",(n,e)=>{IM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>DR(n,t,i,o),n.unwrap=()=>n._zod.def.innerType});function _z(n,e){return new kz({type:"prefault",innerType:n,get defaultValue(){return typeof e=="function"?e():Lp(e)}})}const jm=q("ZodNonOptional",(n,e)=>{lM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>OR(n,t,i,o),n.unwrap=()=>n._zod.def.innerType});function jz(n,e){return new jm({type:"nonoptional",innerType:n,...ye(e)})}const Zz=q("ZodCatch",(n,e)=>{cM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>MR(n,t,i,o),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function Pz(n,e){return new Zz({type:"catch",innerType:n,catchValue:typeof e=="function"?e:()=>e})}const Bz=q("ZodPipe",(n,e)=>{dM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>RR(n,t,i,o),n.in=e.in,n.out=e.out});function Zm(n,e){return new Bz({type:"pipe",in:n,out:e})}const Lz=q("ZodReadonly",(n,e)=>{uM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>zR(n,t,i,o),n.unwrap=()=>n._zod.def.innerType});function Gz(n){return new Lz({type:"readonly",innerType:n})}const Fz=q("ZodCustom",(n,e)=>{hM.init(n,e),zt.init(n,e),n._zod.processJSONSchema=(t,i,o)=>vR(n,t)});function Vz(n,e={}){return aR(Fz,n,e)}function Uz(n,e){return AR(n,e)}const Yz="compass.query/1",Hz=["file","module","package","namespace","class","struct","interface","trait","protocol","enum","enum_member","type_alias","function","method","constructor","property","field","variable","constant","parameter","import","export","macro","annotation","route","component","event","message","topic","queue","job","resource","schema","query","migration","config_key","database","database_schema","database_table","database_view","database_column","database_index","database_constraint","database_procedure","database_trigger"],Kz=["contains","calls","imports","exports","extends","implements","references","type_of","returns","instantiates","overrides","decorates","routes_to","reads","writes","aliases","registers","handles","publishes","subscribes","produces","consumes","schedules","triggers","tests","depends_on","documents","maps_to"],Wz=["controller","route_handler","middleware","service","resolver","consumer","producer","subscriber","repository","model","test","fixture","generated"],Qz=["search","callers","callees","impact","explore","node_trail"],ac=z().min(1).refine(n=>n.includes("\\")||n.startsWith("/")||/^[A-Za-z]:/.test(n)?!1:n.split("/").every(e=>e!==""&&e!=="."&&e!==".."),"source path must be a safe repository-relative path"),Br=ce({file:ac,startByte:G().int().nonnegative(),endByte:G().int().nonnegative(),startLine:G().int().positive(),startColumn:G().int().nonnegative(),endLine:G().int().positive(),endColumn:G().int().nonnegative()}).refine(n=>n.endByte>=n.startByte&&(n.endLine>n.startLine||n.endLine===n.startLine&&n.endColumn>=n.startColumn),"source anchor must be ordered"),Xz=Ge(Hz),$z=Ge(Kz),qz=Ge(Wz),Jz=Ge(Qz),ek=Ge(["structural_graph","program_ir"]),tk=Ge(["ast","config","convention","artifact","heuristic"]),Ac=Ge(["exact","inferred","ambiguous"]),Cc=Ge(["exact","ambiguous","unresolved"]),nk=ce({nodeId:z().min(1),reason:z().min(1),confidence:Ac,score:G().finite().nullable().optional(),anchor:Br.nullable().optional()}),QA=ce({layer:ek,origin:tk,extractor:z().min(1),confidence:Ac,anchor:Br.nullable(),rule:z().min(1).nullable(),wiringSite:Br.nullable(),resolution:Cc,candidates:Oe(nk).max(20).default([])}),ik=ce({type:at("file"),data:ce({contentDigest:z().min(1),byteSize:G().int().nonnegative(),generated:kn()})}),gk=ce({type:at("symbol"),data:ce({signature:z().nullable().optional(),modifiers:Oe(z()).default([]),overloadDiscriminator:z().nullable().optional(),declaringType:z().nullable().optional(),signatureDigest:z().nullable().optional(),implementationDigest:z().nullable().optional(),sourceDigest:z().nullable().optional()})}),ok=ce({type:at("import_export"),data:ce({specifier:z(),importedName:z().nullable().optional(),localName:z().nullable().optional(),typeOnly:kn()})}),sk=ce({type:at("route"),data:ce({operation:z(),path:z(),originalPath:z().nullable().optional(),declaringScope:z(),resolution:Cc,middlewareCount:G().int().nonnegative()})}),rk=ce({type:at("component"),data:ce({componentType:z()})}),ak=ce({type:at("resource"),data:ce({resourceKind:Ge(["document","paper","image","concept","rationale"]),uri:z().nullable().optional(),mediaType:z().nullable().optional()})}),Ak=ce({type:at("messaging"),data:ce({transport:z(),subject:z(),declaringScope:z()})}),Ck=ce({type:at("job"),data:ce({schedule:z().nullable().optional(),queue:z().nullable().optional()})}),Ik=ce({type:at("schema"),data:ce({dialect:z().nullable().optional(),logicalDatabase:z().nullable().optional(),namespace:z().nullable().optional()})}),lk=ce({type:at("query"),data:ce({dialect:z().nullable().optional(),operation:z().nullable().optional(),textDigest:z().nullable().optional()})}),ck=ce({type:at("config"),data:ce({format:z(),keyPath:z()})}),dk=ce({type:at("database"),data:ce({logicalDatabase:z(),databaseSchema:z().nullable().optional()})}),uk=WA("type",[ik,gk,ok,sk,rk,ak,Ak,Ck,Ik,lk,ck,dk]),hk=ce({type:at("call"),data:ce({dispatch:Ge(["static","virtual","dynamic"]),receiverType:z().nullable().optional(),argumentCount:G().int().nonnegative().nullable().optional()})}),fk=ce({type:at("route"),data:ce({stage:Ge(["middleware","handler"]),position:G().int().nonnegative().nullable().optional(),operation:z().nullable().optional()})}),pk=ce({type:at("messaging"),data:ce({transport:z(),subject:z()})}),mk=ce({type:at("schedule"),data:ce({expression:z().nullable().optional()})}),vk=ce({type:at("mapping"),data:ce({mappingKind:z()})}),Pm=WA("type",[hk,fk,pk,mk,vk]),bk=ce({maxDepth:G().int().positive(),maxNodes:G().int().positive(),maxEdges:G().int().positive(),maxPaths:G().int().positive(),maxCandidates:G().int().positive(),maxSourceBytes:G().int().positive(),maxResponseBytes:G().int().positive()}),yk=ce({nodeId:z().min(1),score:G().finite(),matchedFields:Oe(z())}),wk=ce({id:z().min(1),kind:Xz,roles:Oe(qz),name:z().min(1),qualifiedName:z().min(1),language:z().nullable(),framework:z().nullable(),source:Br.nullable(),details:uk.nullable(),evidence:Oe(QA)}),xk=ce({id:z().min(1),source:z().min(1),target:z().min(1),kind:$z,relationshipSite:Br.nullable(),details:Pm.nullable(),evidence:Oe(QA)}),Ek=ce({path:ac,contentDigest:z().min(1),source:z().nullable(),truncated:kn()}),Sk=ce({id:z().min(1),nodeIds:Oe(z().min(1)),edgeIds:Oe(z().min(1)),weakestResolution:Cc,weakestConfidence:Ac}),Tk=ce({code:Ge(["no_match","ambiguous_match","direction_mismatch","unresolved_handler","incomplete_coverage","stale_source_digest","bounded_truncation","program_orphan","program_conflict","program_unavailable"]),message:z().min(1),nodeId:z().nullable(),path:ac.nullable()}),Ok=ce({schema:at(Yz),operation:Jz,results:Oe(yk),nodes:Oe(wk),edges:Oe(xk),files:Oe(Ek),paths:Oe(Sk),diagnostics:Oe(Tk),limits:bk,truncated:kn()}),Nk="compass.viewer.graph/1",Ic=dt({file:z(),startLine:G().int().positive().optional(),endLine:G().int().positive().optional(),startByte:G().int().nonnegative().optional(),endByte:G().int().nonnegative().optional()}).passthrough(),Dk=dt({field:z().min(1),before:mo().optional(),after:mo().optional()}),Bm=dt({before:sc(z(),mo()).optional(),after:sc(z(),mo()).optional(),fields:Oe(Dk)}),Mk=dt({id:z().min(1),label:z(),kind:z().optional(),community:G().int(),communityName:z().optional(),degree:G().int().nonnegative().optional(),language:z().optional(),signature:z().optional(),size:G().positive().optional(),memberCount:G().int().nonnegative().optional(),detailAvailable:kn().optional(),learningStatus:z().optional(),learningStale:kn().optional(),depth:G().int().nonnegative().optional(),root:kn().optional(),change:Ge(["added","removed","changed","unchanged"]).optional(),evidence:Bm.optional(),codeEvidence:Oe(QA).optional(),source:Ic.optional(),color:dt({background:z(),border:z()}).passthrough().optional()}).passthrough(),Rk=dt({id:z().min(1),source:z().min(1),target:z().min(1),relation:z(),weight:G().int().positive().optional(),change:Ge(["added","removed","changed","unchanged"]).optional(),evidence:Bm.optional(),codeEvidence:Oe(QA).optional(),details:Pm.nullable().optional(),relationshipSite:Ic.optional(),confidence:Ge(["extracted","inferred","ambiguous","aggregated"]).optional()}).passthrough(),zk=dt({id:G().int(),label:z(),color:z(),hidden:kn().default(!1)}).passthrough(),Sg=dt({schema:at(Nk),title:z(),stats:dt({nodes:G().int().nonnegative(),edges:G().int().nonnegative(),communities:G().int().nonnegative(),aggregated:kn()}).passthrough(),nodes:Oe(Mk),edges:Oe(Rk),communities:Oe(zk),hyperedges:Oe(mo()).default([])}).passthrough(),kk=Ge(["resolved","inferred","ambiguous","unresolved"]),Lm=dt({source_file:z(),start_byte:G().int().nonnegative(),end_byte:G().int().nonnegative()}),_k=dt({id:z(),symbol:z().nullable(),name:z(),file:z().nullable(),anchor:Lm.nullable().optional(),startLine:G().int().positive().nullable().optional(),endLine:G().int().positive().nullable().optional(),startByte:G().int().nonnegative().nullable().optional(),endByte:G().int().nonnegative().nullable().optional(),graphNodeId:z().nullable(),unresolved:kn(),evidenceLayer:Ge(["structural_graph","program_ir","combined"]).optional()}),jk=Mm([dt({anchor:Lm,evidence:Oe(z())}),dt({sourceFile:z().nullable(),line:G().int().positive().nullable(),startByte:G().int().nonnegative().nullable(),endByte:G().int().nonnegative().nullable(),evidence:Oe(z())})]),Zk=dt({id:z(),source:z(),target:z(),callee:z(),resolution:kk,confidence:z().nullable().optional(),callSites:Oe(jk),evidenceLayer:Ge(["structural_graph","program_ir","combined"]).optional()}),Pk=dt({schema:Ge(["compass.program.call_graph/1","compass.call_graph/1"]),rootSymbol:z(),direction:Ge(["callers","callees","both"]),depth:G().int().positive(),nodes:Oe(_k),edges:Oe(Zk),truncated:kn(),continuations:Oe(dt({symbol:z(),direction:Ge(["callers","callees","both"]),nextDepth:G().int().positive()})),coverage:dt({resolved:G().int().nonnegative(),inferred:G().int().nonnegative(),ambiguous:G().int().nonnegative(),unresolved:G().int().nonnegative(),evidenceLayer:Ge(["structural_graph","program_ir","combined"]).optional(),partial:kn().optional(),limitations:Oe(z()).optional(),warning:z()})}),Bk="compass.viewer.architecture/1",Lk=Ge(["production","all_code"]),Gm=Ge(["execution","dependency","type","structure","contextual","unknown"]),Fm=Ge(["architecture","execution","dependency","type","structure","all"]),Gk=Ge(["owner","subsystem"]),Fk=Ge(["overview","detail"]),Vk=Ge(["overlay","persisted","owner","path","declaration","hub","provider","fallback"]),Uk=Ge(["good","degraded","insufficient"]),Yk=Ge(["info","warning","error"]),Hk=Ge(["production","test","generated","vendor","documentation","unknown"]),Vm=ce({production:G().int().nonnegative(),test:G().int().nonnegative(),generated:G().int().nonnegative(),vendor:G().int().nonnegative(),documentation:G().int().nonnegative(),unknown:G().int().nonnegative()}),Um=ce({execution:G().int().nonnegative(),dependency:G().int().nonnegative(),type:G().int().nonnegative(),structure:G().int().nonnegative(),contextual:G().int().nonnegative(),unknown:G().int().nonnegative()}),Kk=ce({extracted:G().int().nonnegative(),inferred:G().int().nonnegative(),ambiguous:G().int().nonnegative()}),Wk=ce({id:z().min(1),label:z(),kind:z(),sourceFile:z().nullable(),sourceScope:Hk,scopeReason:z().min(1),community:G().int().nonnegative().nullable()}),Qk=ce({id:z().min(1),source:z().min(1),target:z().min(1),relation:z(),relationClass:Gm,confidence:Ge(["extracted","inferred","ambiguous"])}),Xk=ce({value:z().min(1),provenance:Vk,membershipSignature:z().min(1),quality:G().int().min(0).max(100),evidence:Oe(z())}),$k=ce({id:z().min(1),parentId:z().nullable(),kind:Gk,rank:G().int().positive(),name:Xk,ownerKey:z().min(1),communityIds:Oe(G().int().nonnegative()),nodeCount:G().int().nonnegative(),relationshipCount:G().int().nonnegative(),neighborCount:G().int().nonnegative(),cohesion:G().finite(),sourceScopes:Vm,pinned:kn()}),qk=ce({nodeIndex:G().int().nonnegative(),groupIndex:G().int().nonnegative()}),Jk=ce({id:z().min(1),level:Fk,ownerId:z().nullable(),sourceGroup:z().min(1),targetGroup:z().min(1),relationshipCount:G().int().nonnegative(),relationClasses:Um,evidence:Kk}),e3=ce({admitted:G().int().nonnegative(),internal:G().int().nonnegative(),crossGroup:G().int().nonnegative(),unassigned:G().int().nonnegative(),relationClasses:Um}),Ym=ce({totalGroups:G().int().nonnegative(),shownGroups:G().int().nonnegative(),omittedGroups:G().int().nonnegative(),representedNodes:G().int().nonnegative(),omittedNodes:G().int().nonnegative(),representedRelationships:G().int().nonnegative(),omittedRelationships:G().int().nonnegative(),witnessGroupIds:Oe(z()),maxOverviewGroups:G().int().positive(),maxOverviewRoutes:G().int().positive()}),t3=ce({code:z().min(1),severity:Yk,message:z(),observed:G().nullable(),threshold:G().nullable(),witnesses:Oe(z()),recommendedAction:z()}),Hm=ce({status:Uk,metrics:ce({sourceScopes:Vm,unknownSourceFraction:G().min(0).max(1),generatedVendorLeakage:G().int().nonnegative(),representedNodeFraction:G().min(0).max(1),representedRelationshipFraction:G().min(0).max(1),duplicateNames:G().int().nonnegative(),fallbackNames:G().int().nonnegative(),largestGroupFraction:G().min(0).max(1),unknownRelations:G().int().nonnegative(),unassignedNodes:G().int().nonnegative(),unassignedRelationships:G().int().nonnegative()}),diagnostics:Oe(t3)}),n3=ce({scope:Lk,defaultLens:Fm,groups:Oe($k),memberships:Oe(qk),routes:Oe(Jk),overviewGroupIds:Oe(z()),overviewRouteIds:Oe(z()),coverage:e3,omissions:Ym,quality:Hm}),i3=ce({maxNodes:G().int().positive(),maxRelationships:G().int().positive(),maxGroups:G().int().positive(),maxRoutes:G().int().positive(),maxOverviewGroups:G().int().positive(),maxOverviewRoutes:G().int().positive(),maxNameCandidates:G().int().positive(),maxNameEvidence:G().int().positive(),maxDiagnostics:G().int().positive(),maxOmissionWitnesses:G().int().positive()}),g3=ce({schema:at(Bk),title:z(),nodes:Oe(Wk),relationships:Oe(Qk),projections:Oe(n3).min(1),statistics:ce({nodes:G().int().nonnegative(),relationships:G().int().nonnegative(),communities:G().int().nonnegative(),extracted:G().int().nonnegative(),inferred:G().int().nonnegative(),ambiguous:G().int().nonnegative()}),provenance:ce({projectName:z(),builtAtCommit:z().nullable(),generatedAt:z().nullable()}),limits:i3}).superRefine((n,e)=>{const t=new Set(n.nodes.map(i=>i.id));t.size!==n.nodes.length&&e.addIssue({code:"custom",path:["nodes"],message:"node IDs must be unique"});for(const[i,o]of n.relationships.entries())(!t.has(o.source)||!t.has(o.target))&&e.addIssue({code:"custom",path:["relationships",i],message:"relationship endpoints must identify included nodes"});for(const[i,o]of n.projections.entries()){const r=new Set(o.groups.map(A=>A.id));for(const[A,I]of o.memberships.entries())(I.nodeIndex>=n.nodes.length||I.groupIndex>=o.groups.length)&&e.addIssue({code:"custom",path:["projections",i,"memberships",A],message:"membership indexes must identify an included node and group"});for(const[A,I]of o.routes.entries())(!r.has(I.sourceGroup)||!r.has(I.targetGroup))&&e.addIssue({code:"custom",path:["projections",i,"routes",A],message:"route endpoints must identify included groups"})}}),o3=Ge(["production","all"]),s3=Ge(["all","extracted","inferred","ambiguous"]),r3=Ge(["production","test","generated","vendor","documentation","unknown"]),a3=Ge(["extracted","inferred","ambiguous"]),A3=dt({production:G().int().nonnegative(),test:G().int().nonnegative(),generated:G().int().nonnegative(),vendor:G().int().nonnegative(),documentation:G().int().nonnegative(),unknown:G().int().nonnegative()}),C3=dt({id:z(),name:z(),nodeCount:G().int().nonnegative(),totalNodeCount:G().int().nonnegative(),internalRelationshipCount:G().int().nonnegative(),incomingRelationships:G().int().nonnegative(),outgoingRelationships:G().int().nonnegative(),scopes:A3}),I3=dt({id:z(),sourceGroup:z(),targetGroup:z(),relationships:G().int().nonnegative(),extracted:G().int().nonnegative(),inferred:G().int().nonnegative(),ambiguous:G().int().nonnegative()});dt({title:z(),scope:o3,evidence:s3,lens:Fm,groups:Oe(C3),routes:Oe(I3),statistics:dt({visibleNodes:G().int().nonnegative(),totalNodes:G().int().nonnegative(),visibleRelationships:G().int().nonnegative(),totalRelationships:G().int().nonnegative(),communities:G().int().nonnegative(),extracted:G().int().nonnegative(),inferred:G().int().nonnegative(),ambiguous:G().int().nonnegative()}),coverage:dt({internal:G().int().nonnegative(),crossGroup:G().int().nonnegative(),unassigned:G().int().nonnegative()}),omissions:Ym,quality:Hm,provenance:dt({projectName:z(),builtAtCommit:z().nullable(),generatedAt:z().nullable()})});const l3=dt({id:z(),label:z(),kind:z(),sourceFile:z().nullable(),scope:r3,groupId:z()}),Km=dt({id:z(),source:z(),target:z(),sourceLabel:z(),targetLabel:z(),sourceFile:z().nullable(),targetFile:z().nullable(),sourceGroup:z(),targetGroup:z(),relation:z(),relationClass:Gm,confidence:a3}),XA=dt({page:G().int().positive(),pageSize:G().int().min(1).max(100),pageCount:G().int().positive(),total:G().int().nonnegative(),start:G().int().nonnegative(),end:G().int().nonnegative()});WA("kind",[XA.extend({kind:at("symbols"),groupId:z(),items:Oe(l3)}),XA.extend({kind:at("relationships"),groupId:z(),items:Oe(Km)})]),XA.extend({routeId:z(),sourceGroup:z(),targetGroup:z(),items:Oe(Km)});const c3=dt({id:z(),kind:Ge(["group","symbol","relationship"]),label:z(),detail:z(),groupId:z().nullable(),routeId:z().nullable(),sourceFile:z().nullable()});XA.extend({query:z(),items:Oe(c3)});const d3="compass.viewer.workbench/1",u3=ce({status:Ge(["complete","summary","partial"]),truncated:kn(),nodes:G().int().nonnegative(),edges:G().int().nonnegative(),limitations:Oe(z()).default([])}),vo={id:z().min(1),title:z().min(1),description:z(),coverage:u3},h3=Ge(["dependencies","routes","data","messaging","tests","provenance"]),f3=WA("kind",[ce({...vo,kind:at("code"),model:Sg,communityDetails:sc(z(),Sg).default({})}),ce({...vo,kind:at("call"),root:z(),graph:Pk}),ce({...vo,kind:at("impact"),root:z(),result:Ok}),ce({...vo,kind:at("architecture"),model:g3}),ce({...vo,kind:at("history"),baseRevision:z(),targetRevision:z(),before:Sg,after:Sg}),ce({...vo,kind:at("affected"),root:z(),relations:Oe(z()),depth:G().int().nonnegative(),model:Sg}),ce({...vo,kind:at("artifact"),lens:h3,relations:Oe(z()),model:Sg})]),p3=ce({schema:at(d3),title:z(),graphIdentity:z().min(1),defaultView:z(),views:Oe(f3).min(1)}).superRefine((n,e)=>{const t=new Set;for(const[i,o]of n.views.entries())t.has(o.id)&&e.addIssue({code:"custom",path:["views",i,"id"],message:`duplicate workbench view id '${o.id}'`}),t.add(o.id);t.has(n.defaultView)||e.addIssue({code:"custom",path:["defaultView"],message:"defaultView must identify one included view"})});var B=Kl();const m3=eN({__proto__:null,default:tN(B)},[B]);const v3=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),b3=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,i)=>i?i.toUpperCase():t.toLowerCase()),Wm=n=>{const e=b3(n);return e.charAt(0).toUpperCase()+e.slice(1)},Qm=(...n)=>n.filter((e,t,i)=>!!e&&e.trim()!==""&&i.indexOf(e)===t).join(" ").trim(),y3=n=>{for(const e in n)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var w3={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const x3=B.forwardRef(({color:n="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:i,className:o="",children:r,iconNode:A,...I},l)=>B.createElement("svg",{ref:l,...w3,width:e,height:e,stroke:n,strokeWidth:i?Number(t)*24/Number(e):t,className:Qm("lucide",o),...!r&&!y3(I)&&{"aria-hidden":"true"},...I},[...A.map(([c,h])=>B.createElement(c,h)),...Array.isArray(r)?r:[r]]));const je=(n,e)=>{const t=B.forwardRef(({className:i,...o},r)=>B.createElement(x3,{ref:r,iconNode:e,className:Qm(`lucide-${v3(Wm(n))}`,`lucide-${n}`,i),...o}));return t.displayName=Wm(n),t};const E3=je("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);const S3=je("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const T3=je("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const O3=je("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);const N3=je("badge-check",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const D3=je("boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);const M3=je("braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const R3=je("circle-dot-dashed",[["path",{d:"M10.1 2.18a9.93 9.93 0 0 1 3.8 0",key:"1qdqn0"}],["path",{d:"M17.6 3.71a9.95 9.95 0 0 1 2.69 2.7",key:"1bq7p6"}],["path",{d:"M21.82 10.1a9.93 9.93 0 0 1 0 3.8",key:"1rlaqf"}],["path",{d:"M20.29 17.6a9.95 9.95 0 0 1-2.7 2.69",key:"1xk03u"}],["path",{d:"M13.9 21.82a9.94 9.94 0 0 1-3.8 0",key:"l7re25"}],["path",{d:"M6.4 20.29a9.95 9.95 0 0 1-2.69-2.7",key:"1v18p6"}],["path",{d:"M2.18 13.9a9.93 9.93 0 0 1 0-3.8",key:"xdo6bj"}],["path",{d:"M3.71 6.4a9.95 9.95 0 0 1 2.7-2.69",key:"1jjmaz"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);const Xm=je("circle-question-mark",[["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"}]]);const z3=je("compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const $A=je("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const k3=je("file-code-2",[["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"}]]);const _3=je("file-cog",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m2.305 15.53.923-.382",key:"yfp9st"}],["path",{d:"m3.228 12.852-.924-.383",key:"bckynb"}],["path",{d:"M4.677 21.5a2 2 0 0 0 1.313.5H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2.5",key:"1yo3oz"}],["path",{d:"m4.852 11.228-.383-.923",key:"1j88i9"}],["path",{d:"m4.852 16.772-.383.924",key:"sag1dv"}],["path",{d:"m7.148 11.228.383-.923",key:"rj39hk"}],["path",{d:"m7.53 17.696-.382-.924",key:"1uu5cs"}],["path",{d:"m8.772 12.852.923-.383",key:"13811l"}],["path",{d:"m8.772 15.148.923.383",key:"z1a5l0"}],["circle",{cx:"6",cy:"14",r:"3",key:"a1xfv6"}]]);const j3=je("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"}]]);const $m=je("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);const qm=je("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]);const lc=je("git-fork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);const Z3=je("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"}]]);const P3=je("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);const B3=je("map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);const Jm=je("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]);const L3=je("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const G3=je("move",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m19 9 3 3-3 3",key:"1mg7y2"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}],["path",{d:"m9 5 3-3 3 3",key:"l8vdw6"}]]);const cc=je("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);const F3=je("panel-left-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);const V3=je("panel-left-open",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);const ev=je("panel-right-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);const U3=je("panel-right-open",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]]);const tv=je("pause",[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]);const Y3=je("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);const nv=je("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const iv=je("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const gv=je("route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);const ov=je("scan-search",[["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"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);const H3=je("search-code",[["path",{d:"m13 13.5 2-2.5-2-2.5",key:"1rvxrh"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}],["path",{d:"M9 8.5 7 11l2 2.5",key:"6ffwbx"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const sv=je("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const K3=je("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const W3=je("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const Q3=je("signpost",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M12 3v3",key:"1n5kay"}],["path",{d:"M18 6a2 2 0 0 1 1.387.56l2.307 2.22a1 1 0 0 1 0 1.44l-2.307 2.22A2 2 0 0 1 18 13H6a2 2 0 0 1-1.387-.56l-2.306-2.22a1 1 0 0 1 0-1.44l2.306-2.22A2 2 0 0 1 6 6z",key:"gqqp9m"}]]);const X3=je("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);const $3=je("tags",[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]]);const qA=je("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const q3=je("waypoints",[["circle",{cx:"12",cy:"4.5",r:"2.5",key:"r5ysbb"}],["path",{d:"m10.2 6.3-3.9 3.9",key:"1nzqf6"}],["circle",{cx:"4.5",cy:"12",r:"2.5",key:"jydg6v"}],["path",{d:"M7 12h10",key:"b7w52i"}],["circle",{cx:"19.5",cy:"12",r:"2.5",key:"1piiel"}],["path",{d:"m13.8 17.7 3.9-3.9",key:"1wyg1y"}],["circle",{cx:"12",cy:"19.5",r:"2.5",key:"13o1pw"}]]);const J3=je("zoom-in",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);const e_=je("zoom-out",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),rv=new Set(["color","change","evidence"]),t_=new Set(["anchor","anchors","columnEnd","columnStart","community","communityName","community_name","degree","endByte","endColumn","endLine","lineEnd","lineStart","line_end","line_start","location","normLabel","norm_label","relationshipSite","relationship_site","size","sourceDigest","sourceFile","sourceHash","source_digest","source_file","source_hash","startByte","startColumn","startLine","wiringSite","wiring_site"]);function JA(n,e){const t=eC(n),i=eC(e);return{...t?{before:t}:{},...i?{after:i}:{},fields:uc(t,i)}}function av(n,e,t){const i=eC(n),o=eC(e),r=dc(n,t),A=dc(e,t);return{...i?{before:i}:{},...o?{after:o}:{},fields:uc(r,A)}}function n_(n,e){return dc(n,e)??{}}function i_(n,e=240){const t=n===void 0?"Not recorded":typeof n=="string"?n:JSON.stringify(n,null,Lr(n)?2:void 0)??String(n);return t.length<=e?{text:t,truncated:!1}:{text:`${t.slice(0,Math.max(0,e-1)).trimEnd()}…`,truncated:!0}}function eC(n){if(n)return Iv(n)}function dc(n,e){return n?Cv(n,e==="node"?new Set(["source"]):new Set(["id","key"])):void 0}function Av(n){return Array.isArray(n)?n.map(Av):Lr(n)?Cv(n):n}function Cv(n,e=new Set){return Object.fromEntries(Object.keys(n).filter(t=>!rv.has(t)&&!t_.has(t)&&!e.has(t)).sort((t,i)=>t.localeCompare(i)).map(t=>[t,Av(n[t])]))}function tC(n){return Array.isArray(n)?n.map(tC):Lr(n)?Iv(n):n}function Iv(n){return Object.fromEntries(Object.keys(n).filter(e=>!rv.has(e)).sort((e,t)=>e.localeCompare(t)).map(e=>[e,tC(n[e])]))}function uc(n,e,t=""){const i=new Set([...Object.keys(n??{}),...Object.keys(e??{})]),o=[];for(const r of[...i].sort((A,I)=>A.localeCompare(I))){const A=t?`${t}.${r}`:r,I=n?.[r],l=e?.[r];Lr(I)&&Lr(l)?o.push(...uc(I,l,A)):g_(I,l)||o.push({field:A,...I!==void 0?{before:I}:{},...l!==void 0?{after:l}:{}})}return o}function g_(n,e){return JSON.stringify(tC(n))===JSON.stringify(tC(e))}function Lr(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function o_({node:n,edges:e,nodes:t,sourceRevisions:i,onFocus:o,onOpenSource:r}){const A=dv(n.evidence?.before),I=dv(n.evidence?.after);return f.jsxs(f.Fragment,{children:[n.evidence?.fields.length?f.jsxs("section",{className:"compass-record-evidence","aria-labelledby":"compass-node-changes-title",children:[f.jsxs("div",{className:"compass-evidence-heading",children:[f.jsx("h3",{id:"compass-node-changes-title",children:s_(n.change)}),f.jsxs("span",{children:[n.evidence.fields.length," fields"]})]}),f.jsx(lv,{fields:n.evidence.fields}),n.change==="changed"&&(A||I)&&f.jsxs("div",{className:"compass-evidence-source-actions",children:[A&&f.jsxs("button",{type:"button",onClick:()=>r(A,i?.before),children:[f.jsx($A,{"aria-hidden":"true"}),"Open before"]}),I&&f.jsxs("button",{type:"button",onClick:()=>r(I,i?.after),children:[f.jsx($A,{"aria-hidden":"true"}),"Open after"]})]})]}):null,f.jsxs("section",{className:"compass-relationship-evidence","aria-labelledby":"compass-relationships-title",children:[f.jsxs("div",{className:"compass-neighbors-heading",children:[f.jsx("span",{id:"compass-relationships-title",children:"Relationships"}),f.jsx("strong",{children:e.length})]}),e.length?f.jsx("div",{className:"compass-relationship-list",children:e.map(l=>{const c=l.source===n.id?l.target:l.source,h=t.get(c);return f.jsxs("details",{children:[f.jsxs("summary",{children:[f.jsx("span",{className:"compass-change-badge","data-change":l.change,children:uv(l.change)}),f.jsx("span",{className:"compass-relationship-target",children:h?.label??c}),f.jsx("small",{children:l.relation}),l.confidence&&f.jsx("i",{children:l.confidence})]}),f.jsxs("div",{className:"compass-relationship-detail",children:[l.change==="changed"&&l.evidence?.fields.length?f.jsx(lv,{fields:l.evidence.fields}):f.jsxs("p",{children:[uv(l.change)," relationship: ",l.source," → ",l.target]}),f.jsxs("button",{type:"button",onClick:()=>o(c),children:["Focus ",h?.label??c]})]})]},l.id)})}):f.jsx("span",{className:"compass-empty",children:"No connected relationships"})]})]})}function lv({fields:n}){return f.jsx("div",{className:"compass-field-table-wrap",children:f.jsxs("table",{className:"compass-field-table",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:"Field"}),f.jsx("th",{children:"Before"}),f.jsx("th",{children:"After"})]})}),f.jsx("tbody",{children:n.map(e=>f.jsxs("tr",{children:[f.jsx("th",{scope:"row",children:e.field}),f.jsx(cv,{value:e.before}),f.jsx(cv,{value:e.after})]},e.field))})]})})}function cv({value:n}){const e=i_(n);return f.jsxs("td",{children:[f.jsx("code",{children:e.text}),e.truncated&&f.jsx("span",{className:"compass-value-truncated",children:"Value shortened"})]})}function dv(n){const e=Ic.safeParse(n?.source);return e.success?e.data:void 0}function uv(n){return!n||n==="unchanged"?"Context":`${n[0]?.toLocaleUpperCase()}${n.slice(1)}`}function s_(n){return n==="added"?"Added symbol metadata":n==="removed"?"Removed symbol metadata":"What changed"}const hv=100,fv={changed:0,added:1,removed:2,unchanged:3};function r_({nodes:n,query:e,selectedId:t,onFocus:i}){const[o,r]=B.useState(!1),A=e.trim().toLocaleLowerCase(),I=n.filter(c=>c.change&&c.change!=="unchanged").filter(c=>!A||c.label.toLocaleLowerCase().includes(A)||c.kind?.toLocaleLowerCase().includes(A)||c.source?.file.toLocaleLowerCase().includes(A)).sort((c,h)=>fv[c.change??"unchanged"]-fv[h.change??"unchanged"]||c.label.localeCompare(h.label)||c.id.localeCompare(h.id)),l=o?I:I.slice(0,hv);return f.jsxs("section",{className:"compass-changed-symbols","aria-labelledby":"compass-changed-symbols-title",children:[f.jsxs("div",{className:"compass-section-heading",children:[f.jsx("h2",{id:"compass-changed-symbols-title",children:"Changed symbols"}),f.jsx("span",{children:I.length})]}),l.length?f.jsx("div",{className:"compass-changed-symbol-list",children:l.map(c=>f.jsxs("button",{type:"button","aria-pressed":c.id===t,"data-change":c.change,onClick:()=>i(c.id),children:[f.jsx("span",{className:"compass-changed-symbol-status",children:a_(c.change)}),f.jsx("strong",{children:c.label}),f.jsx("small",{children:c.source?.file??c.kind??"Graph symbol"})]},c.id))}):f.jsx("p",{className:"compass-empty",children:A?"No affected symbols match this search.":"No symbol changes."}),!o&&I.length>hv&&f.jsxs("button",{className:"compass-changed-symbol-expand",type:"button",onClick:()=>r(!0),children:["Show all ",I.length.toLocaleString()," affected symbols"]})]})}function a_(n){return!n||n==="unchanged"?"Context":`${n[0]?.toLocaleUpperCase()}${n.slice(1)}`}function pv({evidence:n,diagnostics:e=[],truncated:t=!1,title:i="Trust evidence",onOpenSource:o}){return!n.length&&!e.length&&!t?null:f.jsxs("section",{className:"compass-code-evidence","aria-label":i,children:[f.jsxs("div",{className:"compass-evidence-heading",children:[f.jsx("h3",{children:i}),f.jsxs("span",{children:[n.length," ",n.length===1?"record":"records"]})]}),t&&f.jsxs("p",{className:"compass-code-diagnostic","data-severity":"warning",role:"status",children:[f.jsx(qA,{"aria-hidden":"true"}),"Results reached a configured limit. Narrow the query or raise one bound."]}),e.map(r=>f.jsxs("p",{className:"compass-code-diagnostic","data-severity":r.code==="no_match"?"info":"warning",role:"status",children:[r.code==="no_match"?f.jsx(Xm,{"aria-hidden":"true"}):f.jsx(qA,{"aria-hidden":"true"}),f.jsxs("span",{children:[f.jsx("strong",{children:I_(r.code)}),r.message]})]},`${r.code}:${r.message}`)),f.jsx("div",{className:"compass-code-evidence-ledger",children:n.map((r,A)=>{const I=C_(r),l=r.wiringSite??r.anchor;return f.jsxs("article",{className:"compass-code-evidence-entry","data-status":I.key,children:[f.jsx("span",{className:"compass-code-evidence-icon","aria-hidden":"true",children:f.jsx(A_,{item:r})}),f.jsxs("div",{className:"compass-code-evidence-copy",children:[f.jsxs("div",{className:"compass-code-evidence-status",children:[f.jsx("strong",{children:I.label}),f.jsx("span",{children:r.layer==="program_ir"?"Program IR":"Code graph"})]}),f.jsxs("dl",{children:[f.jsxs("div",{children:[f.jsx("dt",{children:"Extractor"}),f.jsx("dd",{children:r.extractor})]}),f.jsxs("div",{children:[f.jsx("dt",{children:"Confidence"}),f.jsx("dd",{children:r.confidence})]}),r.rule&&f.jsxs("div",{children:[f.jsx("dt",{children:"Rule"}),f.jsx("dd",{children:r.rule})]})]}),l&&(o?f.jsxs("button",{className:"compass-code-evidence-source",type:"button",onClick:()=>o(l),children:[f.jsx($A,{"aria-hidden":"true"}),mv(r,l)]}):f.jsx("span",{className:"compass-code-evidence-source",children:mv(r,l)})),r.candidates.length>0&&f.jsxs("div",{className:"compass-code-candidates",children:[f.jsx("span",{children:"Retained candidates"}),f.jsx("ul",{children:r.candidates.map(c=>f.jsxs("li",{children:[f.jsx("code",{children:c.nodeId}),f.jsx("span",{children:c.reason}),f.jsx("small",{children:c.confidence})]},`${c.nodeId}:${c.reason}`))})]})]})]},`${r.layer}:${r.extractor}:${A}`)})})]})}function A_({item:n}){return n.resolution==="unresolved"?f.jsx(Xm,{}):n.resolution==="ambiguous"||n.confidence==="ambiguous"?f.jsx(qA,{}):n.origin==="heuristic"?f.jsx(lc,{}):n.origin==="config"?f.jsx(_3,{}):n.origin==="convention"?f.jsx(Q3,{}):f.jsx(N3,{})}function C_(n){return n.resolution==="unresolved"?{key:"unresolved",label:"Unresolved"}:n.resolution==="ambiguous"||n.confidence==="ambiguous"?{key:"ambiguous",label:"Ambiguous"}:n.origin==="heuristic"?{key:"heuristic",label:"Heuristic"}:n.origin==="config"?{key:"config",label:"Configuration"}:n.origin==="convention"?{key:"convention",label:"Convention"}:{key:"exact",label:"Exact"}}function mv(n,e){return`${n.origin==="heuristic"?"Wired at":"Evidence at"} ${e.file}:${e.startLine}`}function I_(n){return`${n.replaceAll("_"," ")}: `}function vv(n){return yv(n.source)}function bv(n){return yv(n.relationshipSite)}function yv(n){return n?.file.trim()&&(n.startLine!==void 0||n.endLine!==void 0||n.startByte!==void 0||n.endByte!==void 0)?n:void 0}const wv=200;function l_(n,e){const t=e.trim().toLocaleLowerCase();return(t?n.filter(o=>o.label.toLocaleLowerCase().includes(t)||String(o.id).includes(t)):n).slice(0,wv)}function c_(n){const e=n.source?.startLine,t=n.source?.endLine;if(e!==void 0)return t!==void 0&&t!==e?`${e}–${t}`:String(e)}function xv(n){const e=n.source?.startLine,t=n.source?.endLine;if(e!==void 0)return t!==void 0&&t!==e?{text:`Lines ${e}–${t}`,action:`at lines ${e}–${t}`}:{text:`Line ${e}`,action:`at line ${e}`};const i=n.source?.startByte,o=n.source?.endByte;if(i!==void 0)return o!==void 0&&o!==i?{text:`Bytes ${i}–${o}`,action:`at bytes ${i}–${o}`}:{text:`Byte ${i}`,action:`at byte ${i}`}}function Ev(n,e){const t=xv(n);return`Open source ${e.file}${t?` ${t.action}`:""}`}function Sv(n){return n==="unchanged"?"Context":n?`${n[0]?.toLocaleUpperCase()}${n.slice(1)}`:void 0}function d_(n){if(n)return{added:"var(--vscode-gitDecoration-addedResourceForeground, #2ea043)",removed:"var(--vscode-gitDecoration-deletedResourceForeground, #f85149)",changed:"var(--vscode-gitDecoration-modifiedResourceForeground, #d29922)",unchanged:"var(--vscode-descriptionForeground, #6e7781)"}[n]}function u_({model:n,selected:e,neighbors:t,connectedEdges:i,query:o,matches:r,hiddenCommunities:A,comparisonMode:I,sourceRevisions:l,queryResult:c,renderedEdgeCount:h,showHeader:p,onQueryChange:m,onFocus:b,onOpenSource:w,onOpenCommunity:O,onQueryNode:x,onToggleCommunity:S,onSetAllVisible:E,collapsed:_,onToggleCollapsed:j}){const[X,ne]=B.useState(0),F=e?vv(e):void 0,V=e?c_(e):void 0,Ie=e?xv(e):void 0,Ee=B.useMemo(()=>{const W=new Map;for(const ge of n.nodes)W.set(ge.community,(W.get(ge.community)??0)+1);return W},[n.nodes]),Ze=A.size===0,xe=B.useMemo(()=>new Map(n.nodes.map(W=>[W.id,W])),[n.nodes]),Fe=(e?c?.nodes.find(W=>W.id===e.id):void 0)?.evidence??e?.codeEvidence??[],le=e?c?c.edges.filter(W=>W.source===e.id||W.target===e.id).flatMap(W=>W.evidence):i.flatMap(W=>W.codeEvidence??[]):[],M=W=>{b(W.id),m(""),ne(0)},Q=W=>{!r.length&&W.key!=="Escape"||(W.key==="ArrowDown"?(W.preventDefault(),ne((X+1)%r.length)):W.key==="ArrowUp"?(W.preventDefault(),ne((X-1+r.length)%r.length)):W.key==="Enter"&&r[X]?(W.preventDefault(),M(r[X])):W.key==="Escape"&&(m(""),ne(0)))};return _?f.jsxs("aside",{className:"compass-graph-inspector compass-graph-inspector-collapsed","aria-label":"Graph inspector",children:[f.jsx("button",{className:"compass-inspector-disclosure compass-inspector-expand",type:"button","aria-label":"Expand graph inspector",title:"Expand graph inspector",onClick:j,children:f.jsx(U3,{"aria-hidden":"true"})}),f.jsx("span",{className:"compass-inspector-rail-label","aria-hidden":"true",children:"Inspector"})]}):f.jsxs("aside",{className:"compass-graph-inspector","aria-label":"Graph inspector",children:[p&&f.jsxs("header",{className:"compass-inspector-header",children:[f.jsx("span",{className:"compass-product-mark","aria-hidden":"true",children:f.jsx(z3,{})}),f.jsxs("span",{className:"compass-inspector-title",children:[f.jsx("strong",{children:"Compass"}),f.jsx("small",{children:n.title})]}),f.jsx("button",{className:"compass-inspector-disclosure",type:"button","aria-label":"Collapse graph inspector",title:"Collapse graph inspector",onClick:j,children:f.jsx(ev,{"aria-hidden":"true"})})]}),f.jsxs("div",{className:"compass-inspector-search",role:"search",children:[f.jsx("label",{className:"sr-only",htmlFor:"compass-node-search",children:"Search graph nodes"}),f.jsxs("div",{className:"compass-inspector-search-row",children:[f.jsxs("div",{className:"compass-search-field",children:[f.jsx(sv,{"aria-hidden":"true"}),f.jsx("input",{id:"compass-node-search",type:"search",role:"combobox",value:o,placeholder:"Search nodes and files",autoComplete:"off","aria-controls":"compass-search-results","aria-autocomplete":"list","aria-expanded":r.length>0,"aria-activedescendant":r[X]?`compass-search-result-${X}`:void 0,onChange:W=>{m(W.target.value),ne(0)},onKeyDown:Q})]}),!p&&f.jsx("button",{className:"compass-inspector-disclosure compass-inspector-search-disclosure",type:"button","aria-label":"Collapse graph inspector",title:"Collapse graph inspector",onClick:j,children:f.jsx(ev,{"aria-hidden":"true"})})]}),r.length>0&&f.jsx("div",{id:"compass-search-results",className:"compass-search-results",role:"listbox","aria-label":"Matching nodes",children:r.map((W,ge)=>f.jsxs("button",{id:`compass-search-result-${ge}`,type:"button",role:"option","aria-selected":ge===X,className:"compass-search-item",onMouseEnter:()=>ne(ge),onClick:()=>M(W),children:[f.jsx("strong",{children:W.label}),f.jsx("span",{children:W.source?.file??W.kind??"Graph node"})]},W.id))})]}),f.jsxs("section",{className:"compass-info-panel","aria-labelledby":"compass-info-title",children:[f.jsxs("div",{className:"compass-section-heading",children:[f.jsx("h2",{id:"compass-info-title",children:"Inspector"}),f.jsx("span",{children:e?"Pinned":"Node details"})]}),e?f.jsxs("div",{className:"compass-info-content",children:[f.jsxs("div",{className:"compass-node-identity",children:[f.jsx("span",{className:"compass-node-swatch","aria-hidden":"true",style:{background:d_(e.change)??e.color?.background??n.communities.find(W=>W.id===e.community)?.color}}),f.jsxs("span",{children:[f.jsx("strong",{children:e.label}),f.jsx("small",{children:e.kind??"Symbol"})]}),Sv(e.change)&&f.jsx("span",{className:"compass-change-badge","data-change":e.change,children:Sv(e.change)})]}),f.jsxs("dl",{className:"compass-metadata-grid",children:[f.jsxs("div",{children:[f.jsx("dt",{children:"Community"}),f.jsx("dd",{children:e.communityName??n.communities.find(W=>W.id===e.community)?.label??e.community})]}),f.jsxs("div",{children:[f.jsx("dt",{children:"Degree"}),f.jsx("dd",{children:e.degree??t.length})]}),e.language&&f.jsxs("div",{children:[f.jsx("dt",{children:"Language"}),f.jsx("dd",{children:e.language})]}),V&&f.jsxs("div",{children:[f.jsx("dt",{children:"Lines"}),f.jsx("dd",{children:V})]}),f.jsx("div",{className:"compass-metadata-wide compass-source-metadata","data-interactive":F!==void 0,children:F?f.jsxs(f.Fragment,{children:[f.jsx("dt",{className:"sr-only",children:"Source"}),f.jsx("dd",{children:f.jsxs("button",{className:"compass-source-card",type:"button","aria-label":Ev(e,F),title:Ev(e,F),onClick:()=>w(F,e.change==="removed"?l?.before:l?.after),children:[f.jsxs("span",{className:"compass-source-copy",children:[f.jsx("span",{className:"compass-source-eyebrow","aria-hidden":"true",children:"Source"}),f.jsx("span",{className:"compass-source-path",children:F.file}),Ie&&f.jsx("span",{className:"compass-source-range",children:Ie.text})]}),f.jsx($A,{"aria-hidden":"true"})]})})]}):f.jsxs(f.Fragment,{children:[f.jsx("dt",{children:"Source"}),f.jsx("dd",{title:e.source?.file??"Not recorded",children:e.source?.file??"Not recorded"})]})})]}),e.signature&&f.jsx("code",{className:"compass-signature-block",children:e.signature}),x&&f.jsxs("div",{className:"compass-code-query-actions","aria-label":"Code graph queries",children:[f.jsx("button",{type:"button",onClick:()=>x("callers",e.id),children:"Callers"}),f.jsx("button",{type:"button",onClick:()=>x("callees",e.id),children:"Callees"}),f.jsx("button",{type:"button",onClick:()=>x("impact",e.id),children:"Impact"})]}),f.jsx(pv,{evidence:Fe,diagnostics:c?.diagnostics,truncated:c?.truncated,title:"Node evidence",onOpenSource:w}),f.jsx(pv,{evidence:le,title:"Relationship evidence",onOpenSource:w}),n.stats.aggregated&&e.memberCount!==void 0&&e.detailAvailable!==!1&&O&&f.jsxs("button",{className:"compass-inspector-action",type:"button",onClick:()=>O(e.community),children:[I?"Inspect changes":"Open community",f.jsxs("span",{children:[e.memberCount.toLocaleString()," ",I?"current symbols":"members"]})]}),n.stats.aggregated&&e.memberCount!==void 0&&e.detailAvailable===!1&&f.jsx("p",{className:"compass-empty",children:"This community detail was omitted to keep the standalone HTML export bounded. Open the graph in VS Code or export this community as JSON for full inspection."}),I?f.jsx(o_,{node:e,edges:i,nodes:xe,sourceRevisions:l,onFocus:b,onOpenSource:w}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"compass-neighbors-heading",children:[f.jsx("span",{children:"Connected nodes"}),f.jsx("strong",{children:t.length})]}),f.jsx("div",{className:"compass-neighbors-list",children:t.length?t.map(W=>f.jsxs("button",{type:"button",className:"compass-neighbor-link",title:W.label,onClick:()=>b(W.id),children:[f.jsx("span",{className:"compass-neighbor-dot","aria-hidden":"true",style:{background:W.color?.background??n.communities.find(ge=>ge.id===W.community)?.color??"var(--border)"}}),f.jsx("span",{className:"compass-neighbor-label",children:W.label})]},W.id)):f.jsx("span",{className:"compass-empty",children:"No connected nodes"})})]})]}):f.jsx("p",{className:"compass-empty",children:"Select a node to inspect its relationships."})]}),I&&!n.stats.aggregated&&f.jsx(r_,{nodes:n.nodes,query:o,selectedId:e?.id,onFocus:b}),f.jsx("section",{className:"compass-community-panel","aria-labelledby":"compass-communities-title","data-secondary":I,children:I?f.jsxs("details",{children:[f.jsxs("summary",{id:"compass-communities-title",children:["Communities",f.jsx("span",{children:n.communities.length})]}),f.jsx(Tv,{model:n,communityCounts:Ee,hiddenCommunities:A,allVisible:Ze,onSetAllVisible:E,onToggleCommunity:S})]}):f.jsxs(f.Fragment,{children:[f.jsx("h2",{id:"compass-communities-title",children:"Communities"}),f.jsx(Tv,{model:n,communityCounts:Ee,hiddenCommunities:A,allVisible:Ze,onSetAllVisible:E,onToggleCommunity:S})]})}),f.jsxs("footer",{className:"compass-graph-stats",children:[n.stats.nodes.toLocaleString()," nodes · ",n.stats.edges.toLocaleString()," edges",hl_(n.communities,A),[n.communities,A]),c=B.useMemo(()=>{const h=A.trim().toLocaleLowerCase();return h?n.communities.filter(p=>p.label.toLocaleLowerCase().includes(h)||String(p.id).includes(h)).length:n.communities.length},[n.communities,A]);return f.jsxs("div",{className:"compass-community-controls",children:[f.jsxs("label",{className:"compass-community-control",children:[f.jsx("input",{type:"checkbox",checked:i,onChange:h=>o(h.target.checked)}),f.jsx("span",{children:"Select all"})]}),n.communities.length>wv&&f.jsxs("label",{className:"compass-community-search",children:[f.jsx("span",{className:"sr-only",children:"Filter communities"}),f.jsx(sv,{"aria-hidden":"true"}),f.jsx("input",{type:"search",value:A,placeholder:"Filter communities",onChange:h=>I(h.target.value)})]}),f.jsx("div",{className:"compass-community-list",children:l.map(h=>{const p=!t.has(h.id);return f.jsxs("label",{className:"compass-community-item","data-hidden":!p,children:[f.jsx("input",{type:"checkbox",checked:p,onChange:()=>r(h.id)}),f.jsx("span",{className:"compass-community-dot","aria-hidden":"true",style:{background:h.color}}),f.jsx("span",{className:"compass-community-label",children:h.label}),f.jsx("small",{children:e.get(h.id)??0})]},h.id)})}),c>l.length&&f.jsxs("p",{className:"compass-community-limit",role:"status",children:["Showing ",l.length.toLocaleString()," of"," ",c.toLocaleString()," communities. Filter to find another community."]})]})}function h_({className:n="compass-load-logo"}){return f.jsx("svg",{className:n,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:f.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3.554 21.529c1.797 1.221 4.943-.038 11.236-2.554 1.342-.537 2.013-.806 2.54-1.267q.201-.177.378-.378c.461-.527.73-1.198 1.267-2.54 2.515-6.293 3.775-9.44 2.554-11.236a4.1 4.1 0 0 0-1.083-1.083c-1.797-1.221-4.944.037-11.236 2.554-1.342.537-2.013.806-2.54 1.267q-.201.177-.378.378c-.461.527-.73 1.198-1.267 2.54-2.517 6.292-3.775 9.439-2.554 11.236.29.426.657.793 1.083 1.083M8.25 12a3.75 3.75 0 1 1 7.5 0 3.75 3.75 0 0 1-7.5 0m1.5 0a2.25 2.25 0 1 1 4.5 0 2.25 2.25 0 0 1-4.5 0"})})}const f_=1e4;function Ov(n){const[e,t]=B.useState(!1);B.useEffect(()=>{if(n.kind!=="layout"){t(!1);return}const A=window.setTimeout(()=>{t(!0)},f_);return()=>window.clearTimeout(A)},[n.kind]);const i=n.kind==="community",o=i?`Opening ${n.communityLabel}`:e?"Still arranging this graph":"Arranging graph layout",r=i?"Fetching symbols and relationships for this community.":e?"This graph is taking longer than expected. You can open the current layout now.":"Positioning nodes and relationships for a readable first view.";return f.jsxs("section",{className:"compass-graph-transition","data-kind":n.kind,role:"status","aria-live":"polite","aria-atomic":"true",children:[f.jsxs("div",{className:"compass-load-visual","data-state":"loading","aria-hidden":"true",children:[f.jsx("span",{className:"compass-load-mark",children:f.jsx(h_,{})}),f.jsx("span",{className:"compass-load-progress",children:f.jsx("i",{})})]}),f.jsxs("div",{className:"compass-load-copy",children:[f.jsx("span",{className:"compass-load-eyebrow",children:"Compass graph"}),f.jsx("h1",{children:o}),f.jsx("p",{className:"compass-graph-transition-description",children:r}),!i&&e&&f.jsx("div",{className:"compass-load-actions",children:f.jsx("button",{className:"compass-load-action compass-load-action-primary",type:"button",onClick:n.onShowGraph,children:"Show graph now"})})]})]})}function p_(n){return n instanceof HTMLElement&&(n.isContentEditable||n.tagName==="INPUT"||n.tagName==="TEXTAREA"||n.tagName==="SELECT")}function m_({status:n,physicsRunning:e,layoutStyle:t,forceLabels:i,showEdgeLabels:o,hasSelection:r,isolateSelection:A,neighborhoodDepth:I,edgeDirection:l,layoutSpacing:c,showMinimap:h,leadingControls:p,leadingPanel:m,leadingPanelOpen:b,onLeadingPanelClose:w,onTogglePhysics:O,onLayoutChange:x,onZoomOut:S,onResetZoom:E,onZoomIn:_,onFit:j,onFitSelection:X,onReset:ne,onToggleLabels:F,onToggleEdgeLabels:V,onToggleIsolation:Ie,onNeighborhoodDepthChange:Ee,onEdgeDirectionChange:Ze,onLayoutSpacingChange:xe,onToggleMinimap:He,onBack:Fe}){const[le,M]=B.useState(!1),Q=B.useId(),W=B.useRef(null),ge=B.useRef(null),ee=B.useRef(!1);return B.useEffect(()=>{b&&M(!1)},[b]),B.useEffect(()=>{le||!ee.current||(ee.current=!1,ge.current?.focus())},[le]),B.useEffect(()=>{const T=ie=>{if(ie.key==="Escape"){le&&(ee.current=!0,M(!1));return}ie.key!=="?"||p_(ie.target)||(ie.preventDefault(),w?.(),M(!0))},U=ie=>{W.current?.contains(ie.target)||M(!1)};return document.addEventListener("keydown",T),document.addEventListener("pointerdown",U),()=>{document.removeEventListener("keydown",T),document.removeEventListener("pointerdown",U)}},[w,le]),f.jsxs("div",{ref:W,className:"compass-graph-toolbar compass-glass-panel",role:"toolbar","aria-label":"Graph controls",children:[f.jsxs("div",{className:"compass-viewer-status","data-state":e?"running":"paused",role:"status","aria-live":"polite",children:[f.jsx("span",{className:"compass-viewer-status-dot","aria-hidden":"true"}),f.jsx("span",{className:"compass-viewer-status-text",children:n})]}),f.jsxs("div",{className:"compass-toolbar-actions",children:[Fe&&f.jsxs("button",{className:"compass-tool-button",type:"button","aria-label":"Back to community overview",onClick:Fe,children:[f.jsx(S3,{}),f.jsx("span",{children:"Overview"})]}),f.jsxs("label",{className:"compass-layout-picker",children:[f.jsx(P3,{"aria-hidden":"true"}),f.jsx("span",{className:"sr-only",children:"Graph layout"}),f.jsxs("select",{"aria-label":"Graph layout",value:t,onChange:T=>x(T.target.value),children:[f.jsx("option",{value:"automatic",children:"Automatic"}),f.jsx("option",{value:"circle",children:"Circle"}),f.jsx("option",{value:"concentric",children:"Concentric"}),f.jsx("option",{value:"spiral",children:"Spiral"}),f.jsx("option",{value:"grid",children:"Square grid"})]})]}),f.jsxs("button",{className:"compass-tool-button compass-physics-button",type:"button","aria-label":e?"Stop layout":t==="automatic"?"Run layout":"Fixed layout","aria-pressed":e,disabled:t!=="automatic",title:t==="automatic"?e?"Stop layout":"Run layout":"Physics is available in Automatic layout",onClick:O,children:[e?f.jsx(tv,{}):t==="automatic"?f.jsx(Y3,{}):f.jsx(tv,{}),f.jsx("span",{children:e?"Stop":t==="automatic"?"Layout":"Fixed"})]}),f.jsx("span",{className:"compass-toolbar-separator","aria-hidden":"true"}),f.jsxs("div",{className:"compass-zoom-controls",role:"group","aria-label":"Zoom controls",children:[f.jsx("button",{className:"compass-tool-button compass-tool-icon-button",type:"button","aria-label":"Zoom out",title:"Zoom out",onClick:S,children:f.jsx(e_,{})}),f.jsx("button",{className:"compass-tool-button compass-zoom-reset",type:"button","aria-label":"Reset zoom to 100%",title:"Reset zoom to 100%",onClick:E,children:"100%"}),f.jsx("button",{className:"compass-tool-button compass-tool-icon-button",type:"button","aria-label":"Zoom in",title:"Zoom in",onClick:_,children:f.jsx(J3,{})})]}),f.jsx("button",{className:"compass-tool-button compass-tool-icon-button",type:"button","aria-label":"Fit graph in view",title:"Fit graph in view",onClick:j,children:f.jsx(Jm,{})}),f.jsx("button",{className:"compass-tool-button compass-tool-icon-button",type:"button","aria-label":"Fit selected neighborhood",title:r?`Fit the selected node and its ${I}-hop neighborhood`:"Select a node to fit its neighborhood",disabled:!r,onClick:X,children:f.jsx(j3,{})}),f.jsx("button",{className:"compass-tool-button compass-tool-icon-button",type:"button","aria-label":"Reset graph view",title:"Reset graph view",onClick:ne,children:f.jsx(iv,{})}),f.jsx("button",{className:"compass-tool-button compass-tool-icon-button",type:"button","aria-label":i?"Hide labels":"Show labels","aria-pressed":i,title:i?"Hide node labels":"Show all node labels",onClick:F,children:f.jsx($3,{})}),f.jsx("button",{className:"compass-tool-button compass-tool-icon-button",type:"button","aria-label":o?"Hide relationship labels":"Show relationship labels","aria-pressed":o,title:o?"Hide relationship labels":"Show relationship labels",onClick:V,children:f.jsx(gv,{})}),f.jsx("button",{ref:ge,className:"compass-tool-button compass-tool-icon-button",type:"button","aria-label":"Graph settings","aria-expanded":le,"aria-controls":Q,title:"Graph settings (?)",onClick:()=>M(T=>{const U=!T;return U&&w?.(),U}),children:f.jsx(K3,{})}),p?f.jsx("div",{className:"compass-toolbar-leading",children:p}):null]}),m,le?f.jsxs("div",{id:Q,className:"compass-explore-panel compass-glass-panel",role:"region","aria-label":"Graph exploration controls",children:[f.jsxs("div",{className:"compass-explore-heading",children:[f.jsxs("div",{children:[f.jsx("strong",{children:"Graph settings"}),f.jsx("span",{children:r?"Tune the selected neighborhood and canvas":"Set the next neighborhood, then select a node"})]}),f.jsx("kbd",{children:"?"})]}),r?null:f.jsxs("div",{className:"compass-selection-prompt",role:"note",children:[f.jsx(ov,{"aria-hidden":"true"}),f.jsxs("span",{children:[f.jsx("strong",{children:"Select a node to isolate it"}),f.jsx("small",{children:"Use the canvas or node search. Depth and direction can be set now."})]})]}),f.jsxs("button",{className:"compass-explore-toggle",type:"button","aria-label":"Isolate selection","aria-pressed":A,disabled:!r,onClick:Ie,children:[f.jsx(ov,{"aria-hidden":"true"}),f.jsxs("span",{children:[f.jsx("strong",{children:"Isolate selection"}),f.jsx("small",{children:"Hide everything outside the traversal"})]}),f.jsx("i",{"aria-hidden":"true"})]}),f.jsxs("fieldset",{className:"compass-explore-field",children:[f.jsx("legend",{children:"Neighborhood depth"}),f.jsx("div",{className:"compass-segmented-control","aria-label":"Neighborhood depth",children:[1,2,3,4].map(T=>f.jsx("button",{type:"button","aria-label":`${T} hop${T===1?"":"s"}`,"aria-pressed":I===T,onClick:()=>Ee(T),children:T},T))})]}),f.jsxs("fieldset",{className:"compass-explore-field",children:[f.jsx("legend",{children:"Edge direction"}),f.jsx("div",{className:"compass-segmented-control","aria-label":"Edge direction",children:[["both","Both"],["outgoing","Out"],["incoming","In"]].map(([T,U])=>f.jsx("button",{type:"button","aria-label":`${U==="Both"?"Both directions":U==="Out"?"Outgoing edges":"Incoming edges"}`,"aria-pressed":l===T,onClick:()=>Ze(T),children:U},T))})]}),f.jsxs("label",{className:"compass-explore-select",children:[f.jsx("span",{children:"Layout spacing"}),f.jsxs("select",{"aria-label":"Layout spacing",value:c,onChange:T=>xe(Number(T.target.value)),children:[f.jsx("option",{value:.75,children:"Compact · 75%"}),f.jsx("option",{value:1,children:"Default · 100%"}),f.jsx("option",{value:1.25,children:"Airy · 125%"}),f.jsx("option",{value:1.5,children:"Wide · 150%"})]})]}),f.jsxs("button",{className:"compass-explore-toggle",type:"button","aria-label":"Show minimap","aria-pressed":h,onClick:He,children:[f.jsx(B3,{"aria-hidden":"true"}),f.jsxs("span",{children:[f.jsx("strong",{children:"Show minimap"}),f.jsx("small",{children:"Track and reposition the visible viewport"})]}),f.jsx("i",{"aria-hidden":"true"})]}),f.jsxs("div",{className:"compass-shortcut-guide","aria-label":"Graph keyboard shortcuts",children:[f.jsxs("div",{className:"compass-shortcut-title",children:[f.jsx(Z3,{"aria-hidden":"true"}),f.jsx("strong",{children:"Keyboard"})]}),f.jsxs("dl",{children:[f.jsxs("div",{children:[f.jsx("dt",{children:f.jsx("kbd",{children:"F"})}),f.jsx("dd",{children:"Fit graph"})]}),f.jsxs("div",{children:[f.jsx("dt",{children:f.jsx("kbd",{children:"⇧ F"})}),f.jsx("dd",{children:"Fit selection"})]}),f.jsxs("div",{children:[f.jsxs("dt",{children:[f.jsx("kbd",{children:"+"})," ",f.jsx("kbd",{children:"−"})]}),f.jsx("dd",{children:"Zoom"})]}),f.jsxs("div",{children:[f.jsx("dt",{children:f.jsx("kbd",{children:"0"})}),f.jsx("dd",{children:"100% zoom"})]}),f.jsxs("div",{children:[f.jsx("dt",{children:f.jsx("kbd",{children:"I"})}),f.jsx("dd",{children:"Isolate"})]}),f.jsxs("div",{children:[f.jsxs("dt",{children:[f.jsx("kbd",{children:"["})," ",f.jsx("kbd",{children:"]"})]}),f.jsx("dd",{children:"Depth"})]}),f.jsxs("div",{children:[f.jsx("dt",{children:f.jsx("kbd",{children:"D"})}),f.jsx("dd",{children:"Direction"})]}),f.jsxs("div",{children:[f.jsx("dt",{children:f.jsx("kbd",{children:"M"})}),f.jsx("dd",{children:"Minimap"})]})]})]})]}):null]})}const v_=["callable","type","module","boundary","other"],b_=["execution","dependency","structure","flow","other"],y_=new Set(["closure","constructor","function","lambda","macro","method","procedure","subroutine","database_procedure"]),w_=new Set(["class","component","enum","interface","annotation","protocol","struct","trait","type","type_alias","union"]),x_=new Set(["directory","document","export","file","folder","import","migration","module","namespace","package"]),E_=new Set(["command","config_key","database","database_column","database_constraint","database_index","database_schema","database_table","database_trigger","database_view","endpoint","event","job","message","query","queue","resource","route","schema","table","topic"]),S_=new Set(["awaits","calls","dispatches","executes","handles","instantiates","invokes","schedules","tests","triggers","spawns"]),T_=new Set(["depends_on","exports","imports","imports_from","links","re_exports","references","returns","type_of","aliases","uses"]),O_=new Set(["contains","decorates","declares","documents","embeds","extends","implements","inherits","member_of","mixes_in","overrides","owns"]),N_=new Set(["consumes","emits","maps_to","produces","publishes","reads","receives","registers","routes_to","sends","subscribes","writes"]);function Nv(n){return(n??"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}function cs(n){const e=Nv(n);return y_.has(e)?"callable":w_.has(e)?"type":x_.has(e)?"module":E_.has(e)?"boundary":"other"}function hc(n){const e=Nv(n);return S_.has(e)?"execution":T_.has(e)?"dependency":O_.has(e)?"structure":N_.has(e)?"flow":"other"}function D_(n){return n==="type"?"diamond":n==="module"?"square":n==="boundary"?"triangle":"dot"}function M_(n){return n==="callable"?"var(--vscode-symbolIcon-functionForeground, #5fa8ff)":n==="type"?"var(--vscode-symbolIcon-classForeground, #e3b341)":n==="module"?"var(--vscode-symbolIcon-moduleForeground, #56d4b4)":n==="boundary"?"var(--vscode-symbolIcon-eventForeground, #ff9b87)":"var(--vscode-descriptionForeground, #8b949e)"}const R_={callable:"Callable",type:"Type",module:"Module / file",boundary:"Boundary / data",other:"Other"},z_={execution:"Execution",dependency:"Dependency",structure:"Structure",flow:"Data / event flow",other:"Other"};function k_({model:n}){const e=B.useMemo(()=>{const i=new Map;for(const o of n.nodes){const r=cs(o.kind);i.set(r,(i.get(r)??0)+1)}return i},[n.nodes]),t=B.useMemo(()=>{const i=new Map;for(const o of n.edges){const r=hc(o.relation);i.set(r,(i.get(r)??0)+1)}return i},[n.edges]);return f.jsxs("aside",{className:"compass-semantic-legend compass-glass-panel","aria-label":"Graph visual legend",children:[f.jsxs("section",{"aria-label":"Node categories",children:[f.jsx("strong",{children:"Nodes"}),v_.filter(i=>(e.get(i)??0)>0).map(i=>f.jsxs("span",{className:"compass-semantic-legend-item",children:[f.jsx("i",{"data-node-category":i,"aria-hidden":"true"}),R_[i],f.jsx("small",{children:e.get(i)})]},i))]}),n.edges.length>0?f.jsxs("section",{"aria-label":"Relationship categories",children:[f.jsx("strong",{children:"Edges"}),b_.filter(i=>(t.get(i)??0)>0).map(i=>f.jsxs("span",{className:"compass-semantic-legend-item",children:[f.jsx("i",{"data-edge-category":i,"aria-hidden":"true"}),z_[i],f.jsx("small",{children:t.get(i)})]},i))]}):null]})}const Dv=280,Mv=560,Rv=24,fc={width:340,collapsed:!1};function Gr(n){return Number.isFinite(n)?Math.min(Mv,Math.max(Dv,Math.round(n))):fc.width}function zv(n){return{width:Gr(n?.width??fc.width),collapsed:n?.collapsed??fc.collapsed}}function __(n,e){return Gr(n-e)}function j_(n,e){return Gr(e==="ArrowLeft"?n+Rv:e==="ArrowRight"?n-Rv:n)}function Z_({width:n,onResize:e}){const t=B.useRef(!1),i=o=>{t.current=!1,o.currentTarget.hasPointerCapture(o.pointerId)&&o.currentTarget.releasePointerCapture(o.pointerId)};return f.jsx("div",{className:"compass-inspector-resizer",role:"separator","aria-label":"Resize graph inspector","aria-orientation":"vertical","aria-valuemin":Dv,"aria-valuemax":Mv,"aria-valuenow":n,tabIndex:0,onPointerDown:o=>{t.current=!0,o.currentTarget.setPointerCapture(o.pointerId)},onPointerMove:o=>{if(!t.current)return;const r=o.currentTarget.parentElement;r&&e(__(r.getBoundingClientRect().right,o.clientX))},onPointerUp:i,onPointerCancel:i,onKeyDown:o=>{o.key!=="ArrowLeft"&&o.key!=="ArrowRight"||(o.preventDefault(),e(j_(n,o.key)))},children:f.jsx("span",{"aria-hidden":"true"})})}function kv(n,e,t){if(t===void 0&&n.stats.aggregated&&e.memberCount!==void 0&&e.detailAvailable!==!1)return{type:"community",communityId:e.community};const i=vv(e);return i?{type:"source",source:i}:{type:"none"}}function P_(n){const e=n.source?.startLine,t=n.source?.endLine;if(e!==void 0)return t!==void 0&&t!==e?`${e}–${t}`:String(e)}function B_({node:n,hover:e,activation:t}){const i={"--compass-hover-x":`${e.x+18}px`,"--compass-hover-y":`${e.y-42}px`},o=P_(n);return f.jsxs("div",{className:"compass-node-hover-card",role:"tooltip",style:i,children:[f.jsxs("div",{className:"compass-hover-heading",children:[f.jsx("strong",{children:n.label}),f.jsx("span",{children:(n.kind??"symbol").toLocaleUpperCase()})]}),n.change&&f.jsx("span",{className:"compass-change-badge","data-change":n.change,children:n.change==="unchanged"?"Context":`${n.change[0]?.toLocaleUpperCase()}${n.change.slice(1)}`}),n.memberCount!==void 0?f.jsxs("p",{children:[n.memberCount.toLocaleString()," symbols"]}):f.jsxs(f.Fragment,{children:[n.language&&f.jsxs("p",{children:["Language: ",n.language]}),n.source?.file&&f.jsx("p",{className:"compass-hover-source",children:n.source.file}),o&&f.jsxs("p",{children:["Lines: ",o]}),n.signature&&f.jsx("code",{children:n.signature})]}),t.type!=="none"&&f.jsxs("p",{className:"compass-hover-hint",children:[t.type==="community"?f.jsx(cc,{"aria-hidden":"true"}):f.jsx(k3,{"aria-hidden":"true"}),f.jsxs("span",{children:[f.jsx("strong",{children:"Double-click"})," ",t.type==="community"?"to open community subgraph":"to open source code"]})]})]})}const L_={routes_to:"routes to",publishes:"publishes",subscribes:"subscribes",produces:"produces",consumes:"consumes",schedules:"schedules",triggers:"triggers",handles:"handles",registers:"registers",reads:"reads",writes:"writes",maps_to:"maps to",depends_on:"depends on"};function G_(n){const e=n.relation.trim(),t=L_[e]??e,i=n.details?.type==="route"?n.details.data:void 0,o=i?`${i.stage}${i.position===null||i.position===void 0?"":` ${i.position+1}`}`:void 0;return[t,o,i?.operation].filter(r=>r!==void 0&&r!=="").join(" · ")}function F_(n){if(!n?.file.trim())return"";const e=n.startLine,t=n.endLine;if(e!==void 0){const i=t!==void 0&&t!==e?`${e}–${t}`:String(e);return`${n.file}:${i}`}return n.startByte!==void 0?`${n.file}:byte ${n.startByte}`:n.file}function V_(n){const e=n.confidence;return e?`${e[0]?.toLocaleUpperCase()}${e.slice(1)}`:"Unspecified"}function U_(n){if(n)return n==="unchanged"?"Context":`${n[0]?.toLocaleUpperCase()}${n.slice(1)}`}function Y_({edge:n,sourceNode:e,targetNode:t,hover:i}){const o={"--compass-hover-x":`${i.x+18}px`,"--compass-hover-y":`${i.y-52}px`},r=F_(n.relationshipSite),A=n.codeEvidence?.[0],I=U_(n.change),l=bv(n)!==void 0;return f.jsxs("div",{className:"compass-edge-hover-card",role:"tooltip",style:o,children:[f.jsxs("div",{className:"compass-edge-hover-heading",children:[f.jsxs("span",{className:"compass-edge-hover-eyebrow",children:[f.jsx($m,{"aria-hidden":"true"}),"Relationship"]}),f.jsx("span",{className:"compass-edge-confidence","data-confidence":n.confidence??"unspecified",children:V_(n)})]}),f.jsxs("div",{className:"compass-edge-trace","aria-label":`${e.label} to ${t.label}`,children:[f.jsx("strong",{children:e.label}),f.jsx("span",{"aria-hidden":"true",children:f.jsx(T3,{})}),f.jsx("strong",{children:t.label})]}),f.jsxs("div",{className:"compass-edge-relation-row",children:[f.jsx("strong",{children:G_(n)||"Relationship"}),I&&f.jsx("span",{className:"compass-change-badge","data-change":n.change,children:I})]}),(A||r)&&f.jsxs("div",{className:"compass-edge-metadata",children:[A&&f.jsxs("p",{children:[f.jsx("span",{children:"Evidence"}),f.jsx("code",{children:A.rule??A.origin})]}),r&&f.jsxs("p",{children:[f.jsx("span",{children:"Source"}),f.jsx("code",{children:r})]})]}),l&&f.jsxs("p",{className:"compass-hover-hint",children:[f.jsx($m,{"aria-hidden":"true"}),f.jsxs("span",{children:[f.jsx("strong",{children:"Double-click"})," to open relationship source"]})]})]})}var pc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ne(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var nC=function(n){return n&&n.Math===Math&&n},jt=nC(typeof globalThis=="object"&&globalThis)||nC(typeof window=="object"&&window)||nC(typeof self=="object"&&self)||nC(typeof pc=="object"&&pc)||(function(){return this})()||pc||Function("return this")(),ot=function(n){try{return!!n()}catch{return!0}},H_=ot,Fr=!H_(function(){var n=(function(){}).bind();return typeof n!="function"||n.hasOwnProperty("prototype")}),K_=Fr,_v=Function.prototype,jv=_v.apply,Zv=_v.call,iC=typeof Reflect=="object"&&Reflect.apply||(K_?Zv.bind(jv):function(){return Zv.apply(jv,arguments)}),Pv=Fr,Bv=Function.prototype,mc=Bv.call,W_=Pv&&Bv.bind.bind(mc,mc),st=Pv?W_:function(n){return function(){return mc.apply(n,arguments)}},Lv=st,Q_=Lv({}.toString),X_=Lv("".slice),Qi=function(n){return X_(Q_(n),8,-1)},$_=Qi,q_=st,vc=function(n){if($_(n)==="Function")return q_(n)},bc=typeof document=="object"&&document.all,J_=typeof bc>"u"&&bc!==void 0,Gv={all:bc,IS_HTMLDDA:J_},Fv=Gv,e5=Fv.all,dn=Fv.IS_HTMLDDA?function(n){return typeof n=="function"||n===e5}:function(n){return typeof n=="function"},Vr={},t5=ot,sn=!t5(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),n5=Fr,gC=Function.prototype.call,mi=n5?gC.bind(gC):function(){return gC.apply(gC,arguments)},Ur={},Vv={}.propertyIsEnumerable,Uv=Object.getOwnPropertyDescriptor,i5=Uv&&!Vv.call({1:2},1);Ur.f=i5?function(e){var t=Uv(this,e);return!!t&&t.enumerable}:Vv;var Yr=function(n,e){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:e}},g5=st,o5=ot,s5=Qi,yc=Object,r5=g5("".split),oC=o5(function(){return!yc("z").propertyIsEnumerable(0)})?function(n){return s5(n)==="String"?r5(n,""):yc(n)}:yc,ds=function(n){return n==null},a5=ds,A5=TypeError,Hr=function(n){if(a5(n))throw new A5("Can't call method on "+n);return n},C5=oC,I5=Hr,vi=function(n){return C5(I5(n))},Yv=dn,Hv=Gv,l5=Hv.all,xn=Hv.IS_HTMLDDA?function(n){return typeof n=="object"?n!==null:Yv(n)||n===l5}:function(n){return typeof n=="object"?n!==null:Yv(n)},At={},wc=At,xc=jt,c5=dn,Kv=function(n){return c5(n)?n:void 0},bi=function(n,e){return arguments.length<2?Kv(wc[n])||Kv(xc[n]):wc[n]&&wc[n][e]||xc[n]&&xc[n][e]},d5=st,Zt=d5({}.isPrototypeOf),Kr=typeof navigator<"u"&&String(navigator.userAgent)||"",Wv=jt,Ec=Kr,Qv=Wv.process,Xv=Wv.Deno,$v=Qv&&Qv.versions||Xv&&Xv.version,qv=$v&&$v.v8,yi,sC;qv&&(yi=qv.split("."),sC=yi[0]>0&&yi[0]<4?1:+(yi[0]+yi[1])),!sC&&Ec&&(yi=Ec.match(/Edge\/(\d+)/),(!yi||yi[1]>=74)&&(yi=Ec.match(/Chrome\/(\d+)/),yi&&(sC=+yi[1])));var Wr=sC,Jv=Wr,u5=ot,h5=jt,f5=h5.String,us=!!Object.getOwnPropertySymbols&&!u5(function(){var n=Symbol("symbol detection");return!f5(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&Jv&&Jv<41}),p5=us,eb=p5&&!Symbol.sham&&typeof Symbol.iterator=="symbol",m5=bi,v5=dn,b5=Zt,y5=eb,w5=Object,Qr=y5?function(n){return typeof n=="symbol"}:function(n){var e=m5("Symbol");return v5(e)&&b5(e.prototype,w5(n))},x5=String,Xr=function(n){try{return x5(n)}catch{return"Object"}},E5=dn,S5=Xr,T5=TypeError,bo=function(n){if(E5(n))return n;throw new T5(S5(n)+" is not a function")},O5=bo,N5=ds,Sc=function(n,e){var t=n[e];return N5(t)?void 0:O5(t)},Tc=mi,Oc=dn,Nc=xn,D5=TypeError,M5=function(n,e){var t,i;if(e==="string"&&Oc(t=n.toString)&&!Nc(i=Tc(t,n))||Oc(t=n.valueOf)&&!Nc(i=Tc(t,n))||e!=="string"&&Oc(t=n.toString)&&!Nc(i=Tc(t,n)))return i;throw new D5("Can't convert object to primitive value")},tb={exports:{}},nb=jt,R5=Object.defineProperty,z5=function(n,e){try{R5(nb,n,{value:e,configurable:!0,writable:!0})}catch{nb[n]=e}return e},k5=jt,_5=z5,ib="__core-js_shared__",j5=k5[ib]||_5(ib,{}),Dc=j5,gb=Dc;(tb.exports=function(n,e){return gb[n]||(gb[n]=e!==void 0?e:{})})("versions",[]).push({version:"3.33.0",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"});var hs=tb.exports,Z5=Hr,P5=Object,Yn=function(n){return P5(Z5(n))},B5=st,L5=Yn,G5=B5({}.hasOwnProperty),rn=Object.hasOwn||function(e,t){return G5(L5(e),t)},F5=st,V5=0,U5=Math.random(),Y5=F5(1 .toString),rC=function(n){return"Symbol("+(n===void 0?"":n)+")_"+Y5(++V5+U5,36)},H5=jt,K5=hs,ob=rn,W5=rC,Q5=us,X5=eb,fs=H5.Symbol,Mc=K5("wks"),$5=X5?fs.for||fs:fs&&fs.withoutSetter||W5,Ut=function(n){return ob(Mc,n)||(Mc[n]=Q5&&ob(fs,n)?fs[n]:$5("Symbol."+n)),Mc[n]},q5=mi,sb=xn,rb=Qr,J5=Sc,ej=M5,tj=Ut,nj=TypeError,ij=tj("toPrimitive"),gj=function(n,e){if(!sb(n)||rb(n))return n;var t=J5(n,ij),i;if(t){if(e===void 0&&(e="default"),i=q5(t,n,e),!sb(i)||rb(i))return i;throw new nj("Can't convert object to primitive value")}return e===void 0&&(e="number"),ej(n,e)},oj=gj,sj=Qr,aC=function(n){var e=oj(n,"string");return sj(e)?e:e+""},rj=jt,ab=xn,Rc=rj.document,aj=ab(Rc)&&ab(Rc.createElement),Ab=function(n){return aj?Rc.createElement(n):{}},Aj=sn,Cj=ot,Ij=Ab,Cb=!Aj&&!Cj(function(){return Object.defineProperty(Ij("div"),"a",{get:function(){return 7}}).a!==7}),lj=sn,cj=mi,dj=Ur,uj=Yr,hj=vi,fj=aC,pj=rn,mj=Cb,Ib=Object.getOwnPropertyDescriptor;Vr.f=lj?Ib:function(e,t){if(e=hj(e),t=fj(t),mj)try{return Ib(e,t)}catch{}if(pj(e,t))return uj(!cj(dj.f,e,t),e[t])};var vj=ot,bj=dn,yj=/#|\.prototype\./,$r=function(n,e){var t=xj[wj(n)];return t===Sj?!0:t===Ej?!1:bj(e)?vj(e):!!e},wj=$r.normalize=function(n){return String(n).replace(yj,".").toLowerCase()},xj=$r.data={},Ej=$r.NATIVE="N",Sj=$r.POLYFILL="P",Tj=$r,lb=vc,Oj=bo,Nj=Fr,Dj=lb(lb.bind),qr=function(n,e){return Oj(n),e===void 0?n:Nj?Dj(n,e):function(){return n.apply(e,arguments)}},Hn={},Mj=sn,Rj=ot,cb=Mj&&Rj(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),zj=xn,kj=String,_j=TypeError,Xi=function(n){if(zj(n))return n;throw new _j(kj(n)+" is not an object")},jj=sn,Zj=Cb,Pj=cb,AC=Xi,db=aC,Bj=TypeError,zc=Object.defineProperty,Lj=Object.getOwnPropertyDescriptor,kc="enumerable",_c="configurable",jc="writable";Hn.f=jj?Pj?function(e,t,i){if(AC(e),t=db(t),AC(i),typeof e=="function"&&t==="prototype"&&"value"in i&&jc in i&&!i[jc]){var o=Lj(e,t);o&&o[jc]&&(e[t]=i.value,i={configurable:_c in i?i[_c]:o[_c],enumerable:kc in i?i[kc]:o[kc],writable:!1})}return zc(e,t,i)}:zc:function(e,t,i){if(AC(e),t=db(t),AC(i),Zj)try{return zc(e,t,i)}catch{}if("get"in i||"set"in i)throw new Bj("Accessors not supported");return"value"in i&&(e[t]=i.value),e};var Gj=sn,Fj=Hn,Vj=Yr,ps=Gj?function(n,e,t){return Fj.f(n,e,Vj(1,t))}:function(n,e,t){return n[e]=t,n},CC=jt,Uj=iC,Yj=vc,Hj=dn,Kj=Vr.f,Wj=Tj,ms=At,Qj=qr,vs=ps,ub=rn,Xj=function(n){var e=function(t,i,o){if(this instanceof e){switch(arguments.length){case 0:return new n;case 1:return new n(t);case 2:return new n(t,i)}return new n(t,i,o)}return Uj(n,this,arguments)};return e.prototype=n.prototype,e},ze=function(n,e){var t=n.target,i=n.global,o=n.stat,r=n.proto,A=i?CC:o?CC[t]:(CC[t]||{}).prototype,I=i?ms:ms[t]||vs(ms,t,{})[t],l=I.prototype,c,h,p,m,b,w,O,x,S;for(m in e)c=Wj(i?m:t+(o?".":"#")+m,n.forced),h=!c&&A&&ub(A,m),w=I[m],h&&(n.dontCallGetSet?(S=Kj(A,m),O=S&&S.value):O=A[m]),b=h&&O?O:e[m],!(h&&typeof w==typeof b)&&(n.bind&&h?x=Qj(b,CC):n.wrap&&h?x=Xj(b):r&&Hj(b)?x=Yj(b):x=b,(n.sham||b&&b.sham||w&&w.sham)&&vs(x,"sham",!0),vs(I,m,x),r&&(p=t+"Prototype",ub(ms,p)||vs(ms,p,{}),vs(ms[p],m,b),n.real&&l&&(c||!l[m])&&vs(l,m,b)))},$j=Math.ceil,qj=Math.floor,Jj=Math.trunc||function(e){var t=+e;return(t>0?qj:$j)(t)},e4=Jj,IC=function(n){var e=+n;return e!==e||e===0?0:e4(e)},t4=IC,n4=Math.max,i4=Math.min,Jr=function(n,e){var t=t4(n);return t<0?n4(t+e,0):i4(t,e)},g4=IC,o4=Math.min,s4=function(n){return n>0?o4(g4(n),9007199254740991):0},r4=s4,ii=function(n){return r4(n.length)},a4=vi,A4=Jr,C4=ii,hb=function(n){return function(e,t,i){var o=a4(e),r=C4(o),A=A4(i,r),I;if(n&&t!==t){for(;r>A;)if(I=o[A++],I!==I)return!0}else for(;r>A;A++)if((n||A in o)&&o[A]===t)return n||A||0;return!n&&-1}},Zc={includes:hb(!0),indexOf:hb(!1)},ea={},I4=st,Pc=rn,l4=vi,c4=Zc.indexOf,d4=ea,fb=I4([].push),pb=function(n,e){var t=l4(n),i=0,o=[],r;for(r in t)!Pc(d4,r)&&Pc(t,r)&&fb(o,r);for(;e.length>i;)Pc(t,r=e[i++])&&(~c4(o,r)||fb(o,r));return o},Bc=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],u4=pb,h4=Bc,ta=Object.keys||function(e){return u4(e,h4)},na={};na.f=Object.getOwnPropertySymbols;var mb=sn,f4=st,p4=mi,m4=ot,Lc=ta,v4=na,b4=Ur,y4=Yn,w4=oC,bs=Object.assign,vb=Object.defineProperty,x4=f4([].concat),E4=!bs||m4(function(){if(mb&&bs({b:1},bs(vb({},"a",{enumerable:!0,get:function(){vb(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var n={},e={},t=Symbol("assign detection"),i="abcdefghijklmnopqrst";return n[t]=7,i.split("").forEach(function(o){e[o]=o}),bs({},n)[t]!==7||Lc(bs({},e)).join("")!==i})?function(e,t){for(var i=y4(e),o=arguments.length,r=1,A=v4.f,I=b4.f;o>r;)for(var l=w4(arguments[r++]),c=A?x4(Lc(l),A(l)):Lc(l),h=c.length,p=0,m;h>p;)m=c[p++],(!mb||p4(I,l,m))&&(i[m]=l[m]);return i}:bs,S4=ze,bb=E4;S4({target:"Object",stat:!0,forced:Object.assign!==bb},{assign:bb});var T4=At,O4=T4.Object.assign,N4=O4,D4=N4,M4=D4,Yt=Ne(M4),R4=st,lC=R4([].slice),yb=st,z4=bo,k4=xn,_4=rn,wb=lC,j4=Fr,xb=Function,Z4=yb([].concat),P4=yb([].join),Gc={},B4=function(n,e,t){if(!_4(Gc,e)){for(var i=[],o=0;o=.1;)w=+r[p++%A],w>h&&(w=h),b=Math.sqrt(w*w/(1+c*c)),b=I<0?-b:b,e+=b,t+=c*b,m===!0?n.lineTo(e,t):n.moveTo(e,t),h-=w,m=!m}function nZ(n,e,t,i){n.beginPath();const o=6,r=Math.PI*2/o;n.moveTo(e+i,t);for(let A=1;A1?t-1:0),o=1;o"u")){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",t==="top"&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=n:o.appendChild(document.createTextNode(n))}}var gZ=`.vis-overlay { position: absolute; top: 0px; right: 0px; @@ -83,13 +83,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs. .vis-active { box-shadow: 0 0 10px #86d5f8; } -`;yo(x4);var S4=`/* override some bootstrap styles screwing up the timelines css */ +`;yo(gZ);var oZ=`/* override some bootstrap styles screwing up the timelines css */ .vis [class*="span"] { min-height: 0; width: auto; } -`;yo(S4);var E4=`div.vis-color-picker { +`;yo(oZ);var sZ=`div.vis-color-picker { position: absolute; top: 0px; left: 30px; @@ -334,7 +334,7 @@ div.vis-color-picker input.vis-range-brightness { div.vis-color-picker input.vis-saturation-range { width: 289px !important; }*/ -`;yo(E4);var T4=`div.vis-configuration { +`;yo(sZ);var rZ=`div.vis-configuration { position: relative; display: block; float: left; @@ -677,7 +677,7 @@ input.vis-configuration.vis-config-range:focus::-ms-fill-upper { border-width: 12px; margin-top: -12px; } -`;yo(T4);var O4=`div.vis-tooltip { +`;yo(rZ);var aZ=`div.vis-tooltip { position: absolute; visibility: hidden; padding: 5px; @@ -698,12 +698,12 @@ input.vis-configuration.vis-config-range:focus::-ms-fill-upper { z-index: 5; } -`;yo(O4);var wb={exports:{}};(function(n){n.exports=e;function e(i){if(i)return t(i)}function t(i){for(var o in e.prototype)i[o]=e.prototype[o];return i}e.prototype.on=e.prototype.addEventListener=function(i,o){return this._callbacks=this._callbacks||{},(this._callbacks["$"+i]=this._callbacks["$"+i]||[]).push(o),this},e.prototype.once=function(i,o){function r(){this.off(i,r),o.apply(this,arguments)}return r.fn=o,this.on(i,r),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(i,o){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+i];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+i],this;for(var A,I=0;Iz4)throw M4("Maximum allowed index exceeded");return n},k4=sC,R4=Hn,_4=Yr,ia=function(n,e,t){var i=k4(e);i in n?R4.f(n,i,_4(0,t)):n[i]=t},j4=Vt,Z4=j4("toStringTag"),Sb={};Sb[Z4]="z";var Yc=String(Sb)==="[object z]",B4=Yc,P4=dn,IC=Qi,L4=Vt,G4=L4("toStringTag"),F4=Object,V4=IC((function(){return arguments})())==="Arguments",U4=function(n,e){try{return n[e]}catch{}},$i=B4?IC:function(n){var e,t,i;return n===void 0?"Undefined":n===null?"Null":typeof(t=U4(e=F4(n),G4))=="string"?t:V4?IC(e):(i=IC(e))==="Object"&&P4(e.callee)?"Arguments":i},Y4=ot,H4=dn,Hc=Nc,K4=Y4(Function.toString);H4(Hc.inspectSource)||(Hc.inspectSource=function(n){return K4(n)});var W4=Hc.inspectSource,Q4=ot,X4=gt,Eb=dn,$4=$i,q4=bi,J4=W4,Tb=function(){},eZ=[],Ob=q4("Reflect","construct"),Kc=/^\s*(?:class|function)\b/,tZ=Q4(Kc.exec),nZ=!Kc.test(Tb),ga=function(e){if(!Eb(e))return!1;try{return Ob(Tb,eZ,e),!0}catch{return!1}},Nb=function(e){if(!Eb(e))return!1;switch($4(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return nZ||!!tZ(Kc,J4(e))}catch{return!0}};Nb.sham=!0;var Db=!Ob||X4(function(){var n;return ga(ga.call)||!ga(Object)||!ga(function(){n=!0})||n})?Nb:ga,Mb=Tg,iZ=Db,gZ=xn,oZ=Vt,sZ=oZ("species"),zb=Array,rZ=function(n){var e;return Mb(n)&&(e=n.constructor,iZ(e)&&(e===zb||Mb(e.prototype))?e=void 0:gZ(e)&&(e=e[sZ],e===null&&(e=void 0))),e===void 0?zb:e},aZ=rZ,lC=function(n,e){return new(aZ(n))(e===0?0:e)},AZ=gt,CZ=Vt,IZ=Wr,lZ=CZ("species"),oa=function(n){return IZ>=51||!AZ(function(){var e=[],t=e.constructor={};return t[lZ]=function(){return{foo:1}},e[n](Boolean).foo!==1})},cZ=Me,dZ=gt,uZ=Tg,hZ=xn,fZ=Yn,pZ=ii,kb=Uc,Rb=ia,mZ=lC,vZ=oa,bZ=Vt,yZ=Wr,_b=bZ("isConcatSpreadable"),wZ=yZ>=51||!dZ(function(){var n=[];return n[_b]=!1,n.concat()[0]!==n}),xZ=function(n){if(!hZ(n))return!1;var e=n[_b];return e!==void 0?!!e:uZ(n)},SZ=!wZ||!vZ("concat");cZ({target:"Array",proto:!0,forced:SZ},{concat:function(e){var t=fZ(this),i=mZ(t,0),o=0,r,A,I,l,c;for(r=-1,I=arguments.length;rA;)DZ.f(e,I=o[A++],i[I]);return e};var RZ=bi,_Z=RZ("document","documentElement"),jZ=us,ZZ=oC,jb=jZ("keys"),dC=function(n){return jb[n]||(jb[n]=ZZ(n))},BZ=Xi,PZ=cC,Zb=Bc,LZ=ea,GZ=_Z,FZ=nb,VZ=dC,Bb=">",Pb="<",Wc="prototype",Qc="script",Lb=VZ("IE_PROTO"),Xc=function(){},Gb=function(n){return Pb+Qc+Bb+n+Pb+"/"+Qc+Bb},Fb=function(n){n.write(Gb("")),n.close();var e=n.parentWindow.Object;return n=null,e},UZ=function(){var n=FZ("iframe"),e="java"+Qc+":",t;return n.style.display="none",GZ.appendChild(n),n.src=String(e),t=n.contentWindow.document,t.open(),t.write(Gb("document.F=Object")),t.close(),t.F},uC,hC=function(){try{uC=new ActiveXObject("htmlfile")}catch{}hC=typeof document<"u"?document.domain&&uC?Fb(uC):UZ():Fb(uC);for(var n=Zb.length;n--;)delete hC[Wc][Zb[n]];return hC()};LZ[Lb]=!0;var sa=Object.create||function(e,t){var i;return e!==null?(Xc[Wc]=BZ(e),i=new Xc,Xc[Wc]=null,i[Lb]=e):i=hC(),t===void 0?i:PZ.f(i,t)},ra={},YZ=Ib,HZ=Bc,KZ=HZ.concat("length","prototype");ra.f=Object.getOwnPropertyNames||function(e){return YZ(e,KZ)};var fC={},Vb=Jr,WZ=ii,QZ=ia,XZ=Array,$Z=Math.max,Ub=function(n,e,t){for(var i=WZ(n),o=Vb(e,i),r=Vb(t===void 0?i:t,i),A=XZ($Z(r-o,0)),I=0;ox;x++)if((I||x in b)&&(R=b[x],B=w(R,x,m),n))if(e)E[x]=B;else if(B)switch(n){case 3:return!0;case 5:return R;case 6:return x;case 2:ey(E,R)}else switch(n){case 4:return!1;case 7:ey(E,R)}return r?-1:i||o?o:E}},Og={forEach:xo(0),map:xo(1),filter:xo(2),some:xo(3),every:xo(4),find:xo(5),findIndex:xo(6)},vC=Me,bC=_t,td=mi,ZB=ot,ws=sn,xs=ds,BB=gt,Cn=rn,PB=jt,nd=Xi,yC=vi,id=sC,LB=zi,gd=Yr,Ia=sa,ty=ta,GB=ra,ny=fC,FB=na,iy=Vr,gy=Hn,VB=cC,oy=Ur,sy=aa,UB=$c,od=us,YB=dC,ry=ea,ay=oC,HB=Vt,KB=Aa,WB=Zt,QB=Wb,XB=bs,Ay=wo,wC=Og.forEach,Rn=YB("hidden"),xC="Symbol",la="prototype",$B=Ay.set,Cy=Ay.getterFor(xC),wi=Object[la],So=bC.Symbol,ca=So&&So[la],qB=bC.RangeError,JB=bC.TypeError,sd=bC.QObject,Iy=iy.f,Eo=gy.f,ly=ny.f,eP=oy.f,cy=ZB([].push),qi=od("symbols"),da=od("op-symbols"),tP=od("wks"),rd=!sd||!sd[la]||!sd[la].findChild,dy=function(n,e,t){var i=Iy(wi,e);i&&delete wi[e],Eo(n,e,t),i&&n!==wi&&Eo(wi,e,i)},ad=ws&&BB(function(){return Ia(Eo({},"a",{get:function(){return Eo(this,"a",{value:7}).a}})).a!==7})?dy:Eo,Ad=function(n,e){var t=qi[n]=Ia(ca);return $B(t,{type:xC,tag:n,description:e}),ws||(t.description=e),t},SC=function(e,t,i){e===wi&&SC(da,t,i),nd(e);var o=id(t);return nd(i),Cn(qi,o)?(i.enumerable?(Cn(e,Rn)&&e[Rn][o]&&(e[Rn][o]=!1),i=Ia(i,{enumerable:gd(0,!1)})):(Cn(e,Rn)||Eo(e,Rn,gd(1,{})),e[Rn][o]=!0),ad(e,o,i)):Eo(e,o,i)},Cd=function(e,t){nd(e);var i=yC(t),o=ty(i).concat(py(i));return wC(o,function(r){(!ws||td(uy,i,r))&&SC(e,r,i[r])}),e},nP=function(e,t){return t===void 0?Ia(e):Cd(Ia(e),t)},uy=function(e){var t=id(e),i=td(eP,this,t);return this===wi&&Cn(qi,t)&&!Cn(da,t)?!1:i||!Cn(this,t)||!Cn(qi,t)||Cn(this,Rn)&&this[Rn][t]?i:!0},hy=function(e,t){var i=yC(e),o=id(t);if(!(i===wi&&Cn(qi,o)&&!Cn(da,o))){var r=Iy(i,o);return r&&Cn(qi,o)&&!(Cn(i,Rn)&&i[Rn][o])&&(r.enumerable=!0),r}},fy=function(e){var t=ly(yC(e)),i=[];return wC(t,function(o){!Cn(qi,o)&&!Cn(ry,o)&&cy(i,o)}),i},py=function(n){var e=n===wi,t=ly(e?da:yC(n)),i=[];return wC(t,function(o){Cn(qi,o)&&(!e||Cn(wi,o))&&cy(i,qi[o])}),i};xs||(So=function(){if(PB(ca,this))throw new JB("Symbol is not a constructor");var e=!arguments.length||arguments[0]===void 0?void 0:LB(arguments[0]),t=ay(e),i=function(o){this===wi&&td(i,da,o),Cn(this,Rn)&&Cn(this[Rn],t)&&(this[Rn][t]=!1);var r=gd(1,o);try{ad(this,t,r)}catch(A){if(!(A instanceof qB))throw A;dy(this,t,r)}};return ws&&rd&&ad(wi,t,{configurable:!0,set:i}),Ad(t,e)},ca=So[la],sy(ca,"toString",function(){return Cy(this).tag}),sy(So,"withoutSetter",function(n){return Ad(ay(n),n)}),oy.f=uy,gy.f=SC,VB.f=Cd,iy.f=hy,GB.f=ny.f=fy,FB.f=py,KB.f=function(n){return Ad(HB(n),n)},ws&&UB(ca,"description",{configurable:!0,get:function(){return Cy(this).description}})),vC({global:!0,wrap:!0,forced:!xs,sham:!xs},{Symbol:So}),wC(ty(tP),function(n){WB(n)}),vC({target:xC,stat:!0,forced:!xs},{useSetter:function(){rd=!0},useSimple:function(){rd=!1}}),vC({target:"Object",stat:!0,forced:!xs,sham:!ws},{create:nP,defineProperty:SC,defineProperties:Cd,getOwnPropertyDescriptor:hy}),vC({target:"Object",stat:!0,forced:!xs},{getOwnPropertyNames:fy}),QB(),XB(So,xC),ry[Rn]=!0;var iP=ds,my=iP&&!!Symbol.for&&!!Symbol.keyFor,gP=Me,oP=bi,sP=rn,rP=zi,vy=us,aP=my,Id=vy("string-to-symbol-registry"),AP=vy("symbol-to-string-registry");gP({target:"Symbol",stat:!0,forced:!aP},{for:function(n){var e=rP(n);if(sP(Id,e))return Id[e];var t=oP("Symbol")(e);return Id[e]=t,AP[t]=e,t}});var CP=Me,IP=rn,lP=Qr,cP=Xr,dP=us,uP=my,by=dP("symbol-to-string-registry");CP({target:"Symbol",stat:!0,forced:!uP},{keyFor:function(e){if(!lP(e))throw new TypeError(cP(e)+" is not a symbol");if(IP(by,e))return by[e]}});var hP=ot,yy=Tg,fP=dn,wy=Qi,pP=zi,xy=hP([].push),mP=function(n){if(fP(n))return n;if(yy(n)){for(var e=n.length,t=[],i=0;i=e.length)return n.target=void 0,DC(void 0,!0);switch(t){case"keys":return DC(i,!1);case"values":return DC(e[i],!1)}return DC([i,e[i]],!1)},"values"),Wy.Arguments=Wy.Array;var GL={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},FL=GL,VL=_t,UL=$i,YL=fs,$y=Ss,HL=Vt,qy=HL("toStringTag");for(var vd in FL){var Jy=VL[vd],bd=Jy&&Jy.prototype;bd&&UL(bd)!==qy&&YL(bd,qy,vd),$y[vd]=$y.Array}var KL=tL,e0=KL,WL=e0,QL=Oe(WL),XL=Me,t0=Tg,$L=Db,qL=xn,n0=Jr,JL=ii,e8=vi,t8=ia,n8=Vt,i8=oa,g8=CC,o8=i8("slice"),s8=n8("species"),yd=Array,r8=Math.max;XL({target:"Array",proto:!0,forced:!o8},{slice:function(e,t){var i=e8(this),o=JL(i),r=n0(e,o),A=n0(t===void 0?o:t,o),I,l,c;if(t0(i)&&(I=i.constructor,$L(I)&&(I===yd||t0(I.prototype))?I=void 0:qL(I)&&(I=I[s8],I===null&&(I=void 0)),I===yd||I===void 0))return g8(i,r,A);for(l=new(I===void 0?yd:I)(r8(A-r,0)),c=0;r1?arguments[1]:void 0)}});var G8=Xt,F8=G8("Array").map,V8=jt,U8=F8,xd=Array.prototype,Y8=function(n){var e=n.map;return n===xd||V8(xd,n)&&e===xd.map?U8:e},H8=Y8,K8=H8,W8=K8,un=Oe(W8),Q8=Me,X8=Yn,g0=ta,$8=gt,q8=$8(function(){g0(1)});Q8({target:"Object",stat:!0,forced:q8},{keys:function(e){return g0(X8(e))}});var J8=rt,e6=J8.Object.keys,t6=e6,n6=t6,i6=n6,xt=Oe(i6),g6=Me,o6=ot,o0=Date,s6=o6(o0.prototype.getTime);g6({target:"Date",stat:!0},{now:function(){return s6(new o0)}});var r6=rt,a6=r6.Date.now,A6=a6,C6=A6,I6=C6,MC=Oe(I6),l6=gt,Es=function(n,e){var t=[][n];return!!t&&l6(function(){t.call(null,e||function(){return 1},1)})},c6=Og.forEach,d6=Es,u6=d6("forEach"),h6=u6?[].forEach:function(e){return c6(this,e,arguments.length>1?arguments[1]:void 0)},f6=Me,s0=h6;f6({target:"Array",proto:!0,forced:[].forEach!==s0},{forEach:s0});var p6=Xt,m6=p6("Array").forEach,v6=m6,b6=v6,y6=$i,w6=rn,x6=jt,S6=b6,Sd=Array.prototype,E6={DOMTokenList:!0,NodeList:!0},T6=function(n){var e=n.forEach;return n===Sd||x6(Sd,n)&&e===Sd.forEach||w6(E6,y6(n))?S6:e},O6=T6,et=Oe(O6),N6=Me,D6=ot,M6=Tg,z6=D6([].reverse),r0=[1,2];N6({target:"Array",proto:!0,forced:String(r0)===String(r0.reverse())},{reverse:function(){return M6(this)&&(this.length=this.length),z6(this)}});var k6=Xt,R6=k6("Array").reverse,_6=jt,j6=R6,Ed=Array.prototype,Z6=function(n){var e=n.reverse;return n===Ed||_6(Ed,n)&&e===Ed.reverse?j6:e},B6=Z6,P6=B6,L6=P6,To=Oe(L6),G6=sn,F6=Tg,V6=TypeError,U6=Object.getOwnPropertyDescriptor,Y6=G6&&!(function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}})(),H6=Y6?function(n,e){if(F6(n)&&!U6(n,"length").writable)throw new V6("Cannot set read only .length");return n.length=e}:function(n,e){return n.length=e},a0=Xr,K6=TypeError,A0=function(n,e){if(!delete n[e])throw new K6("Cannot delete property "+a0(e)+" of "+a0(n))},W6=Me,Q6=Yn,X6=Jr,$6=AC,q6=ii,J6=H6,e9=Uc,t9=lC,n9=ia,Td=A0,i9=oa,g9=i9("splice"),o9=Math.max,s9=Math.min;W6({target:"Array",proto:!0,forced:!g9},{splice:function(e,t){var i=Q6(this),o=q6(i),r=X6(e,o),A=arguments.length,I,l,c,h,p,m;for(A===0?I=l=0:A===1?(I=0,l=o-r):(I=A-2,l=s9(o9($6(t),0),o-r)),e9(o+I-l),c=t9(i,l),h=0;ho-l+I;h--)Td(i,h-1)}else if(I>l)for(h=o-l;h>r;h--)p=h+l-1,m=h+I-1,p in i?i[m]=i[p]:Td(i,m);for(h=0;h1?arguments[1]:void 0)}});var m9=Xt,v9=m9("Array").includes,b9=xn,y9=Qi,w9=Vt,x9=w9("match"),S9=function(n){var e;return b9(n)&&((e=n[x9])!==void 0?!!e:y9(n)==="RegExp")},E9=S9,T9=TypeError,O9=function(n){if(E9(n))throw new T9("The method doesn't accept regular expressions");return n},N9=Vt,D9=N9("match"),M9=function(n){var e=/./;try{"/./"[n](e)}catch{try{return e[D9]=!1,"/./"[n](e)}catch{}}return!1},z9=Me,k9=ot,R9=O9,_9=Hr,C0=zi,j9=M9,Z9=k9("".indexOf);z9({target:"String",proto:!0,forced:!j9("includes")},{includes:function(e){return!!~Z9(C0(_9(this)),C0(R9(e)),arguments.length>1?arguments[1]:void 0)}});var B9=Xt,P9=B9("String").includes,I0=jt,L9=v9,G9=P9,Nd=Array.prototype,Dd=String.prototype,F9=function(n){var e=n.includes;return n===Nd||I0(Nd,n)&&e===Nd.includes?L9:typeof n=="string"||n===Dd||I0(Dd,n)&&e===Dd.includes?G9:e},V9=F9,U9=V9,Y9=U9,Dg=Oe(Y9),H9=Me,K9=gt,W9=Yn,l0=TC,Q9=Py,X9=K9(function(){l0(1)});H9({target:"Object",stat:!0,forced:X9,sham:!Q9},{getPrototypeOf:function(e){return l0(W9(e))}});var $9=rt,q9=$9.Object.getPrototypeOf,J9=q9,eG=J9,tG=eG,c0=Oe(tG),nG=Xt,iG=nG("Array").concat,gG=jt,oG=iG,Md=Array.prototype,sG=function(n){var e=n.concat;return n===Md||gG(Md,n)&&e===Md.concat?oG:e},rG=sG,aG=rG,AG=aG,d0=Oe(AG),CG=Me,IG=Og.filter,lG=oa,cG=lG("filter");CG({target:"Array",proto:!0,forced:!cG},{filter:function(e){return IG(this,e,arguments.length>1?arguments[1]:void 0)}});var dG=Xt,uG=dG("Array").filter,hG=jt,fG=uG,zd=Array.prototype,pG=function(n){var e=n.filter;return n===zd||hG(zd,n)&&e===zd.filter?fG:e},mG=pG,vG=mG,bG=vG,$t=Oe(bG),u0=sn,yG=gt,h0=ot,wG=TC,xG=ta,SG=vi,EG=Ur.f,f0=h0(EG),TG=h0([].push),OG=u0&&yG(function(){var n=Object.create(null);return n[2]=2,!f0(n,2)}),NG=function(n){return function(e){for(var t=SG(e),i=xG(t),o=OG&&wG(t)===null,r=i.length,A=0,I=[],l;r>A;)l=i[A++],(!u0||(o?l in t:f0(t,l)))&&TG(I,n?[l,t[l]]:t[l]);return I}},DG={values:NG(!1)},MG=Me,zG=DG.values;MG({target:"Object",stat:!0},{values:function(e){return zG(e)}});var kG=rt,RG=kG.Object.values,_G=RG,jG=_G,ZG=jG,BG=Oe(ZG),kd=` -\v\f\r                 \u2028\u2029\uFEFF`,PG=ot,LG=Hr,GG=zi,Rd=kd,p0=PG("".replace),FG=RegExp("^["+Rd+"]+"),VG=RegExp("(^|[^"+Rd+"])["+Rd+"]+$"),UG=function(n){return function(e){var t=GG(LG(e));return n&1&&(t=p0(t,FG,"")),n&2&&(t=p0(t,VG,"$1")),t}},m0={trim:UG(3)},v0=_t,YG=gt,HG=ot,KG=zi,WG=m0.trim,b0=kd,ha=v0.parseInt,y0=v0.Symbol,w0=y0&&y0.iterator,x0=/^[+-]?0x/i,QG=HG(x0.exec),XG=ha(b0+"08")!==8||ha(b0+"0x16")!==22||w0&&!YG(function(){ha(Object(w0))}),$G=XG?function(e,t){var i=WG(KG(e));return ha(i,t>>>0||(QG(x0,i)?16:10))}:ha,qG=Me,S0=$G;qG({global:!0,forced:parseInt!==S0},{parseInt:S0});var JG=rt,eF=JG.parseInt,tF=eF,nF=tF,iF=nF,Si=Oe(iF),gF=Me,oF=mc,sF=jc.indexOf,rF=Es,_d=oF([].indexOf),E0=!!_d&&1/_d([1],1,-0)<0,aF=E0||!rF("indexOf");gF({target:"Array",proto:!0,forced:aF},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return E0?_d(this,e,t)||0:sF(this,e,t)}});var AF=Xt,CF=AF("Array").indexOf,IF=jt,lF=CF,jd=Array.prototype,cF=function(n){var e=n.indexOf;return n===jd||IF(jd,n)&&e===jd.indexOf?lF:e},dF=cF,uF=dF,hF=uF,At=Oe(hF),fF=Me,pF=sn,mF=sa;fF({target:"Object",stat:!0,sham:!pF},{create:mF});var vF=rt,bF=vF.Object,yF=function(e,t){return bF.create(e,t)},wF=yF,xF=wF,SF=xF,Mg=Oe(SF),Zd=rt,EF=tC;Zd.JSON||(Zd.JSON={stringify:JSON.stringify});var TF=function(e,t,i){return EF(Zd.JSON.stringify,null,arguments)},OF=TF,NF=OF,DF=NF,Ts=Oe(DF),MF=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",zF=TypeError,kF=function(n,e){if(nt,A=_F(i)?i:LF(i),I=r?BF(arguments,t):[],l=r?function(){RF(A,this,I)}:A;return e?n(l,o):n(l)}:n},FF=Me,N0=_t,VF=O0,D0=VF(N0.setInterval,!0);FF({global:!0,bind:!0,forced:N0.setInterval!==D0},{setInterval:D0});var UF=Me,M0=_t,YF=O0,z0=YF(M0.setTimeout,!0);UF({global:!0,bind:!0,forced:M0.setTimeout!==z0},{setTimeout:z0});var HF=rt,KF=HF.setTimeout,WF=KF,_i=Oe(WF),QF=Yn,k0=Jr,XF=ii,$F=function(e){for(var t=QF(this),i=XF(t),o=arguments.length,r=k0(o>1?arguments[1]:void 0,i),A=o>2?arguments[2]:void 0,I=A===void 0?i:k0(A,i);I>r;)t[r++]=e;return t},qF=Me,JF=$F;qF({target:"Array",proto:!0},{fill:JF});var eV=Xt,tV=eV("Array").fill,nV=jt,iV=tV,Bd=Array.prototype,gV=function(n){var e=n.fill;return n===Bd||nV(Bd,n)&&e===Bd.fill?iV:e},oV=gV,sV=oV,rV=sV,fa=Oe(rV);function Ei(){return Ei=Object.assign||function(n){for(var e=1;e"u"?{style:{}}:document.createElement("div"),AV="function",Os=Math.round,No=Math.abs,Ld=Date.now;function kC(n,e){for(var t,i,o=e[0].toUpperCase()+e.slice(1),r=0;r"u"?eg={}:eg=window;var _0=kC(aV.style,"touchAction"),j0=_0!==void 0;function CV(){if(!j0)return!1;var n={},e=eg.CSS&&eg.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return n[t]=e?eg.CSS.supports("touch-action",t):!0}),n}var Z0="compute",B0="auto",Gd="manipulation",Do="none",pa="pan-x",ma="pan-y",RC=CV(),IV=/mobile|tablet|ip(ad|hone|od)|android/i,P0="ontouchstart"in eg,lV=kC(eg,"PointerEvent")!==void 0,cV=P0&&IV.test(navigator.userAgent),va="touch",dV="pen",Fd="mouse",uV="kinect",hV=25,Tn=1,Mo=2,qt=4,_n=8,_C=1,ba=2,ya=4,wa=8,Ns=16,ji=ba|ya,zo=wa|Ns,L0=ji|zo,G0=["x","y"],jC=["clientX","clientY"];function tg(n,e,t){var i;if(n)if(n.forEach)n.forEach(e,t);else if(n.length!==void 0)for(i=0;i-1}function fV(n){if(ko(n,Do))return Do;var e=ko(n,pa),t=ko(n,ma);return e&&t?Do:e||t?e?pa:ma:ko(n,Gd)?Gd:B0}var F0=(function(){function n(t,i){this.manager=t,this.set(i)}var e=n.prototype;return e.set=function(i){i===Z0&&(i=this.compute()),j0&&this.manager.element.style&&RC[i]&&(this.manager.element.style[_0]=i),this.actions=i.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var i=[];return tg(this.manager.recognizers,function(o){ZC(o.options.enable,[o])&&(i=i.concat(o.getTouchAction()))}),fV(i.join(" "))},e.preventDefaults=function(i){var o=i.srcEvent,r=i.offsetDirection;if(this.manager.session.prevented){o.preventDefault();return}var A=this.actions,I=ko(A,Do)&&!RC[Do],l=ko(A,ma)&&!RC[ma],c=ko(A,pa)&&!RC[pa];if(I){var h=i.pointers.length===1,p=i.distance<2,m=i.deltaTime<250;if(h&&p&&m)return}if(!(c&&l)&&(I||l&&r&ji||c&&r&zo))return this.preventSrc(o)},e.preventSrc=function(i){this.manager.session.prevented=!0,i.preventDefault()},n})();function Vd(n,e){for(;n;){if(n===e)return!0;n=n.parentNode}return!1}function V0(n){var e=n.length;if(e===1)return{x:Os(n[0].clientX),y:Os(n[0].clientY)};for(var t=0,i=0,o=0;o=No(e)?n<0?ba:ya:e<0?wa:Ns}function pV(n,e){var t=e.center,i=n.offsetDelta||{},o=n.prevDelta||{},r=n.prevInput||{};(e.eventType===Tn||r.eventType===qt)&&(o=n.prevDelta={x:r.deltaX||0,y:r.deltaY||0},i=n.offsetDelta={x:t.x,y:t.y}),e.deltaX=o.x+(t.x-i.x),e.deltaY=o.y+(t.y-i.y)}function H0(n,e,t){return{x:e/n||0,y:t/n||0}}function mV(n,e){return BC(e[0],e[1],jC)/BC(n[0],n[1],jC)}function vV(n,e){return Ud(e[1],e[0],jC)+Ud(n[1],n[0],jC)}function bV(n,e){var t=n.lastInterval||e,i=e.timeStamp-t.timeStamp,o,r,A,I;if(e.eventType!==_n&&(i>hV||t.velocity===void 0)){var l=e.deltaX-t.deltaX,c=e.deltaY-t.deltaY,h=H0(i,l,c);r=h.x,A=h.y,o=No(h.x)>No(h.y)?h.x:h.y,I=Y0(l,c),n.lastInterval=e}else o=t.velocity,r=t.velocityX,A=t.velocityY,I=t.direction;e.velocity=o,e.velocityX=r,e.velocityY=A,e.direction=I}function yV(n,e){var t=n.session,i=e.pointers,o=i.length;t.firstInput||(t.firstInput=U0(e)),o>1&&!t.firstMultiple?t.firstMultiple=U0(e):o===1&&(t.firstMultiple=!1);var r=t.firstInput,A=t.firstMultiple,I=A?A.center:r.center,l=e.center=V0(i);e.timeStamp=Ld(),e.deltaTime=e.timeStamp-r.timeStamp,e.angle=Ud(I,l),e.distance=BC(I,l),pV(t,e),e.offsetDirection=Y0(e.deltaX,e.deltaY);var c=H0(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=c.x,e.overallVelocityY=c.y,e.overallVelocity=No(c.x)>No(c.y)?c.x:c.y,e.scale=A?mV(A.pointers,i):1,e.rotation=A?vV(A.pointers,i):0,e.maxPointers=t.prevInput?e.pointers.length>t.prevInput.maxPointers?e.pointers.length:t.prevInput.maxPointers:e.pointers.length,bV(t,e);var h=n.element,p=e.srcEvent,m;p.composedPath?m=p.composedPath()[0]:p.path?m=p.path[0]:m=p.target,Vd(m,h)&&(h=m),e.target=h}function wV(n,e,t){var i=t.pointers.length,o=t.changedPointers.length,r=e&Tn&&i-o===0,A=e&(qt|_n)&&i-o===0;t.isFirst=!!r,t.isFinal=!!A,r&&(n.session={}),t.eventType=e,yV(n,t),n.emit("hammer.input",t),n.recognize(t),n.session.prevInput=t}function xa(n){return n.trim().split(/\s+/g)}function Sa(n,e,t){tg(xa(e),function(i){n.addEventListener(i,t,!1)})}function Ea(n,e,t){tg(xa(e),function(i){n.removeEventListener(i,t,!1)})}function K0(n){var e=n.ownerDocument||n;return e.defaultView||e.parentWindow||window}var Ds=(function(){function n(t,i){var o=this;this.manager=t,this.callback=i,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(r){ZC(t.options.enable,[t])&&o.handler(r)},this.init()}var e=n.prototype;return e.handler=function(){},e.init=function(){this.evEl&&Sa(this.element,this.evEl,this.domHandler),this.evTarget&&Sa(this.target,this.evTarget,this.domHandler),this.evWin&&Sa(K0(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&Ea(this.element,this.evEl,this.domHandler),this.evTarget&&Ea(this.target,this.evTarget,this.domHandler),this.evWin&&Ea(K0(this.element),this.evWin,this.domHandler)},n})();function Ro(n,e,t){if(n.indexOf&&!t)return n.indexOf(e);for(var i=0;il[e]}):i=i.sort()),i}var EV={touchstart:Tn,touchmove:Mo,touchend:qt,touchcancel:_n},TV="touchstart touchmove touchend touchcancel",Hd=(function(n){gi(e,n);function e(){var i;return e.prototype.evTarget=TV,i=n.apply(this,arguments)||this,i.targetIds={},i}var t=e.prototype;return t.handler=function(o){var r=EV[o.type],A=OV.call(this,o,r);A&&this.callback(this.manager,r,{pointers:A[0],changedPointers:A[1],pointerType:va,srcEvent:o})},e})(Ds);function OV(n,e){var t=Ta(n.touches),i=this.targetIds;if(e&(Tn|Mo)&&t.length===1)return i[t[0].identifier]=!0,[t,t];var o,r,A=Ta(n.changedTouches),I=[],l=this.target;if(r=t.filter(function(c){return Vd(c.target,l)}),e===Tn)for(o=0;o-1&&o.splice(I,1)};setTimeout(r,zV)}}function kV(n,e){n&Tn?(this.primaryTouch=e.changedPointers[0].identifier,q0.call(this,e)):n&(qt|_n)&&q0.call(this,e)}function RV(n){for(var e=n.srcEvent.clientX,t=n.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(o,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(i){return!!this.simultaneous[i.id]},e.emit=function(i){var o=this,r=this.state;function A(I){o.manager.emit(I,i)}r=zg&&A(o.options.event+e1(r))},e.tryEmit=function(i){if(this.canEmit())return this.emit(i);this.state=Zi},e.canEmit=function(){for(var i=0;ir.threshold&&l&r.direction},t.attrTest=function(o){return ks.prototype.attrTest.call(this,o)&&(this.state&oi||!(this.state&oi)&&this.directionTest(o))},t.emit=function(o){this.pX=o.deltaX,this.pY=o.deltaY;var r=t1(o.direction);r&&(o.additionalEvent=this.options.event+r),n.prototype.emit.call(this,o)},e})(ks),n1=(function(n){gi(e,n);function e(i){return i===void 0&&(i={}),n.call(this,Ei({event:"swipe",threshold:10,velocity:.3,direction:ji|zo,pointers:1},i))||this}var t=e.prototype;return t.getTouchAction=function(){return Qd.prototype.getTouchAction.call(this)},t.attrTest=function(o){var r=this.options.direction,A;return r&(ji|zo)?A=o.overallVelocity:r&ji?A=o.overallVelocityX:r&zo&&(A=o.overallVelocityY),n.prototype.attrTest.call(this,o)&&r&o.offsetDirection&&o.distance>this.options.threshold&&o.maxPointers===this.options.pointers&&No(A)>this.options.velocity&&o.eventType&qt},t.emit=function(o){var r=t1(o.offsetDirection);r&&this.manager.emit(this.options.event+r,o),this.manager.emit(this.options.event,o)},e})(ks),i1=(function(n){gi(e,n);function e(i){return i===void 0&&(i={}),n.call(this,Ei({event:"pinch",threshold:0,pointers:2},i))||this}var t=e.prototype;return t.getTouchAction=function(){return[Do]},t.attrTest=function(o){return n.prototype.attrTest.call(this,o)&&(Math.abs(o.scale-1)>this.options.threshold||this.state&oi)},t.emit=function(o){if(o.scale!==1){var r=o.scale<1?"in":"out";o.additionalEvent=this.options.event+r}n.prototype.emit.call(this,o)},e})(ks),g1=(function(n){gi(e,n);function e(i){return i===void 0&&(i={}),n.call(this,Ei({event:"rotate",threshold:0,pointers:2},i))||this}var t=e.prototype;return t.getTouchAction=function(){return[Do]},t.attrTest=function(o){return n.prototype.attrTest.call(this,o)&&(Math.abs(o.rotation)>this.options.threshold||this.state&oi)},e})(ks),o1=(function(n){gi(e,n);function e(i){var o;return i===void 0&&(i={}),o=n.call(this,Ei({event:"press",pointers:1,time:251,threshold:9},i))||this,o._timer=null,o._input=null,o}var t=e.prototype;return t.getTouchAction=function(){return[B0]},t.process=function(o){var r=this,A=this.options,I=o.pointers.length===A.pointers,l=o.distanceA.time;if(this._input=o,!l||!I||o.eventType&(qt|_n)&&!c)this.reset();else if(o.eventType&Tn)this.reset(),this._timer=setTimeout(function(){r.state=ng,r.tryEmit()},A.time);else if(o.eventType&qt)return ng;return Zi},t.reset=function(){clearTimeout(this._timer)},t.emit=function(o){this.state===ng&&(o&&o.eventType&qt?this.manager.emit(this.options.event+"up",o):(this._input.timeStamp=Ld(),this.manager.emit(this.options.event,this._input)))},e})(Na),s1={domEvents:!1,touchAction:Z0,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},r1=[[g1,{enable:!1}],[i1,{enable:!1},["rotate"]],[n1,{direction:ji}],[Qd,{direction:ji},["swipe"]],[Wd],[Wd,{event:"doubletap",taps:2},["tap"]],[o1]],BV=1,a1=2;function A1(n,e){var t=n.element;if(t.style){var i;tg(n.options.cssProps,function(o,r){i=kC(t.style,r),e?(n.oldCssProps[i]=t.style[i],t.style[i]=o):t.style[i]=n.oldCssProps[i]||""}),e||(n.oldCssProps={})}}function PV(n,e){var t=document.createEvent("Event");t.initEvent(n,!0,!0),t.gesture=e,e.target.dispatchEvent(t)}var C1=(function(){function n(t,i){var o=this;this.options=Oo({},s1,i||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=_V(this),this.touchAction=new F0(this,this.options.touchAction),A1(this,!0),tg(this.options.recognizers,function(r){var A=o.add(new r[0](r[1]));r[2]&&A.recognizeWith(r[2]),r[3]&&A.requireFailure(r[3])},this)}var e=n.prototype;return e.set=function(i){return Oo(this.options,i),i.touchAction&&this.touchAction.update(),i.inputTarget&&(this.input.destroy(),this.input.target=i.inputTarget,this.input.init()),this},e.stop=function(i){this.session.stopped=i?a1:BV},e.recognize=function(i){var o=this.session;if(!o.stopped){this.touchAction.preventDefaults(i);var r,A=this.recognizers,I=o.curRecognizer;(!I||I&&I.state&ng)&&(o.curRecognizer=null,I=null);for(var l=0;llZ)throw IZ("Maximum allowed index exceeded");return n},cZ=aC,dZ=Hn,uZ=Yr,ia=function(n,e,t){var i=cZ(e);i in n?dZ.f(n,i,uZ(0,t)):n[i]=t},hZ=Ut,fZ=hZ("toStringTag"),Rb={};Rb[fZ]="z";var Hc=String(Rb)==="[object z]",pZ=Hc,mZ=dn,cC=Qi,vZ=Ut,bZ=vZ("toStringTag"),yZ=Object,wZ=cC((function(){return arguments})())==="Arguments",xZ=function(n,e){try{return n[e]}catch{}},$i=pZ?cC:function(n){var e,t,i;return n===void 0?"Undefined":n===null?"Null":typeof(t=xZ(e=yZ(n),bZ))=="string"?t:wZ?cC(e):(i=cC(e))==="Object"&&mZ(e.callee)?"Arguments":i},EZ=st,SZ=dn,Kc=Dc,TZ=EZ(Function.toString);SZ(Kc.inspectSource)||(Kc.inspectSource=function(n){return TZ(n)});var OZ=Kc.inspectSource,NZ=st,DZ=ot,zb=dn,MZ=$i,RZ=bi,zZ=OZ,kb=function(){},kZ=[],_b=RZ("Reflect","construct"),Wc=/^\s*(?:class|function)\b/,_Z=NZ(Wc.exec),jZ=!Wc.test(kb),ga=function(e){if(!zb(e))return!1;try{return _b(kb,kZ,e),!0}catch{return!1}},jb=function(e){if(!zb(e))return!1;switch(MZ(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return jZ||!!_Z(Wc,zZ(e))}catch{return!0}};jb.sham=!0;var Zb=!_b||DZ(function(){var n;return ga(ga.call)||!ga(Object)||!ga(function(){n=!0})||n})?jb:ga,Pb=Tg,ZZ=Zb,PZ=xn,BZ=Ut,LZ=BZ("species"),Bb=Array,GZ=function(n){var e;return Pb(n)&&(e=n.constructor,ZZ(e)&&(e===Bb||Pb(e.prototype))?e=void 0:PZ(e)&&(e=e[LZ],e===null&&(e=void 0))),e===void 0?Bb:e},FZ=GZ,dC=function(n,e){return new(FZ(n))(e===0?0:e)},VZ=ot,UZ=Ut,YZ=Wr,HZ=UZ("species"),oa=function(n){return YZ>=51||!VZ(function(){var e=[],t=e.constructor={};return t[HZ]=function(){return{foo:1}},e[n](Boolean).foo!==1})},KZ=ze,WZ=ot,QZ=Tg,XZ=xn,$Z=Yn,qZ=ii,Lb=Yc,Gb=ia,JZ=dC,eP=oa,tP=Ut,nP=Wr,Fb=tP("isConcatSpreadable"),iP=nP>=51||!WZ(function(){var n=[];return n[Fb]=!1,n.concat()[0]!==n}),gP=function(n){if(!XZ(n))return!1;var e=n[Fb];return e!==void 0?!!e:QZ(n)},oP=!iP||!eP("concat");KZ({target:"Array",proto:!0,forced:oP},{concat:function(e){var t=$Z(this),i=JZ(t,0),o=0,r,A,I,l,c;for(r=-1,I=arguments.length;rA;)CP.f(e,I=o[A++],i[I]);return e};var dP=bi,uP=dP("document","documentElement"),hP=hs,fP=rC,Vb=hP("keys"),hC=function(n){return Vb[n]||(Vb[n]=fP(n))},pP=Xi,mP=uC,Ub=Bc,vP=ea,bP=uP,yP=Ab,wP=hC,Yb=">",Hb="<",Qc="prototype",Xc="script",Kb=wP("IE_PROTO"),$c=function(){},Wb=function(n){return Hb+Xc+Yb+n+Hb+"/"+Xc+Yb},Qb=function(n){n.write(Wb("")),n.close();var e=n.parentWindow.Object;return n=null,e},xP=function(){var n=yP("iframe"),e="java"+Xc+":",t;return n.style.display="none",bP.appendChild(n),n.src=String(e),t=n.contentWindow.document,t.open(),t.write(Wb("document.F=Object")),t.close(),t.F},fC,pC=function(){try{fC=new ActiveXObject("htmlfile")}catch{}pC=typeof document<"u"?document.domain&&fC?Qb(fC):xP():Qb(fC);for(var n=Ub.length;n--;)delete pC[Qc][Ub[n]];return pC()};vP[Kb]=!0;var sa=Object.create||function(e,t){var i;return e!==null?($c[Qc]=pP(e),i=new $c,$c[Qc]=null,i[Kb]=e):i=pC(),t===void 0?i:mP.f(i,t)},ra={},EP=pb,SP=Bc,TP=SP.concat("length","prototype");ra.f=Object.getOwnPropertyNames||function(e){return EP(e,TP)};var mC={},Xb=Jr,OP=ii,NP=ia,DP=Array,MP=Math.max,$b=function(n,e,t){for(var i=OP(n),o=Xb(e,i),r=Xb(t===void 0?i:t,i),A=DP(MP(r-o,0)),I=0;ox;x++)if((I||x in b)&&(_=b[x],j=w(_,x,m),n))if(e)E[x]=j;else if(j)switch(n){case 3:return!0;case 5:return _;case 6:return x;case 2:ry(E,_)}else switch(n){case 4:return!1;case 7:ry(E,_)}return r?-1:i||o?o:E}},Og={forEach:xo(0),map:xo(1),filter:xo(2),some:xo(3),every:xo(4),find:xo(5),findIndex:xo(6)},yC=ze,wC=jt,nd=mi,fB=st,xs=sn,Es=us,pB=ot,Cn=rn,mB=Zt,id=Xi,xC=vi,gd=aC,vB=Ri,od=Yr,Ia=sa,ay=ta,bB=ra,Ay=mC,yB=na,Cy=Vr,Iy=Hn,wB=uC,ly=Ur,cy=aa,xB=qc,sd=hs,EB=hC,dy=ea,uy=rC,SB=Ut,TB=Aa,OB=Pt,NB=ty,DB=ys,hy=wo,EC=Og.forEach,_n=EB("hidden"),SC="Symbol",la="prototype",MB=hy.set,fy=hy.getterFor(SC),wi=Object[la],Eo=wC.Symbol,ca=Eo&&Eo[la],RB=wC.RangeError,zB=wC.TypeError,rd=wC.QObject,py=Cy.f,So=Iy.f,my=Ay.f,kB=ly.f,vy=fB([].push),qi=sd("symbols"),da=sd("op-symbols"),_B=sd("wks"),ad=!rd||!rd[la]||!rd[la].findChild,by=function(n,e,t){var i=py(wi,e);i&&delete wi[e],So(n,e,t),i&&n!==wi&&So(wi,e,i)},Ad=xs&&pB(function(){return Ia(So({},"a",{get:function(){return So(this,"a",{value:7}).a}})).a!==7})?by:So,Cd=function(n,e){var t=qi[n]=Ia(ca);return MB(t,{type:SC,tag:n,description:e}),xs||(t.description=e),t},TC=function(e,t,i){e===wi&&TC(da,t,i),id(e);var o=gd(t);return id(i),Cn(qi,o)?(i.enumerable?(Cn(e,_n)&&e[_n][o]&&(e[_n][o]=!1),i=Ia(i,{enumerable:od(0,!1)})):(Cn(e,_n)||So(e,_n,od(1,{})),e[_n][o]=!0),Ad(e,o,i)):So(e,o,i)},Id=function(e,t){id(e);var i=xC(t),o=ay(i).concat(Ey(i));return EC(o,function(r){(!xs||nd(yy,i,r))&&TC(e,r,i[r])}),e},jB=function(e,t){return t===void 0?Ia(e):Id(Ia(e),t)},yy=function(e){var t=gd(e),i=nd(kB,this,t);return this===wi&&Cn(qi,t)&&!Cn(da,t)?!1:i||!Cn(this,t)||!Cn(qi,t)||Cn(this,_n)&&this[_n][t]?i:!0},wy=function(e,t){var i=xC(e),o=gd(t);if(!(i===wi&&Cn(qi,o)&&!Cn(da,o))){var r=py(i,o);return r&&Cn(qi,o)&&!(Cn(i,_n)&&i[_n][o])&&(r.enumerable=!0),r}},xy=function(e){var t=my(xC(e)),i=[];return EC(t,function(o){!Cn(qi,o)&&!Cn(dy,o)&&vy(i,o)}),i},Ey=function(n){var e=n===wi,t=my(e?da:xC(n)),i=[];return EC(t,function(o){Cn(qi,o)&&(!e||Cn(wi,o))&&vy(i,qi[o])}),i};Es||(Eo=function(){if(mB(ca,this))throw new zB("Symbol is not a constructor");var e=!arguments.length||arguments[0]===void 0?void 0:vB(arguments[0]),t=uy(e),i=function(o){this===wi&&nd(i,da,o),Cn(this,_n)&&Cn(this[_n],t)&&(this[_n][t]=!1);var r=od(1,o);try{Ad(this,t,r)}catch(A){if(!(A instanceof RB))throw A;by(this,t,r)}};return xs&&ad&&Ad(wi,t,{configurable:!0,set:i}),Cd(t,e)},ca=Eo[la],cy(ca,"toString",function(){return fy(this).tag}),cy(Eo,"withoutSetter",function(n){return Cd(uy(n),n)}),ly.f=yy,Iy.f=TC,wB.f=Id,Cy.f=wy,bB.f=Ay.f=xy,yB.f=Ey,TB.f=function(n){return Cd(SB(n),n)},xs&&xB(ca,"description",{configurable:!0,get:function(){return fy(this).description}})),yC({global:!0,wrap:!0,forced:!Es,sham:!Es},{Symbol:Eo}),EC(ay(_B),function(n){OB(n)}),yC({target:SC,stat:!0,forced:!Es},{useSetter:function(){ad=!0},useSimple:function(){ad=!1}}),yC({target:"Object",stat:!0,forced:!Es,sham:!xs},{create:jB,defineProperty:TC,defineProperties:Id,getOwnPropertyDescriptor:wy}),yC({target:"Object",stat:!0,forced:!Es},{getOwnPropertyNames:xy}),NB(),DB(Eo,SC),dy[_n]=!0;var ZB=us,Sy=ZB&&!!Symbol.for&&!!Symbol.keyFor,PB=ze,BB=bi,LB=rn,GB=Ri,Ty=hs,FB=Sy,ld=Ty("string-to-symbol-registry"),VB=Ty("symbol-to-string-registry");PB({target:"Symbol",stat:!0,forced:!FB},{for:function(n){var e=GB(n);if(LB(ld,e))return ld[e];var t=BB("Symbol")(e);return ld[e]=t,VB[t]=e,t}});var UB=ze,YB=rn,HB=Qr,KB=Xr,WB=hs,QB=Sy,Oy=WB("symbol-to-string-registry");UB({target:"Symbol",stat:!0,forced:!QB},{keyFor:function(e){if(!HB(e))throw new TypeError(KB(e)+" is not a symbol");if(YB(Oy,e))return Oy[e]}});var XB=st,Ny=Tg,$B=dn,Dy=Qi,qB=Ri,My=XB([].push),JB=function(n){if($B(n))return n;if(Ny(n)){for(var e=n.length,t=[],i=0;i=e.length)return n.target=void 0,RC(void 0,!0);switch(t){case"keys":return RC(i,!1);case"values":return RC(e[i],!1)}return RC([i,e[i]],!1)},"values"),t0.Arguments=t0.Array;var b8={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},y8=b8,w8=jt,x8=$i,E8=ps,g0=Ss,S8=Ut,o0=S8("toStringTag");for(var bd in y8){var s0=w8[bd],yd=s0&&s0.prototype;yd&&x8(yd)!==o0&&E8(yd,o0,bd),g0[bd]=g0.Array}var T8=_L,r0=T8,O8=r0,N8=Ne(O8),D8=ze,a0=Tg,M8=Zb,R8=xn,A0=Jr,z8=ii,k8=vi,_8=ia,j8=Ut,Z8=oa,P8=lC,B8=Z8("slice"),L8=j8("species"),wd=Array,G8=Math.max;D8({target:"Array",proto:!0,forced:!B8},{slice:function(e,t){var i=k8(this),o=z8(i),r=A0(e,o),A=A0(t===void 0?o:t,o),I,l,c;if(a0(i)&&(I=i.constructor,M8(I)&&(I===wd||a0(I.prototype))?I=void 0:R8(I)&&(I=I[L8],I===null&&(I=void 0)),I===wd||I===void 0))return P8(i,r,A);for(l=new(I===void 0?wd:I)(G8(A-r,0)),c=0;r1?arguments[1]:void 0)}});var bG=Xt,yG=bG("Array").map,wG=Zt,xG=yG,Ed=Array.prototype,EG=function(n){var e=n.map;return n===Ed||wG(Ed,n)&&e===Ed.map?xG:e},SG=EG,TG=SG,OG=TG,un=Ne(OG),NG=ze,DG=Yn,I0=ta,MG=ot,RG=MG(function(){I0(1)});NG({target:"Object",stat:!0,forced:RG},{keys:function(e){return I0(DG(e))}});var zG=At,kG=zG.Object.keys,_G=kG,jG=_G,ZG=jG,xt=Ne(ZG),PG=ze,BG=st,l0=Date,LG=BG(l0.prototype.getTime);PG({target:"Date",stat:!0},{now:function(){return LG(new l0)}});var GG=At,FG=GG.Date.now,VG=FG,UG=VG,YG=UG,zC=Ne(YG),HG=ot,Ts=function(n,e){var t=[][n];return!!t&&HG(function(){t.call(null,e||function(){return 1},1)})},KG=Og.forEach,WG=Ts,QG=WG("forEach"),XG=QG?[].forEach:function(e){return KG(this,e,arguments.length>1?arguments[1]:void 0)},$G=ze,c0=XG;$G({target:"Array",proto:!0,forced:[].forEach!==c0},{forEach:c0});var qG=Xt,JG=qG("Array").forEach,e6=JG,t6=e6,n6=$i,i6=rn,g6=Zt,o6=t6,Sd=Array.prototype,s6={DOMTokenList:!0,NodeList:!0},r6=function(n){var e=n.forEach;return n===Sd||g6(Sd,n)&&e===Sd.forEach||i6(s6,n6(n))?o6:e},a6=r6,tt=Ne(a6),A6=ze,C6=st,I6=Tg,l6=C6([].reverse),d0=[1,2];A6({target:"Array",proto:!0,forced:String(d0)===String(d0.reverse())},{reverse:function(){return I6(this)&&(this.length=this.length),l6(this)}});var c6=Xt,d6=c6("Array").reverse,u6=Zt,h6=d6,Td=Array.prototype,f6=function(n){var e=n.reverse;return n===Td||u6(Td,n)&&e===Td.reverse?h6:e},p6=f6,m6=p6,v6=m6,To=Ne(v6),b6=sn,y6=Tg,w6=TypeError,x6=Object.getOwnPropertyDescriptor,E6=b6&&!(function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(n){return n instanceof TypeError}})(),S6=E6?function(n,e){if(y6(n)&&!x6(n,"length").writable)throw new w6("Cannot set read only .length");return n.length=e}:function(n,e){return n.length=e},u0=Xr,T6=TypeError,h0=function(n,e){if(!delete n[e])throw new T6("Cannot delete property "+u0(e)+" of "+u0(n))},O6=ze,N6=Yn,D6=Jr,M6=IC,R6=ii,z6=S6,k6=Yc,_6=dC,j6=ia,Od=h0,Z6=oa,P6=Z6("splice"),B6=Math.max,L6=Math.min;O6({target:"Array",proto:!0,forced:!P6},{splice:function(e,t){var i=N6(this),o=R6(i),r=D6(e,o),A=arguments.length,I,l,c,h,p,m;for(A===0?I=l=0:A===1?(I=0,l=o-r):(I=A-2,l=L6(B6(M6(t),0),o-r)),k6(o+I-l),c=_6(i,l),h=0;ho-l+I;h--)Od(i,h-1)}else if(I>l)for(h=o-l;h>r;h--)p=h+l-1,m=h+I-1,p in i?i[m]=i[p]:Od(i,m);for(h=0;h1?arguments[1]:void 0)}});var J6=Xt,e9=J6("Array").includes,t9=xn,n9=Qi,i9=Ut,g9=i9("match"),o9=function(n){var e;return t9(n)&&((e=n[g9])!==void 0?!!e:n9(n)==="RegExp")},s9=o9,r9=TypeError,a9=function(n){if(s9(n))throw new r9("The method doesn't accept regular expressions");return n},A9=Ut,C9=A9("match"),I9=function(n){var e=/./;try{"/./"[n](e)}catch{try{return e[C9]=!1,"/./"[n](e)}catch{}}return!1},l9=ze,c9=st,d9=a9,u9=Hr,f0=Ri,h9=I9,f9=c9("".indexOf);l9({target:"String",proto:!0,forced:!h9("includes")},{includes:function(e){return!!~f9(f0(u9(this)),f0(d9(e)),arguments.length>1?arguments[1]:void 0)}});var p9=Xt,m9=p9("String").includes,p0=Zt,v9=e9,b9=m9,Dd=Array.prototype,Md=String.prototype,y9=function(n){var e=n.includes;return n===Dd||p0(Dd,n)&&e===Dd.includes?v9:typeof n=="string"||n===Md||p0(Md,n)&&e===Md.includes?b9:e},w9=y9,x9=w9,E9=x9,Dg=Ne(E9),S9=ze,T9=ot,O9=Yn,m0=NC,N9=Hy,D9=T9(function(){m0(1)});S9({target:"Object",stat:!0,forced:D9,sham:!N9},{getPrototypeOf:function(e){return m0(O9(e))}});var M9=At,R9=M9.Object.getPrototypeOf,z9=R9,k9=z9,_9=k9,v0=Ne(_9),j9=Xt,Z9=j9("Array").concat,P9=Zt,B9=Z9,Rd=Array.prototype,L9=function(n){var e=n.concat;return n===Rd||P9(Rd,n)&&e===Rd.concat?B9:e},G9=L9,F9=G9,V9=F9,b0=Ne(V9),U9=ze,Y9=Og.filter,H9=oa,K9=H9("filter");U9({target:"Array",proto:!0,forced:!K9},{filter:function(e){return Y9(this,e,arguments.length>1?arguments[1]:void 0)}});var W9=Xt,Q9=W9("Array").filter,X9=Zt,$9=Q9,zd=Array.prototype,q9=function(n){var e=n.filter;return n===zd||X9(zd,n)&&e===zd.filter?$9:e},J9=q9,eF=J9,tF=eF,$t=Ne(tF),y0=sn,nF=ot,w0=st,iF=NC,gF=ta,oF=vi,sF=Ur.f,x0=w0(sF),rF=w0([].push),aF=y0&&nF(function(){var n=Object.create(null);return n[2]=2,!x0(n,2)}),AF=function(n){return function(e){for(var t=oF(e),i=gF(t),o=aF&&iF(t)===null,r=i.length,A=0,I=[],l;r>A;)l=i[A++],(!y0||(o?l in t:x0(t,l)))&&rF(I,n?[l,t[l]]:t[l]);return I}},CF={values:AF(!1)},IF=ze,lF=CF.values;IF({target:"Object",stat:!0},{values:function(e){return lF(e)}});var cF=At,dF=cF.Object.values,uF=dF,hF=uF,fF=hF,pF=Ne(fF),kd=` +\v\f\r                 \u2028\u2029\uFEFF`,mF=st,vF=Hr,bF=Ri,_d=kd,E0=mF("".replace),yF=RegExp("^["+_d+"]+"),wF=RegExp("(^|[^"+_d+"])["+_d+"]+$"),xF=function(n){return function(e){var t=bF(vF(e));return n&1&&(t=E0(t,yF,"")),n&2&&(t=E0(t,wF,"$1")),t}},S0={trim:xF(3)},T0=jt,EF=ot,SF=st,TF=Ri,OF=S0.trim,O0=kd,ha=T0.parseInt,N0=T0.Symbol,D0=N0&&N0.iterator,M0=/^[+-]?0x/i,NF=SF(M0.exec),DF=ha(O0+"08")!==8||ha(O0+"0x16")!==22||D0&&!EF(function(){ha(Object(D0))}),MF=DF?function(e,t){var i=OF(TF(e));return ha(i,t>>>0||(NF(M0,i)?16:10))}:ha,RF=ze,R0=MF;RF({global:!0,forced:parseInt!==R0},{parseInt:R0});var zF=At,kF=zF.parseInt,_F=kF,jF=_F,ZF=jF,Ei=Ne(ZF),PF=ze,BF=vc,LF=Zc.indexOf,GF=Ts,jd=BF([].indexOf),z0=!!jd&&1/jd([1],1,-0)<0,FF=z0||!GF("indexOf");PF({target:"Array",proto:!0,forced:FF},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return z0?jd(this,e,t)||0:LF(this,e,t)}});var VF=Xt,UF=VF("Array").indexOf,YF=Zt,HF=UF,Zd=Array.prototype,KF=function(n){var e=n.indexOf;return n===Zd||YF(Zd,n)&&e===Zd.indexOf?HF:e},WF=KF,QF=WF,XF=QF,It=Ne(XF),$F=ze,qF=sn,JF=sa;$F({target:"Object",stat:!0,sham:!qF},{create:JF});var eV=At,tV=eV.Object,nV=function(e,t){return tV.create(e,t)},iV=nV,gV=iV,oV=gV,Mg=Ne(oV),Pd=At,sV=iC;Pd.JSON||(Pd.JSON={stringify:JSON.stringify});var rV=function(e,t,i){return sV(Pd.JSON.stringify,null,arguments)},aV=rV,AV=aV,CV=AV,Os=Ne(CV),IV=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",lV=TypeError,cV=function(n,e){if(nt,A=uV(i)?i:vV(i),I=r?pV(arguments,t):[],l=r?function(){dV(A,this,I)}:A;return e?n(l,o):n(l)}:n},yV=ze,j0=jt,wV=_0,Z0=wV(j0.setInterval,!0);yV({global:!0,bind:!0,forced:j0.setInterval!==Z0},{setInterval:Z0});var xV=ze,P0=jt,EV=_0,B0=EV(P0.setTimeout,!0);xV({global:!0,bind:!0,forced:P0.setTimeout!==B0},{setTimeout:B0});var SV=At,TV=SV.setTimeout,OV=TV,_i=Ne(OV),NV=Yn,L0=Jr,DV=ii,MV=function(e){for(var t=NV(this),i=DV(t),o=arguments.length,r=L0(o>1?arguments[1]:void 0,i),A=o>2?arguments[2]:void 0,I=A===void 0?i:L0(A,i);I>r;)t[r++]=e;return t},RV=ze,zV=MV;RV({target:"Array",proto:!0},{fill:zV});var kV=Xt,_V=kV("Array").fill,jV=Zt,ZV=_V,Bd=Array.prototype,PV=function(n){var e=n.fill;return n===Bd||jV(Bd,n)&&e===Bd.fill?ZV:e},BV=PV,LV=BV,GV=LV,fa=Ne(GV);function Si(){return Si=Object.assign||function(n){for(var e=1;e"u"?{style:{}}:document.createElement("div"),VV="function",Ns=Math.round,No=Math.abs,Gd=Date.now;function _C(n,e){for(var t,i,o=e[0].toUpperCase()+e.slice(1),r=0;r"u"?eg={}:eg=window;var F0=_C(FV.style,"touchAction"),V0=F0!==void 0;function UV(){if(!V0)return!1;var n={},e=eg.CSS&&eg.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return n[t]=e?eg.CSS.supports("touch-action",t):!0}),n}var U0="compute",Y0="auto",Fd="manipulation",Do="none",pa="pan-x",ma="pan-y",jC=UV(),YV=/mobile|tablet|ip(ad|hone|od)|android/i,H0="ontouchstart"in eg,HV=_C(eg,"PointerEvent")!==void 0,KV=H0&&YV.test(navigator.userAgent),va="touch",WV="pen",Vd="mouse",QV="kinect",XV=25,Tn=1,Mo=2,qt=4,jn=8,ZC=1,ba=2,ya=4,wa=8,Ds=16,ji=ba|ya,Ro=wa|Ds,K0=ji|Ro,W0=["x","y"],PC=["clientX","clientY"];function tg(n,e,t){var i;if(n)if(n.forEach)n.forEach(e,t);else if(n.length!==void 0)for(i=0;i-1}function $V(n){if(zo(n,Do))return Do;var e=zo(n,pa),t=zo(n,ma);return e&&t?Do:e||t?e?pa:ma:zo(n,Fd)?Fd:Y0}var Q0=(function(){function n(t,i){this.manager=t,this.set(i)}var e=n.prototype;return e.set=function(i){i===U0&&(i=this.compute()),V0&&this.manager.element.style&&jC[i]&&(this.manager.element.style[F0]=i),this.actions=i.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var i=[];return tg(this.manager.recognizers,function(o){BC(o.options.enable,[o])&&(i=i.concat(o.getTouchAction()))}),$V(i.join(" "))},e.preventDefaults=function(i){var o=i.srcEvent,r=i.offsetDirection;if(this.manager.session.prevented){o.preventDefault();return}var A=this.actions,I=zo(A,Do)&&!jC[Do],l=zo(A,ma)&&!jC[ma],c=zo(A,pa)&&!jC[pa];if(I){var h=i.pointers.length===1,p=i.distance<2,m=i.deltaTime<250;if(h&&p&&m)return}if(!(c&&l)&&(I||l&&r&ji||c&&r&Ro))return this.preventSrc(o)},e.preventSrc=function(i){this.manager.session.prevented=!0,i.preventDefault()},n})();function Ud(n,e){for(;n;){if(n===e)return!0;n=n.parentNode}return!1}function X0(n){var e=n.length;if(e===1)return{x:Ns(n[0].clientX),y:Ns(n[0].clientY)};for(var t=0,i=0,o=0;o=No(e)?n<0?ba:ya:e<0?wa:Ds}function qV(n,e){var t=e.center,i=n.offsetDelta||{},o=n.prevDelta||{},r=n.prevInput||{};(e.eventType===Tn||r.eventType===qt)&&(o=n.prevDelta={x:r.deltaX||0,y:r.deltaY||0},i=n.offsetDelta={x:t.x,y:t.y}),e.deltaX=o.x+(t.x-i.x),e.deltaY=o.y+(t.y-i.y)}function J0(n,e,t){return{x:e/n||0,y:t/n||0}}function JV(n,e){return LC(e[0],e[1],PC)/LC(n[0],n[1],PC)}function eU(n,e){return Yd(e[1],e[0],PC)+Yd(n[1],n[0],PC)}function tU(n,e){var t=n.lastInterval||e,i=e.timeStamp-t.timeStamp,o,r,A,I;if(e.eventType!==jn&&(i>XV||t.velocity===void 0)){var l=e.deltaX-t.deltaX,c=e.deltaY-t.deltaY,h=J0(i,l,c);r=h.x,A=h.y,o=No(h.x)>No(h.y)?h.x:h.y,I=q0(l,c),n.lastInterval=e}else o=t.velocity,r=t.velocityX,A=t.velocityY,I=t.direction;e.velocity=o,e.velocityX=r,e.velocityY=A,e.direction=I}function nU(n,e){var t=n.session,i=e.pointers,o=i.length;t.firstInput||(t.firstInput=$0(e)),o>1&&!t.firstMultiple?t.firstMultiple=$0(e):o===1&&(t.firstMultiple=!1);var r=t.firstInput,A=t.firstMultiple,I=A?A.center:r.center,l=e.center=X0(i);e.timeStamp=Gd(),e.deltaTime=e.timeStamp-r.timeStamp,e.angle=Yd(I,l),e.distance=LC(I,l),qV(t,e),e.offsetDirection=q0(e.deltaX,e.deltaY);var c=J0(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=c.x,e.overallVelocityY=c.y,e.overallVelocity=No(c.x)>No(c.y)?c.x:c.y,e.scale=A?JV(A.pointers,i):1,e.rotation=A?eU(A.pointers,i):0,e.maxPointers=t.prevInput?e.pointers.length>t.prevInput.maxPointers?e.pointers.length:t.prevInput.maxPointers:e.pointers.length,tU(t,e);var h=n.element,p=e.srcEvent,m;p.composedPath?m=p.composedPath()[0]:p.path?m=p.path[0]:m=p.target,Ud(m,h)&&(h=m),e.target=h}function iU(n,e,t){var i=t.pointers.length,o=t.changedPointers.length,r=e&Tn&&i-o===0,A=e&(qt|jn)&&i-o===0;t.isFirst=!!r,t.isFinal=!!A,r&&(n.session={}),t.eventType=e,nU(n,t),n.emit("hammer.input",t),n.recognize(t),n.session.prevInput=t}function xa(n){return n.trim().split(/\s+/g)}function Ea(n,e,t){tg(xa(e),function(i){n.addEventListener(i,t,!1)})}function Sa(n,e,t){tg(xa(e),function(i){n.removeEventListener(i,t,!1)})}function e1(n){var e=n.ownerDocument||n;return e.defaultView||e.parentWindow||window}var Ms=(function(){function n(t,i){var o=this;this.manager=t,this.callback=i,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(r){BC(t.options.enable,[t])&&o.handler(r)},this.init()}var e=n.prototype;return e.handler=function(){},e.init=function(){this.evEl&&Ea(this.element,this.evEl,this.domHandler),this.evTarget&&Ea(this.target,this.evTarget,this.domHandler),this.evWin&&Ea(e1(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&Sa(this.element,this.evEl,this.domHandler),this.evTarget&&Sa(this.target,this.evTarget,this.domHandler),this.evWin&&Sa(e1(this.element),this.evWin,this.domHandler)},n})();function ko(n,e,t){if(n.indexOf&&!t)return n.indexOf(e);for(var i=0;il[e]}):i=i.sort()),i}var sU={touchstart:Tn,touchmove:Mo,touchend:qt,touchcancel:jn},rU="touchstart touchmove touchend touchcancel",Kd=(function(n){gi(e,n);function e(){var i;return e.prototype.evTarget=rU,i=n.apply(this,arguments)||this,i.targetIds={},i}var t=e.prototype;return t.handler=function(o){var r=sU[o.type],A=aU.call(this,o,r);A&&this.callback(this.manager,r,{pointers:A[0],changedPointers:A[1],pointerType:va,srcEvent:o})},e})(Ms);function aU(n,e){var t=Ta(n.touches),i=this.targetIds;if(e&(Tn|Mo)&&t.length===1)return i[t[0].identifier]=!0,[t,t];var o,r,A=Ta(n.changedTouches),I=[],l=this.target;if(r=t.filter(function(c){return Ud(c.target,l)}),e===Tn)for(o=0;o-1&&o.splice(I,1)};setTimeout(r,lU)}}function cU(n,e){n&Tn?(this.primaryTouch=e.changedPointers[0].identifier,o1.call(this,e)):n&(qt|jn)&&o1.call(this,e)}function dU(n){for(var e=n.srcEvent.clientX,t=n.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(o,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(i){return!!this.simultaneous[i.id]},e.emit=function(i){var o=this,r=this.state;function A(I){o.manager.emit(I,i)}r=Rg&&A(o.options.event+r1(r))},e.tryEmit=function(i){if(this.canEmit())return this.emit(i);this.state=Zi},e.canEmit=function(){for(var i=0;ir.threshold&&l&r.direction},t.attrTest=function(o){return ks.prototype.attrTest.call(this,o)&&(this.state&oi||!(this.state&oi)&&this.directionTest(o))},t.emit=function(o){this.pX=o.deltaX,this.pY=o.deltaY;var r=a1(o.direction);r&&(o.additionalEvent=this.options.event+r),n.prototype.emit.call(this,o)},e})(ks),A1=(function(n){gi(e,n);function e(i){return i===void 0&&(i={}),n.call(this,Si({event:"swipe",threshold:10,velocity:.3,direction:ji|Ro,pointers:1},i))||this}var t=e.prototype;return t.getTouchAction=function(){return Xd.prototype.getTouchAction.call(this)},t.attrTest=function(o){var r=this.options.direction,A;return r&(ji|Ro)?A=o.overallVelocity:r&ji?A=o.overallVelocityX:r&Ro&&(A=o.overallVelocityY),n.prototype.attrTest.call(this,o)&&r&o.offsetDirection&&o.distance>this.options.threshold&&o.maxPointers===this.options.pointers&&No(A)>this.options.velocity&&o.eventType&qt},t.emit=function(o){var r=a1(o.offsetDirection);r&&this.manager.emit(this.options.event+r,o),this.manager.emit(this.options.event,o)},e})(ks),C1=(function(n){gi(e,n);function e(i){return i===void 0&&(i={}),n.call(this,Si({event:"pinch",threshold:0,pointers:2},i))||this}var t=e.prototype;return t.getTouchAction=function(){return[Do]},t.attrTest=function(o){return n.prototype.attrTest.call(this,o)&&(Math.abs(o.scale-1)>this.options.threshold||this.state&oi)},t.emit=function(o){if(o.scale!==1){var r=o.scale<1?"in":"out";o.additionalEvent=this.options.event+r}n.prototype.emit.call(this,o)},e})(ks),I1=(function(n){gi(e,n);function e(i){return i===void 0&&(i={}),n.call(this,Si({event:"rotate",threshold:0,pointers:2},i))||this}var t=e.prototype;return t.getTouchAction=function(){return[Do]},t.attrTest=function(o){return n.prototype.attrTest.call(this,o)&&(Math.abs(o.rotation)>this.options.threshold||this.state&oi)},e})(ks),l1=(function(n){gi(e,n);function e(i){var o;return i===void 0&&(i={}),o=n.call(this,Si({event:"press",pointers:1,time:251,threshold:9},i))||this,o._timer=null,o._input=null,o}var t=e.prototype;return t.getTouchAction=function(){return[Y0]},t.process=function(o){var r=this,A=this.options,I=o.pointers.length===A.pointers,l=o.distanceA.time;if(this._input=o,!l||!I||o.eventType&(qt|jn)&&!c)this.reset();else if(o.eventType&Tn)this.reset(),this._timer=setTimeout(function(){r.state=ng,r.tryEmit()},A.time);else if(o.eventType&qt)return ng;return Zi},t.reset=function(){clearTimeout(this._timer)},t.emit=function(o){this.state===ng&&(o&&o.eventType&qt?this.manager.emit(this.options.event+"up",o):(this._input.timeStamp=Gd(),this.manager.emit(this.options.event,this._input)))},e})(Na),c1={domEvents:!1,touchAction:U0,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},d1=[[I1,{enable:!1}],[C1,{enable:!1},["rotate"]],[A1,{direction:ji}],[Xd,{direction:ji},["swipe"]],[Qd],[Qd,{event:"doubletap",taps:2},["tap"]],[l1]],pU=1,u1=2;function h1(n,e){var t=n.element;if(t.style){var i;tg(n.options.cssProps,function(o,r){i=_C(t.style,r),e?(n.oldCssProps[i]=t.style[i],t.style[i]=o):t.style[i]=n.oldCssProps[i]||""}),e||(n.oldCssProps={})}}function mU(n,e){var t=document.createEvent("Event");t.initEvent(n,!0,!0),t.gesture=e,e.target.dispatchEvent(t)}var f1=(function(){function n(t,i){var o=this;this.options=Oo({},c1,i||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=uU(this),this.touchAction=new Q0(this,this.options.touchAction),h1(this,!0),tg(this.options.recognizers,function(r){var A=o.add(new r[0](r[1]));r[2]&&A.recognizeWith(r[2]),r[3]&&A.requireFailure(r[3])},this)}var e=n.prototype;return e.set=function(i){return Oo(this.options,i),i.touchAction&&this.touchAction.update(),i.inputTarget&&(this.input.destroy(),this.input.target=i.inputTarget,this.input.init()),this},e.stop=function(i){this.session.stopped=i?u1:pU},e.recognize=function(i){var o=this.session;if(!o.stopped){this.touchAction.preventDefaults(i);var r,A=this.recognizers,I=o.curRecognizer;(!I||I&&I.state&ng)&&(o.curRecognizer=null,I=null);for(var l=0;l\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",A=window.console&&(window.console.warn||window.console.log);return A&&A.call(window.console,i,r),n.apply(this,arguments)}}var l1=I1(function(n,e,t){for(var i=Object.keys(e),o=0;o1?e-1:0),i=1;i2)return GC(h1(e[0],e[1]),...xi(e).call(e,2));const i=e[0],o=e[1];if(i instanceof Date&&o instanceof Date)return i.setTime(o.getTime()),i;for(const r of N8(o))Object.prototype.propertyIsEnumerable.call(o,r)&&(o[r]===u1?delete i[r]:i[r]!==null&&o[r]!==null&&typeof i[r]=="object"&&typeof o[r]=="object"&&!tt(i[r])&&!tt(o[r])?i[r]=GC(i[r],o[r]):i[r]=f1(o[r]));return i}function f1(n){return tt(n)?un(n).call(n,e=>f1(e)):typeof n=="object"&&n!==null?n instanceof Date?new Date(n.getTime()):GC({},n):n}function p1(n){for(const e of xt(n))n[e]===u1?delete n[e]:typeof n[e]=="object"&&n[e]!==null&&p1(n[e])}function FC(){for(var n=arguments.length,e=new Array(n),t=0;t{const A=2091639*e+o*23283064365386963e-26;return e=t,t=i,i=A-(o=A|0)};return r.uint32=()=>r()*4294967296,r.fract53=()=>r()+(r()*2097152|0)*11102230246251565e-32,r.algorithm="Alea",r.seed=n,r.version="0.9",r}function XV(){const n=$V();let e=n(" "),t=n(" "),i=n(" ");for(let o=0;o>>0,o-=n,o*=n,n=o>>>0,o-=n,n+=o*4294967296}return(n>>>0)*23283064365386963e-26}}function qV(){const n=()=>{};return{on:n,off:n,destroy:n,emit:n,get(){return{set:n}}}}const Xd=typeof window<"u"?window.Hammer||KV:function(){return qV()};function Bi(n){var e;this._cleanupQueue=[],this.active=!1,this._dom={container:n,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)});const t=Xd(this._dom.overlay);t.on("tap",ge(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(()=>{t.destroy()});const i=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];et(i).call(i,o=>{t.on(o,r=>{r.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=o=>{JV(o.target,n)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=o=>{("key"in o?o.key==="Escape":o.keyCode===27)&&this.deactivate()}}xb(Bi.prototype),Bi.current=null,Bi.prototype.destroy=function(){this.deactivate();for(const t of To(n=Ri(e=this._cleanupQueue).call(e,0)).call(n)){var n,e;t()}},Bi.prototype.activate=function(){Bi.current&&Bi.current.deactivate(),Bi.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)},Bi.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")},Bi.prototype._onTapOverlay=function(n){this.activate(),n.srcEvent.stopPropagation()};function JV(n,e){for(;n;){if(n===e)return!0;n=n.parentNode}return!1}const eU=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,tU=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,nU=/^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i,iU=/^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i;function kg(n){if(n)for(;n.hasChildNodes()===!0;){const e=n.firstChild;e&&(kg(e),n.removeChild(e))}}function Rs(n){return n instanceof String||typeof n=="string"}function m1(n){return typeof n=="object"&&n!==null}function _o(n,e,t,i){let o=!1;i===!0&&(o=e[t]===null&&n[t]!==void 0),o?delete n[t]:n[t]=e[t]}function v1(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;for(const i in n)if(e[i]!==void 0)if(e[i]===null||typeof e[i]!="object")_o(n,e,i,t);else{const o=n[i],r=e[i];m1(o)&&m1(r)&&v1(o,r,t)}}function _s(n,e,t){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(tt(t))throw new TypeError("Arrays are not supported by deepExtend");for(let o=0;o3&&arguments[3]!==void 0?arguments[3]:!1;if(tt(t))throw new TypeError("Arrays are not supported by deepExtend");for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&!Dg(n).call(n,o))if(t[o]&&t[o].constructor===Object)e[o]===void 0&&(e[o]={}),e[o].constructor===Object?vt(e[o],t[o]):_o(e,t,o,i);else if(tt(t[o])){e[o]=[];for(let r=0;r2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)||t===!0)if(typeof e[r]=="object"&&e[r]!==null&&c0(e[r])===Object.prototype)n[r]===void 0?n[r]=vt({},e[r],t):typeof n[r]=="object"&&n[r]!==null&&c0(n[r])===Object.prototype?vt(n[r],e[r],t):_o(n,e,r,i);else if(tt(e[r])){var o;n[r]=xi(o=e[r]).call(o)}else _o(n,e,r,i);return n}function UC(n,e){return[...n,e]}function gU(n){return xi(n).call(n)}function oU(n){return n.getBoundingClientRect().left}function sU(n){return n.getBoundingClientRect().top}function Ke(n,e){if(tt(n)){const t=n.length;for(let i=0;i3&&arguments[3]!==void 0?arguments[3]:{};const o=function(b){return b!=null},r=function(b){return b!==null&&typeof b=="object"},A=function(b){for(const w in b)if(Object.prototype.hasOwnProperty.call(b,w))return!1;return!0};if(!r(n))throw new Error("Parameter mergeTarget must be an object");if(!r(e))throw new Error("Parameter options must be an object");if(!o(t))throw new Error("Parameter option must have a value");if(!r(i))throw new Error("Parameter globalOptions must be an object");const I=function(b,w,S){r(b[S])||(b[S]={});const x=w[S],O=b[S];for(const E in x)Object.prototype.hasOwnProperty.call(x,E)&&(O[E]=x[E])},l=e[t],h=r(i)&&!A(i)?i[t]:void 0,p=h?h.enabled:void 0;if(l===void 0)return;if(typeof l=="boolean"){r(n[t])||(n[t]={}),n[t].enabled=l;return}if(l===null&&!r(n[t]))if(o(h))n[t]=Mg(h);else return;if(!r(l))return;let m=!0;l.enabled!==void 0?m=l.enabled:p!==void 0&&(m=h.enabled),I(n,e,t),n[t].enabled=m}const AU={linear(n){return n},easeInQuad(n){return n*n},easeOutQuad(n){return n*(2-n)},easeInOutQuad(n){return n<.5?2*n*n:-1+(4-2*n)*n},easeInCubic(n){return n*n*n},easeOutCubic(n){return--n*n*n+1},easeInOutCubic(n){return n<.5?4*n*n*n:(n-1)*(2*n-2)*(2*n-2)+1},easeInQuart(n){return n*n*n*n},easeOutQuart(n){return 1- --n*n*n*n},easeInOutQuart(n){return n<.5?8*n*n*n*n:1-8*--n*n*n*n},easeInQuint(n){return n*n*n*n*n},easeOutQuint(n){return 1+--n*n*n*n*n},easeInOutQuint(n){return n<.5?16*n*n*n*n*n:1+16*--n*n*n*n*n}};function _g(n,e){let t;tt(e)||(e=[e]);for(const i of n)if(i){t=i[e[0]];for(let o=1;o0&&arguments[0]!==void 0?arguments[0]:1;this.pixelRatio=e,this.generated=!1,this.centerCoordinates={x:289/2,y:289/2},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=()=>{},this.closeCallback=()=>{},this._create()}insertTo(e){this.hammer!==void 0&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(e){if(typeof e=="function")this.updateCallback=e;else throw new Error("Function attempted to set as colorPicker update callback is not a function.")}setCloseCallback(e){if(typeof e=="function")this.closeCallback=e;else throw new Error("Function attempted to set as colorPicker closing callback is not a function.")}_isColorString(e){if(typeof e=="string")return CU[e]}setColor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==="none")return;let i;const o=this._isColorString(e);if(o!==void 0&&(e=o),Rs(e)===!0){if(w1(e)===!0){const r=e.substr(4).substr(0,e.length-5).split(",");i={r:r[0],g:r[1],b:r[2],a:1}}else if(aU(e)===!0){const r=e.substr(5).substr(0,e.length-6).split(",");i={r:r[0],g:r[1],b:r[2],a:r[3]}}else if(y1(e)===!0){const r=$d(e);i={r:r.r,g:r.g,b:r.b,a:1}}}else if(e instanceof Object&&e.r!==void 0&&e.g!==void 0&&e.b!==void 0){const r=e.a!==void 0?e.a:"1.0";i={r:e.r,g:e.g,b:e.b,a:r}}if(i===void 0)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+Ts(e));this._setColor(i,t)}show(){this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}_hide(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0&&(this.previousColor=Ut({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",_i(()=>{this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0)},0)}_save(){this.updateCallback(this.color),this.applied=!1,this._hide()}_apply(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}_loadLast(){this.previousColor!==void 0?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}_setColor(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)===!0&&(this.initialColor=Ut({},e)),this.color=e;const i=Da(e.r,e.g,e.b),o=2*Math.PI,r=this.r*i.s,A=this.centerCoordinates.x+r*Math.sin(o*i.h),I=this.centerCoordinates.y+r*Math.cos(o*i.h);this.colorPickerSelector.style.left=A-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=I-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}_setOpacity(e){this.color.a=e/100,this._updatePicker(this.color)}_setBrightness(e){const t=Da(this.color.r,this.color.g,this.color.b);t.v=e/100;const i=YC(t.h,t.s,t.v);i.a=this.color.a,this.color=i,this._updatePicker()}_updatePicker(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.color;const t=Da(e.r,e.g,e.b),i=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const o=this.colorPickerCanvas.clientWidth,r=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,o,r),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-t.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),fa(i).call(i),this.brightnessRange.value=100*t.v,this.opacityRange.value=100*e.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}_setSize(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}_create(){var e,t,i,o;if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){const A=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(A.webkitBackingStorePixelRatio||A.mozBackingStorePixelRatio||A.msBackingStorePixelRatio||A.oBackingStorePixelRatio||A.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{const A=document.createElement("DIV");A.style.color="red",A.style.fontWeight="bold",A.style.padding="10px",A.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(A)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch{}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch{}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);const r=this;this.opacityRange.onchange=function(){r._setOpacity(this.value)},this.opacityRange.oninput=function(){r._setOpacity(this.value)},this.brightnessRange.onchange=function(){r._setBrightness(this.value)},this.brightnessRange.oninput=function(){r._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerText="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerText="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerText="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerText="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerText="cancel",this.cancelButton.onclick=ge(e=this._hide).call(e,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=ge(t=this._apply).call(t,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=ge(i=this._save).call(i,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=ge(o=this._loadLast).call(o,this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}_bindHammer(){this.drag={},this.pinch={},this.hammer=new Xd(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",e=>{e.isFirst&&this._moveSelector(e)}),this.hammer.on("tap",e=>{this._moveSelector(e)}),this.hammer.on("panstart",e=>{this._moveSelector(e)}),this.hammer.on("panmove",e=>{this._moveSelector(e)}),this.hammer.on("panend",e=>{this._moveSelector(e)})}_generateHueCircle(){if(this.generated===!1){const e=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const t=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,t,i);let o,r,A,I;this.centerCoordinates={x:t*.5,y:i*.5},this.r=.49*t;const l=2*Math.PI/360,c=1/360,h=1/this.r;let p;for(A=0;A<360;A++)for(I=0;I3&&arguments[3]!==void 0?arguments[3]:1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:()=>!1;this.parent=e,this.changedOptions=[],this.container=t,this.allowCreation=!1,this.hideOption=r,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},Ut(this.options,this.defaultOptions),this.configureOptions=i,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new IU(o),this.wrapper=void 0}setOptions(e){if(e!==void 0){this.popupHistory={},this._removePopup();let t=!0;if(typeof e=="string")this.options.filter=e;else if(tt(e))this.options.filter=e.join();else if(typeof e=="object"){if(e==null)throw new TypeError("options cannot be null");e.container!==void 0&&(this.options.container=e.container),$t(e)!==void 0&&(this.options.filter=$t(e)),e.showButton!==void 0&&(this.options.showButton=e.showButton),e.enabled!==void 0&&(t=e.enabled)}else typeof e=="boolean"?(this.options.filter=!0,t=e):typeof e=="function"&&(this.options.filter=e,t=!0);$t(this.options)===!1&&(t=!1),this.options.enabled=t}this._clean()}setModuleOptions(e){this.moduleOptions=e,this.options.enabled===!0&&(this._clean(),this.options.container!==void 0&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];const e=$t(this.options);let t=0,i=!1;for(const o in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,o)&&(this.allowCreation=!1,i=!1,typeof e=="function"?(i=e(o,[]),i=i||this._handleObject(this.configureOptions[o],[o],!0)):(e===!0||At(e).call(e,o)!==-1)&&(i=!0),i!==!1&&(this.allowCreation=!0,t>0&&this._makeItem([]),this._makeHeader(o),this._handleObject(this.configureOptions[o],[o])),t++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(let e=0;e1?t-1:0),o=1;o{r.appendChild(A)}),this.domElements.push(r),this.domElements.length}return 0}_makeHeader(e){const t=document.createElement("div");t.className="vis-configuration vis-config-header",t.innerText=e,this._makeItem([],t)}_makeLabel(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const o=document.createElement("div");if(o.className="vis-configuration vis-config-label vis-config-s"+t.length,i===!0){for(;o.firstChild;)o.removeChild(o.firstChild);o.appendChild(eu("i","b",e))}else o.innerText=e+":";return o}_makeDropdown(e,t,i){const o=document.createElement("select");o.className="vis-configuration vis-config-select";let r=0;t!==void 0&&At(e).call(e,t)!==-1&&(r=At(e).call(e,t));for(let l=0;lA&&A!==1&&(l.max=Math.ceil(t*1.2),h=l.max,c="range increased"),l.value=t):l.value=o;const p=document.createElement("input");p.className="vis-configuration vis-config-rangeinput",p.value=l.value;const m=this;l.onchange=function(){p.value=this.value,m._update(Number(this.value),i)},l.oninput=function(){p.value=this.value};const b=this._makeLabel(i[i.length-1],i),w=this._makeItem(i,b,l,p);c!==""&&this.popupHistory[w]!==h&&(this.popupHistory[w]=h,this._setupPopup(c,w))}_makeButton(){if(this.options.showButton===!0){const e=document.createElement("div");e.className="vis-configuration vis-config-button",e.innerText="generate options",e.onclick=()=>{this._printOptions()},e.onmouseover=()=>{e.className="vis-configuration vis-config-button hover"},e.onmouseout=()=>{e.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(e)}}_setupPopup(e,t){if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:i,index:t}}}_removePopup(){this.popupDiv.html!==void 0&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}_showPopupIfNeeded(){if(this.popupDiv.html!==void 0){const t=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=t.left+"px",this.popupDiv.html.style.top=t.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=_i(()=>{this.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=_i(()=>{this._removePopup()},1800)}}_makeCheckbox(e,t,i){const o=document.createElement("input");o.type="checkbox",o.className="vis-configuration vis-config-checkbox",o.checked=e,t!==void 0&&(o.checked=t,t!==e&&(typeof e=="object"?t!==e.enabled&&this.changedOptions.push({path:i,value:t}):this.changedOptions.push({path:i,value:t})));const r=this;o.onchange=function(){r._update(this.checked,i)};const A=this._makeLabel(i[i.length-1],i);this._makeItem(i,A,o)}_makeTextInput(e,t,i){const o=document.createElement("input");o.type="text",o.className="vis-configuration vis-config-text",o.value=t,t!==e&&this.changedOptions.push({path:i,value:t});const r=this;o.onchange=function(){r._update(this.value,i)};const A=this._makeLabel(i[i.length-1],i);this._makeItem(i,A,o)}_makeColorField(e,t,i){const o=e[1],r=document.createElement("div");t=t===void 0?o:t,t!=="none"?(r.className="vis-configuration vis-config-colorBlock",r.style.backgroundColor=t):r.className="vis-configuration vis-config-colorBlock none",t=t===void 0?o:t,r.onclick=()=>{this._showColorPicker(t,r,i)};const A=this._makeLabel(i[i.length-1],i);this._makeItem(i,A,r)}_showColorPicker(e,t,i){t.onclick=function(){},this.colorPicker.insertTo(t),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback(o=>{const r="rgba("+o.r+","+o.g+","+o.b+","+o.a+")";t.style.backgroundColor=r,this._update(r,i)}),this.colorPicker.setCloseCallback(()=>{t.onclick=()=>{this._showColorPicker(e,t,i)}})}_handleObject(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=!1;const r=$t(this.options);let A=!1;for(const I in e)if(Object.prototype.hasOwnProperty.call(e,I)){o=!0;const l=e[I],c=UC(t,I);if(typeof r=="function"&&(o=r(I,t),o===!1&&!tt(l)&&typeof l!="string"&&typeof l!="boolean"&&l instanceof Object&&(this.allowCreation=!1,o=this._handleObject(l,c,!0),this.allowCreation=i===!1)),o!==!1){A=!0;const h=this._getValue(c);if(tt(l))this._handleArray(l,h,c);else if(typeof l=="string")this._makeTextInput(l,h,c);else if(typeof l=="boolean")this._makeCheckbox(l,h,c);else if(l instanceof Object){if(!this.hideOption(t,I,this.moduleOptions))if(l.enabled!==void 0){const p=UC(c,"enabled"),m=this._getValue(p);if(m===!0){const b=this._makeLabel(I,c,!0);this._makeItem(c,b),A=this._handleObject(l,c)||A}else this._makeCheckbox(l,m,c)}else{const p=this._makeLabel(I,c,!0);this._makeItem(c,p),A=this._handleObject(l,c)||A}}else console.error("dont know how to handle",l,I,c)}}return A}_handleArray(e,t,i){typeof e[0]=="string"&&e[0]==="color"?(this._makeColorField(e,t,i),e[1]!==t&&this.changedOptions.push({path:i,value:t})):typeof e[0]=="string"?(this._makeDropdown(e,t,i),e[0]!==t&&this.changedOptions.push({path:i,value:t})):typeof e[0]=="number"&&(this._makeRange(e,t,i),e[0]!==t&&this.changedOptions.push({path:i,value:Number(t)}))}_update(e,t){const i=this._constructOptions(e,t);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",i),this.initialized=!0,this.parent.setOptions(i)}_constructOptions(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=i;e=e==="true"?!0:e,e=e==="false"?!1:e;for(let r=0;rr-this.padding&&(l=!0),l?A=this.x-i:A=this.x,c?I=this.y-t:I=this.y}else I=this.y-t,I+t+this.padding>o&&(I=o-t-this.padding),Ir&&(A=r-i-this.padding),A\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",A=window.console&&(window.console.warn||window.console.log);return A&&A.call(window.console,i,r),n.apply(this,arguments)}}var m1=p1(function(n,e,t){for(var i=Object.keys(e),o=0;o1?e-1:0),i=1;i2)return VC(w1(e[0],e[1]),...xi(e).call(e,2));const i=e[0],o=e[1];if(i instanceof Date&&o instanceof Date)return i.setTime(o.getTime()),i;for(const r of AG(o))Object.prototype.propertyIsEnumerable.call(o,r)&&(o[r]===y1?delete i[r]:i[r]!==null&&o[r]!==null&&typeof i[r]=="object"&&typeof o[r]=="object"&&!nt(i[r])&&!nt(o[r])?i[r]=VC(i[r],o[r]):i[r]=x1(o[r]));return i}function x1(n){return nt(n)?un(n).call(n,e=>x1(e)):typeof n=="object"&&n!==null?n instanceof Date?new Date(n.getTime()):VC({},n):n}function E1(n){for(const e of xt(n))n[e]===y1?delete n[e]:typeof n[e]=="object"&&n[e]!==null&&E1(n[e])}function UC(){for(var n=arguments.length,e=new Array(n),t=0;t{const A=2091639*e+o*23283064365386963e-26;return e=t,t=i,i=A-(o=A|0)};return r.uint32=()=>r()*4294967296,r.fract53=()=>r()+(r()*2097152|0)*11102230246251565e-32,r.algorithm="Alea",r.seed=n,r.version="0.9",r}function DU(){const n=MU();let e=n(" "),t=n(" "),i=n(" ");for(let o=0;o>>0,o-=n,o*=n,n=o>>>0,o-=n,n+=o*4294967296}return(n>>>0)*23283064365386963e-26}}function RU(){const n=()=>{};return{on:n,off:n,destroy:n,emit:n,get(){return{set:n}}}}const $d=typeof window<"u"?window.Hammer||TU:function(){return RU()};function Pi(n){var e;this._cleanupQueue=[],this.active=!1,this._dom={container:n,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)});const t=$d(this._dom.overlay);t.on("tap",oe(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(()=>{t.destroy()});const i=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];tt(i).call(i,o=>{t.on(o,r=>{r.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=o=>{zU(o.target,n)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=o=>{("key"in o?o.key==="Escape":o.keyCode===27)&&this.deactivate()}}Mb(Pi.prototype),Pi.current=null,Pi.prototype.destroy=function(){this.deactivate();for(const t of To(n=ki(e=this._cleanupQueue).call(e,0)).call(n)){var n,e;t()}},Pi.prototype.activate=function(){Pi.current&&Pi.current.deactivate(),Pi.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)},Pi.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")},Pi.prototype._onTapOverlay=function(n){this.activate(),n.srcEvent.stopPropagation()};function zU(n,e){for(;n;){if(n===e)return!0;n=n.parentNode}return!1}const kU=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,_U=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,jU=/^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i,ZU=/^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i;function zg(n){if(n)for(;n.hasChildNodes()===!0;){const e=n.firstChild;e&&(zg(e),n.removeChild(e))}}function _s(n){return n instanceof String||typeof n=="string"}function S1(n){return typeof n=="object"&&n!==null}function _o(n,e,t,i){let o=!1;i===!0&&(o=e[t]===null&&n[t]!==void 0),o?delete n[t]:n[t]=e[t]}function T1(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;for(const i in n)if(e[i]!==void 0)if(e[i]===null||typeof e[i]!="object")_o(n,e,i,t);else{const o=n[i],r=e[i];S1(o)&&S1(r)&&T1(o,r,t)}}function js(n,e,t){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(nt(t))throw new TypeError("Arrays are not supported by deepExtend");for(let o=0;o3&&arguments[3]!==void 0?arguments[3]:!1;if(nt(t))throw new TypeError("Arrays are not supported by deepExtend");for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&!Dg(n).call(n,o))if(t[o]&&t[o].constructor===Object)e[o]===void 0&&(e[o]={}),e[o].constructor===Object?vt(e[o],t[o]):_o(e,t,o,i);else if(nt(t[o])){e[o]=[];for(let r=0;r2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)||t===!0)if(typeof e[r]=="object"&&e[r]!==null&&v0(e[r])===Object.prototype)n[r]===void 0?n[r]=vt({},e[r],t):typeof n[r]=="object"&&n[r]!==null&&v0(n[r])===Object.prototype?vt(n[r],e[r],t):_o(n,e,r,i);else if(nt(e[r])){var o;n[r]=xi(o=e[r]).call(o)}else _o(n,e,r,i);return n}function HC(n,e){return[...n,e]}function PU(n){return xi(n).call(n)}function BU(n){return n.getBoundingClientRect().left}function LU(n){return n.getBoundingClientRect().top}function Ke(n,e){if(nt(n)){const t=n.length;for(let i=0;i3&&arguments[3]!==void 0?arguments[3]:{};const o=function(b){return b!=null},r=function(b){return b!==null&&typeof b=="object"},A=function(b){for(const w in b)if(Object.prototype.hasOwnProperty.call(b,w))return!1;return!0};if(!r(n))throw new Error("Parameter mergeTarget must be an object");if(!r(e))throw new Error("Parameter options must be an object");if(!o(t))throw new Error("Parameter option must have a value");if(!r(i))throw new Error("Parameter globalOptions must be an object");const I=function(b,w,O){r(b[O])||(b[O]={});const x=w[O],S=b[O];for(const E in x)Object.prototype.hasOwnProperty.call(x,E)&&(S[E]=x[E])},l=e[t],h=r(i)&&!A(i)?i[t]:void 0,p=h?h.enabled:void 0;if(l===void 0)return;if(typeof l=="boolean"){r(n[t])||(n[t]={}),n[t].enabled=l;return}if(l===null&&!r(n[t]))if(o(h))n[t]=Mg(h);else return;if(!r(l))return;let m=!0;l.enabled!==void 0?m=l.enabled:p!==void 0&&(m=h.enabled),I(n,e,t),n[t].enabled=m}const VU={linear(n){return n},easeInQuad(n){return n*n},easeOutQuad(n){return n*(2-n)},easeInOutQuad(n){return n<.5?2*n*n:-1+(4-2*n)*n},easeInCubic(n){return n*n*n},easeOutCubic(n){return--n*n*n+1},easeInOutCubic(n){return n<.5?4*n*n*n:(n-1)*(2*n-2)*(2*n-2)+1},easeInQuart(n){return n*n*n*n},easeOutQuart(n){return 1- --n*n*n*n},easeInOutQuart(n){return n<.5?8*n*n*n*n:1-8*--n*n*n*n},easeInQuint(n){return n*n*n*n*n},easeOutQuint(n){return 1+--n*n*n*n*n},easeInOutQuint(n){return n<.5?16*n*n*n*n*n:1+16*--n*n*n*n*n}};function _g(n,e){let t;nt(e)||(e=[e]);for(const i of n)if(i){t=i[e[0]];for(let o=1;o0&&arguments[0]!==void 0?arguments[0]:1;this.pixelRatio=e,this.generated=!1,this.centerCoordinates={x:289/2,y:289/2},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=()=>{},this.closeCallback=()=>{},this._create()}insertTo(e){this.hammer!==void 0&&(this.hammer.destroy(),this.hammer=void 0),this.container=e,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(e){if(typeof e=="function")this.updateCallback=e;else throw new Error("Function attempted to set as colorPicker update callback is not a function.")}setCloseCallback(e){if(typeof e=="function")this.closeCallback=e;else throw new Error("Function attempted to set as colorPicker closing callback is not a function.")}_isColorString(e){if(typeof e=="string")return UU[e]}setColor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e==="none")return;let i;const o=this._isColorString(e);if(o!==void 0&&(e=o),_s(e)===!0){if(D1(e)===!0){const r=e.substr(4).substr(0,e.length-5).split(",");i={r:r[0],g:r[1],b:r[2],a:1}}else if(FU(e)===!0){const r=e.substr(5).substr(0,e.length-6).split(",");i={r:r[0],g:r[1],b:r[2],a:r[3]}}else if(N1(e)===!0){const r=qd(e);i={r:r.r,g:r.g,b:r.b,a:1}}}else if(e instanceof Object&&e.r!==void 0&&e.g!==void 0&&e.b!==void 0){const r=e.a!==void 0?e.a:"1.0";i={r:e.r,g:e.g,b:e.b,a:r}}if(i===void 0)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+Os(e));this._setColor(i,t)}show(){this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}_hide(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0&&(this.previousColor=Yt({},this.color)),this.applied===!0&&this.updateCallback(this.initialColor),this.frame.style.display="none",_i(()=>{this.closeCallback!==void 0&&(this.closeCallback(),this.closeCallback=void 0)},0)}_save(){this.updateCallback(this.color),this.applied=!1,this._hide()}_apply(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}_loadLast(){this.previousColor!==void 0?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}_setColor(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)===!0&&(this.initialColor=Yt({},e)),this.color=e;const i=Da(e.r,e.g,e.b),o=2*Math.PI,r=this.r*i.s,A=this.centerCoordinates.x+r*Math.sin(o*i.h),I=this.centerCoordinates.y+r*Math.cos(o*i.h);this.colorPickerSelector.style.left=A-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=I-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(e)}_setOpacity(e){this.color.a=e/100,this._updatePicker(this.color)}_setBrightness(e){const t=Da(this.color.r,this.color.g,this.color.b);t.v=e/100;const i=KC(t.h,t.s,t.v);i.a=this.color.a,this.color=i,this._updatePicker()}_updatePicker(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.color;const t=Da(e.r,e.g,e.b),i=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const o=this.colorPickerCanvas.clientWidth,r=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,o,r),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-t.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),fa(i).call(i),this.brightnessRange.value=100*t.v,this.opacityRange.value=100*e.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}_setSize(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}_create(){var e,t,i,o;if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){const A=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(A.webkitBackingStorePixelRatio||A.mozBackingStorePixelRatio||A.msBackingStorePixelRatio||A.oBackingStorePixelRatio||A.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{const A=document.createElement("DIV");A.style.color="red",A.style.fontWeight="bold",A.style.padding="10px",A.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(A)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch{}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch{}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);const r=this;this.opacityRange.onchange=function(){r._setOpacity(this.value)},this.opacityRange.oninput=function(){r._setOpacity(this.value)},this.brightnessRange.onchange=function(){r._setBrightness(this.value)},this.brightnessRange.oninput=function(){r._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerText="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerText="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerText="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerText="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerText="cancel",this.cancelButton.onclick=oe(e=this._hide).call(e,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=oe(t=this._apply).call(t,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=oe(i=this._save).call(i,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=oe(o=this._loadLast).call(o,this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}_bindHammer(){this.drag={},this.pinch={},this.hammer=new $d(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",e=>{e.isFirst&&this._moveSelector(e)}),this.hammer.on("tap",e=>{this._moveSelector(e)}),this.hammer.on("panstart",e=>{this._moveSelector(e)}),this.hammer.on("panmove",e=>{this._moveSelector(e)}),this.hammer.on("panend",e=>{this._moveSelector(e)})}_generateHueCircle(){if(this.generated===!1){const e=this.colorPickerCanvas.getContext("2d");this.pixelRation===void 0&&(this.pixelRatio=(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)),e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const t=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;e.clearRect(0,0,t,i);let o,r,A,I;this.centerCoordinates={x:t*.5,y:i*.5},this.r=.49*t;const l=2*Math.PI/360,c=1/360,h=1/this.r;let p;for(A=0;A<360;A++)for(I=0;I3&&arguments[3]!==void 0?arguments[3]:1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:()=>!1;this.parent=e,this.changedOptions=[],this.container=t,this.allowCreation=!1,this.hideOption=r,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},Yt(this.options,this.defaultOptions),this.configureOptions=i,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new YU(o),this.wrapper=void 0}setOptions(e){if(e!==void 0){this.popupHistory={},this._removePopup();let t=!0;if(typeof e=="string")this.options.filter=e;else if(nt(e))this.options.filter=e.join();else if(typeof e=="object"){if(e==null)throw new TypeError("options cannot be null");e.container!==void 0&&(this.options.container=e.container),$t(e)!==void 0&&(this.options.filter=$t(e)),e.showButton!==void 0&&(this.options.showButton=e.showButton),e.enabled!==void 0&&(t=e.enabled)}else typeof e=="boolean"?(this.options.filter=!0,t=e):typeof e=="function"&&(this.options.filter=e,t=!0);$t(this.options)===!1&&(t=!1),this.options.enabled=t}this._clean()}setModuleOptions(e){this.moduleOptions=e,this.options.enabled===!0&&(this._clean(),this.options.container!==void 0&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];const e=$t(this.options);let t=0,i=!1;for(const o in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,o)&&(this.allowCreation=!1,i=!1,typeof e=="function"?(i=e(o,[]),i=i||this._handleObject(this.configureOptions[o],[o],!0)):(e===!0||It(e).call(e,o)!==-1)&&(i=!0),i!==!1&&(this.allowCreation=!0,t>0&&this._makeItem([]),this._makeHeader(o),this._handleObject(this.configureOptions[o],[o])),t++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(let e=0;e1?t-1:0),o=1;o{r.appendChild(A)}),this.domElements.push(r),this.domElements.length}return 0}_makeHeader(e){const t=document.createElement("div");t.className="vis-configuration vis-config-header",t.innerText=e,this._makeItem([],t)}_makeLabel(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const o=document.createElement("div");if(o.className="vis-configuration vis-config-label vis-config-s"+t.length,i===!0){for(;o.firstChild;)o.removeChild(o.firstChild);o.appendChild(tu("i","b",e))}else o.innerText=e+":";return o}_makeDropdown(e,t,i){const o=document.createElement("select");o.className="vis-configuration vis-config-select";let r=0;t!==void 0&&It(e).call(e,t)!==-1&&(r=It(e).call(e,t));for(let l=0;lA&&A!==1&&(l.max=Math.ceil(t*1.2),h=l.max,c="range increased"),l.value=t):l.value=o;const p=document.createElement("input");p.className="vis-configuration vis-config-rangeinput",p.value=l.value;const m=this;l.onchange=function(){p.value=this.value,m._update(Number(this.value),i)},l.oninput=function(){p.value=this.value};const b=this._makeLabel(i[i.length-1],i),w=this._makeItem(i,b,l,p);c!==""&&this.popupHistory[w]!==h&&(this.popupHistory[w]=h,this._setupPopup(c,w))}_makeButton(){if(this.options.showButton===!0){const e=document.createElement("div");e.className="vis-configuration vis-config-button",e.innerText="generate options",e.onclick=()=>{this._printOptions()},e.onmouseover=()=>{e.className="vis-configuration vis-config-button hover"},e.onmouseout=()=>{e.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(e)}}_setupPopup(e,t){if(this.initialized===!0&&this.allowCreation===!0&&this.popupCounter{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:i,index:t}}}_removePopup(){this.popupDiv.html!==void 0&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}_showPopupIfNeeded(){if(this.popupDiv.html!==void 0){const t=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=t.left+"px",this.popupDiv.html.style.top=t.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=_i(()=>{this.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=_i(()=>{this._removePopup()},1800)}}_makeCheckbox(e,t,i){const o=document.createElement("input");o.type="checkbox",o.className="vis-configuration vis-config-checkbox",o.checked=e,t!==void 0&&(o.checked=t,t!==e&&(typeof e=="object"?t!==e.enabled&&this.changedOptions.push({path:i,value:t}):this.changedOptions.push({path:i,value:t})));const r=this;o.onchange=function(){r._update(this.checked,i)};const A=this._makeLabel(i[i.length-1],i);this._makeItem(i,A,o)}_makeTextInput(e,t,i){const o=document.createElement("input");o.type="text",o.className="vis-configuration vis-config-text",o.value=t,t!==e&&this.changedOptions.push({path:i,value:t});const r=this;o.onchange=function(){r._update(this.value,i)};const A=this._makeLabel(i[i.length-1],i);this._makeItem(i,A,o)}_makeColorField(e,t,i){const o=e[1],r=document.createElement("div");t=t===void 0?o:t,t!=="none"?(r.className="vis-configuration vis-config-colorBlock",r.style.backgroundColor=t):r.className="vis-configuration vis-config-colorBlock none",t=t===void 0?o:t,r.onclick=()=>{this._showColorPicker(t,r,i)};const A=this._makeLabel(i[i.length-1],i);this._makeItem(i,A,r)}_showColorPicker(e,t,i){t.onclick=function(){},this.colorPicker.insertTo(t),this.colorPicker.show(),this.colorPicker.setColor(e),this.colorPicker.setUpdateCallback(o=>{const r="rgba("+o.r+","+o.g+","+o.b+","+o.a+")";t.style.backgroundColor=r,this._update(r,i)}),this.colorPicker.setCloseCallback(()=>{t.onclick=()=>{this._showColorPicker(e,t,i)}})}_handleObject(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=!1;const r=$t(this.options);let A=!1;for(const I in e)if(Object.prototype.hasOwnProperty.call(e,I)){o=!0;const l=e[I],c=HC(t,I);if(typeof r=="function"&&(o=r(I,t),o===!1&&!nt(l)&&typeof l!="string"&&typeof l!="boolean"&&l instanceof Object&&(this.allowCreation=!1,o=this._handleObject(l,c,!0),this.allowCreation=i===!1)),o!==!1){A=!0;const h=this._getValue(c);if(nt(l))this._handleArray(l,h,c);else if(typeof l=="string")this._makeTextInput(l,h,c);else if(typeof l=="boolean")this._makeCheckbox(l,h,c);else if(l instanceof Object){if(!this.hideOption(t,I,this.moduleOptions))if(l.enabled!==void 0){const p=HC(c,"enabled"),m=this._getValue(p);if(m===!0){const b=this._makeLabel(I,c,!0);this._makeItem(c,b),A=this._handleObject(l,c)||A}else this._makeCheckbox(l,m,c)}else{const p=this._makeLabel(I,c,!0);this._makeItem(c,p),A=this._handleObject(l,c)||A}}else console.error("dont know how to handle",l,I,c)}}return A}_handleArray(e,t,i){typeof e[0]=="string"&&e[0]==="color"?(this._makeColorField(e,t,i),e[1]!==t&&this.changedOptions.push({path:i,value:t})):typeof e[0]=="string"?(this._makeDropdown(e,t,i),e[0]!==t&&this.changedOptions.push({path:i,value:t})):typeof e[0]=="number"&&(this._makeRange(e,t,i),e[0]!==t&&this.changedOptions.push({path:i,value:Number(t)}))}_update(e,t){const i=this._constructOptions(e,t);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",i),this.initialized=!0,this.parent.setOptions(i)}_constructOptions(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=i;e=e==="true"?!0:e,e=e==="false"?!1:e;for(let r=0;rr-this.padding&&(l=!0),l?A=this.x-i:A=this.x,c?I=this.y-t:I=this.y}else I=this.y-t,I+t+this.padding>o&&(I=o-t-this.padding),Ir&&(A=r-i-this.padding),Ar.distance?l=" in "+Ft.printLocation(o.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+Ft.printLocation(r.path,r.closestMatch,""):o.distance<=A?l='. Did you mean "'+o.closestMatch+'"?'+Ft.printLocation(o.path,e):l=". Did you mean one of these: "+Ft.print(xt(t))+Ft.printLocation(i,e),console.error('%cUnknown option detected: "'+e+'"'+l,tu),Ma=!0}static findInOptions(e,t,i){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,r=1e9,A="",I=[];const l=e.toLowerCase();let c;for(const p in t){let m;if(t[p].__type__!==void 0&&o===!0){const b=Ft.findInOptions(e,t[p],UC(i,p));r>b.distance&&(A=b.closestMatch,I=b.path,r=b.distance,c=b.indexMatch)}else{var h;At(h=p.toLowerCase()).call(h,l)!==-1&&(c=p),m=Ft.levenshteinDistance(e,p),r>m&&(A=p,I=gU(i),r=m)}}return{closestMatch:A,path:I,distance:r,indexMatch:c}}static printLocation(e,t){let o=` +`:r.distance<=I&&o.distance>r.distance?l=" in "+Vt.printLocation(o.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+Vt.printLocation(r.path,r.closestMatch,""):o.distance<=A?l='. Did you mean "'+o.closestMatch+'"?'+Vt.printLocation(o.path,e):l=". Did you mean one of these: "+Vt.print(xt(t))+Vt.printLocation(i,e),console.error('%cUnknown option detected: "'+e+'"'+l,nu),Ma=!0}static findInOptions(e,t,i){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,r=1e9,A="",I=[];const l=e.toLowerCase();let c;for(const p in t){let m;if(t[p].__type__!==void 0&&o===!0){const b=Vt.findInOptions(e,t[p],HC(i,p));r>b.distance&&(A=b.closestMatch,I=b.path,r=b.distance,c=b.indexMatch)}else{var h;It(h=p.toLowerCase()).call(h,l)!==-1&&(c=p),m=Vt.levenshteinDistance(e,p),r>m&&(A=p,I=PU(i),r=m)}}return{closestMatch:A,path:I,distance:r,indexMatch:c}}static printLocation(e,t){let o=` `+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:`Problem value found at: `)+`options = { @@ -712,16 +712,16 @@ input.vis-configuration.vis-config-range:focus::-ms-fill-upper { `;for(let r=0;r":!0,"--":!0},jg="",Zs=0,Ue="",Ne="",jn=On.NULL;function vU(){Zs=0,Ue=jg.charAt(0)}function In(){Zs++,Ue=jg.charAt(Zs)}function Bs(){return jg.charAt(Zs+1)}function O1(n){var e=n.charCodeAt(0);return e<47?e===35||e===46:e<59?e>47:e<91?e>64:e<96?e===95:e<123?e>96:!1}function Zg(n,e){if(n||(n={}),e)for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function bU(n,e,t){for(var i=e.split("."),o=n;i.length;){var r=i.shift();i.length?(o[r]||(o[r]={}),o=o[r]):o[r]=t}}function N1(n,e){for(var t,i,o=null,r=[n],A=n;A.parent;)r.push(A.parent),A=A.parent;if(A.nodes){for(t=0,i=A.nodes.length;t=0;t--){var I,l=r[t];l.nodes||(l.nodes=[]),At(I=l.nodes).call(I,o)===-1&&l.nodes.push(o)}e.attr&&(o.attr=Zg(o.attr,e.attr))}function yU(n,e){if(n.edges||(n.edges=[]),n.edges.push(e),n.edge){var t=Zg({},n.edge);e.attr=Zg(t,e.attr)}}function D1(n,e,t,i,o){var r={from:e,to:t,type:i};return n.edge&&(r.attr=Zg({},n.edge)),r.attr=Zg(r.attr||{},o),o!=null&&o.hasOwnProperty("arrows")&&o.arrows!=null&&(r.arrows={to:{enabled:!0,type:o.arrows.type}},o.arrows=null),r}function bt(){for(jn=On.NULL,Ne="";Ue===" "||Ue===" "||Ue===` -`||Ue==="\r";)In();do{var n=!1;if(Ue==="#"){for(var e=Zs-1;jg.charAt(e)===" "||jg.charAt(e)===" ";)e--;if(jg.charAt(e)===` +`}static print(e){return Os(e).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;const i=[];let o;for(o=0;o<=t.length;o++)i[o]=[o];let r;for(r=0;r<=e.length;r++)i[0][r]=r;for(o=1;o<=t.length;o++)for(r=1;r<=e.length;r++)t.charAt(o-1)==e.charAt(r-1)?i[o][r]=i[o-1][r-1]:i[o][r]=Math.min(i[o-1][r-1]+1,Math.min(i[o][r-1]+1,i[o-1][r]+1));return i[t.length][e.length]}};const QU=Pi,XU=HU,Zs=$d,$U=KU,R1=nu,qU=WU;function JU(n){return jg=n,iY()}var z1={fontsize:"font.size",fontcolor:"font.color",labelfontcolor:"font.color",fontname:"font.face",color:["color.border","color.background"],fillcolor:"color.background",tooltip:"title",labeltooltip:"title"},iu=Mg(z1);iu.color="color.color",iu.style="dashes";var On={NULL:0,DELIMITER:1,IDENTIFIER:2,UNKNOWN:3},k1={"{":!0,"}":!0,"[":!0,"]":!0,";":!0,"=":!0,",":!0,"->":!0,"--":!0},jg="",Ps=0,Ue="",De="",Zn=On.NULL;function eY(){Ps=0,Ue=jg.charAt(0)}function In(){Ps++,Ue=jg.charAt(Ps)}function Bs(){return jg.charAt(Ps+1)}function _1(n){var e=n.charCodeAt(0);return e<47?e===35||e===46:e<59?e>47:e<91?e>64:e<96?e===95:e<123?e>96:!1}function Zg(n,e){if(n||(n={}),e)for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function tY(n,e,t){for(var i=e.split("."),o=n;i.length;){var r=i.shift();i.length?(o[r]||(o[r]={}),o=o[r]):o[r]=t}}function j1(n,e){for(var t,i,o=null,r=[n],A=n;A.parent;)r.push(A.parent),A=A.parent;if(A.nodes){for(t=0,i=A.nodes.length;t=0;t--){var I,l=r[t];l.nodes||(l.nodes=[]),It(I=l.nodes).call(I,o)===-1&&l.nodes.push(o)}e.attr&&(o.attr=Zg(o.attr,e.attr))}function nY(n,e){if(n.edges||(n.edges=[]),n.edges.push(e),n.edge){var t=Zg({},n.edge);e.attr=Zg(t,e.attr)}}function Z1(n,e,t,i,o){var r={from:e,to:t,type:i};return n.edge&&(r.attr=Zg({},n.edge)),r.attr=Zg(r.attr||{},o),o!=null&&o.hasOwnProperty("arrows")&&o.arrows!=null&&(r.arrows={to:{enabled:!0,type:o.arrows.type}},o.arrows=null),r}function bt(){for(Zn=On.NULL,De="";Ue===" "||Ue===" "||Ue===` +`||Ue==="\r";)In();do{var n=!1;if(Ue==="#"){for(var e=Ps-1;jg.charAt(e)===" "||jg.charAt(e)===" ";)e--;if(jg.charAt(e)===` `||jg.charAt(e)===""){for(;Ue!=""&&Ue!=` `;)In();n=!0}}if(Ue==="/"&&Bs()==="/"){for(;Ue!=""&&Ue!=` `;)In();n=!0}if(Ue==="/"&&Bs()==="*"){for(;Ue!="";)if(Ue==="*"&&Bs()==="/"){In(),In();break}else In();n=!0}for(;Ue===" "||Ue===" "||Ue===` -`||Ue==="\r";)In()}while(n);if(Ue===""){jn=On.DELIMITER;return}var t=Ue+Bs();if(T1[t]){jn=On.DELIMITER,Ne=t,In(),In();return}if(T1[Ue]){jn=On.DELIMITER,Ne=Ue,In();return}if(O1(Ue)||Ue==="-"){for(Ne+=Ue,In();O1(Ue);)Ne+=Ue,In();Ne==="false"?Ne=!1:Ne==="true"?Ne=!0:isNaN(Number(Ne))||(Ne=Number(Ne)),jn=On.IDENTIFIER;return}if(Ue==='"'){for(In();Ue!=""&&(Ue!='"'||Ue==='"'&&Bs()==='"');)Ue==='"'?(Ne+=Ue,In()):Ue==="\\"&&Bs()==="n"?(Ne+=` -`,In()):Ne+=Ue,In();if(Ue!='"')throw Nn('End of string " expected');In(),jn=On.IDENTIFIER;return}for(jn=On.UNKNOWN;Ue!="";)Ne+=Ue,In();throw new SyntaxError('Syntax error in part "'+R1(Ne,30)+'"')}function wU(){var n={};if(vU(),bt(),Ne==="strict"&&(n.strict=!0,bt()),(Ne==="graph"||Ne==="digraph")&&(n.type=Ne,bt()),jn===On.IDENTIFIER&&(n.id=Ne,bt()),Ne!="{")throw Nn("Angle bracket { expected");if(bt(),M1(n),Ne!="}")throw Nn("Angle bracket } expected");if(bt(),Ne!=="")throw Nn("End of file expected");return bt(),delete n.node,delete n.edge,delete n.graph,n}function M1(n){for(;Ne!==""&&Ne!="}";)xU(n),Ne===";"&&bt()}function xU(n){var e=z1(n);if(e){k1(n,e);return}var t=SU(n);if(!t){if(jn!=On.IDENTIFIER)throw Nn("Identifier expected");var i=Ne;if(bt(),Ne==="="){if(bt(),jn!=On.IDENTIFIER)throw Nn("Identifier expected");n[i]=Ne,bt()}else EU(n,i)}}function z1(n){var e=null;if(Ne==="subgraph"&&(e={},e.type="subgraph",bt(),jn===On.IDENTIFIER&&(e.id=Ne,bt())),Ne==="{"){if(bt(),e||(e={}),e.parent=n,e.node=n.node,e.edge=n.edge,e.graph=n.graph,M1(e),Ne!="}")throw Nn("Angle bracket } expected");bt(),delete e.node,delete e.edge,delete e.graph,delete e.parent,n.subgraphs||(n.subgraphs=[]),n.subgraphs.push(e)}return e}function SU(n){return Ne==="node"?(bt(),n.node=za(),"node"):Ne==="edge"?(bt(),n.edge=za(),"edge"):Ne==="graph"?(bt(),n.graph=za(),"graph"):null}function EU(n,e){var t={id:e},i=za();i&&(t.attr=i),N1(n,t),k1(n,e)}function k1(n,e){for(;Ne==="->"||Ne==="--";){var t,i=Ne;bt();var o=z1(n);if(o)t=o;else{if(jn!=On.IDENTIFIER)throw Nn("Identifier or subgraph expected");t=Ne,N1(n,{id:t}),bt()}var r=za(),A=D1(n,e,t,i,r);yU(n,A),e=t}}function za(){for(var n,e=null,t={dashed:!0,solid:!1,dotted:[1,5]},i={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},o=new Array,r=new Array;Ne==="[";){for(bt(),e={};Ne!==""&&Ne!="]";){if(jn!=On.IDENTIFIER)throw Nn("Attribute name expected");var A=Ne;if(bt(),Ne!="=")throw Nn("Equal sign = expected");if(bt(),jn!=On.IDENTIFIER)throw Nn("Attribute value expected");var I=Ne;A==="style"&&(I=t[I]);var l;A==="arrowhead"&&(l=i[I],A="arrows",I={to:{enabled:!0,type:l}}),A==="arrowtail"&&(l=i[I],A="arrows",I={from:{enabled:!0,type:l}}),o.push({attr:e,name:A,value:I}),r.push(A),bt(),Ne==","&&bt()}if(Ne!="]")throw Nn("Bracket ] expected");bt()}if(Dg(r).call(r,"dir")){var c={};for(c.arrows={},n=0;n"&&(I.arrows="to"),I};et(o=e.edges).call(o,function(A){var I,l;if(A.from instanceof Object?I=A.from.nodes:I={id:A.from},A.to instanceof Object?l=A.to.nodes:l={id:A.to},A.from instanceof Object&&A.from.edges){var c;et(c=A.from.edges).call(c,function(p){var m=r(p);t.edges.push(m)})}if(TU(I,l,function(p,m){var b=D1(t,p.id,m.id,A.type,A.attr),w=r(b);t.edges.push(w)}),A.to instanceof Object&&A.to.edges){var h;et(h=A.to.edges).call(h,function(p){var m=r(p);t.edges.push(m)})}})}return e.attr&&(t.options=e.attr),t}function NU(n,e){var t;const i={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};e!=null&&(e.fixed!=null&&(i.nodes.fixed=e.fixed),e.parseColor!=null&&(i.nodes.parseColor=e.parseColor),e.inheritColor!=null&&(i.edges.inheritColor=e.inheritColor));const o=n.edges,r=un(o).call(o,I=>{const l={from:I.source,id:I.id,to:I.target};return I.attributes!=null&&(l.attributes=I.attributes),I.label!=null&&(l.label=I.label),I.attributes!=null&&I.attributes.title!=null&&(l.title=I.attributes.title),I.type==="Directed"&&(l.arrows="to"),I.color&&i.edges.inheritColor===!1&&(l.color=I.color),l});return{nodes:un(t=n.nodes).call(t,I=>{const l={id:I.id,fixed:i.nodes.fixed&&I.x!=null&&I.y!=null};return I.attributes!=null&&(l.attributes=I.attributes),I.label!=null&&(l.label=I.label),I.size!=null&&(l.size=I.size),I.attributes!=null&&I.attributes.title!=null&&(l.title=I.attributes.title),I.title!=null&&(l.title=I.title),I.x!=null&&(l.x=I.x),I.y!=null&&(l.y=I.y),I.color!=null&&(i.nodes.parseColor===!0?l.color=I.color:l.color={background:I.color,border:I.color,highlight:{background:I.color,border:I.color},hover:{background:I.color,border:I.color}}),l}),edges:r}}var DU=Object.freeze({__proto__:null,cn:{addDescription:"单击空白处放置新节点。",addEdge:"添加连接线",addNode:"添加节点",back:"返回",close:"關閉",createEdgeError:"无法将连接线连接到群集。",del:"删除选定",deleteClusterError:"无法删除群集。",edgeDescription:"单击某个节点并将该连接线拖动到另一个节点以连接它们。",edit:"编辑",editClusterError:"无法编辑群集。",editEdge:"编辑连接线",editEdgeDescription:"单击控制节点并将它们拖到节点上连接。",editNode:"编辑节点"},cs:{addDescription:"Kluknutím do prázdného prostoru můžete přidat nový vrchol.",addEdge:"Přidat hranu",addNode:"Přidat vrchol",back:"Zpět",close:"Zavřít",createEdgeError:"Nelze připojit hranu ke shluku.",del:"Smazat výběr",deleteClusterError:"Nelze mazat shluky.",edgeDescription:"Přetažením z jednoho vrcholu do druhého můžete spojit tyto vrcholy novou hranou.",edit:"Upravit",editClusterError:"Nelze upravovat shluky.",editEdge:"Upravit hranu",editEdgeDescription:"Přetažením kontrolního vrcholu hrany ji můžete připojit k jinému vrcholu.",editNode:"Upravit vrchol"},de:{addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",addEdge:"Kante hinzufügen",addNode:"Knoten hinzufügen",back:"Zurück",close:"Schließen",createEdgeError:"Es ist nicht möglich, Kanten mit Clustern zu verbinden.",del:"Lösche Auswahl",deleteClusterError:"Cluster können nicht gelöscht werden.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",edit:"Editieren",editClusterError:"Cluster können nicht editiert werden.",editEdge:"Kante editieren",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",editNode:"Knoten editieren"},en:{addDescription:"Click in an empty space to place a new node.",addEdge:"Add Edge",addNode:"Add Node",back:"Back",close:"Close",createEdgeError:"Cannot link edges to a cluster.",del:"Delete selected",deleteClusterError:"Clusters cannot be deleted.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",edit:"Edit",editClusterError:"Clusters cannot be edited.",editEdge:"Edit Edge",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",editNode:"Edit Node"},es:{addDescription:"Haga clic en un lugar vacío para colocar un nuevo nodo.",addEdge:"Añadir arista",addNode:"Añadir nodo",back:"Atrás",close:"Cerrar",createEdgeError:"No se puede conectar una arista a un grupo.",del:"Eliminar selección",deleteClusterError:"No es posible eliminar grupos.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",edit:"Editar",editClusterError:"No es posible editar grupos.",editEdge:"Editar arista",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",editNode:"Editar nodo"},fr:{addDescription:"Cliquez dans un endroit vide pour placer un nœud.",addEdge:"Ajouter un lien",addNode:"Ajouter un nœud",back:"Retour",close:"Fermer",createEdgeError:"Impossible de créer un lien vers un cluster.",del:"Effacer la sélection",deleteClusterError:"Les clusters ne peuvent pas être effacés.",edgeDescription:"Cliquez sur un nœud et glissez le lien vers un autre nœud pour les connecter.",edit:"Éditer",editClusterError:"Les clusters ne peuvent pas être édités.",editEdge:"Éditer le lien",editEdgeDescription:"Cliquez sur les points de contrôle et glissez-les pour connecter un nœud.",editNode:"Éditer le nœud"},it:{addDescription:"Clicca per aggiungere un nuovo nodo",addEdge:"Aggiungi un vertice",addNode:"Aggiungi un nodo",back:"Indietro",close:"Chiudere",createEdgeError:"Non si possono collegare vertici ad un cluster",del:"Cancella la selezione",deleteClusterError:"I cluster non possono essere cancellati",edgeDescription:"Clicca su un nodo e trascinalo ad un altro nodo per connetterli.",edit:"Modifica",editClusterError:"I clusters non possono essere modificati.",editEdge:"Modifica il vertice",editEdgeDescription:"Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.",editNode:"Modifica il nodo"},nl:{addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",addEdge:"Link toevoegen",addNode:"Node toevoegen",back:"Terug",close:"Sluiten",createEdgeError:"Kan geen link maken naar een cluster.",del:"Selectie verwijderen",deleteClusterError:"Clusters kunnen niet worden verwijderd.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",edit:"Wijzigen",editClusterError:"Clusters kunnen niet worden aangepast.",editEdge:"Link wijzigen",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",editNode:"Node wijzigen"},pt:{addDescription:"Clique em um espaço em branco para adicionar um novo nó",addEdge:"Adicionar aresta",addNode:"Adicionar nó",back:"Voltar",close:"Fechar",createEdgeError:"Não foi possível linkar arestas a um cluster.",del:"Remover selecionado",deleteClusterError:"Clusters não puderam ser removidos.",edgeDescription:"Clique em um nó e arraste a aresta até outro nó para conectá-los",edit:"Editar",editClusterError:"Clusters não puderam ser editados.",editEdge:"Editar aresta",editEdgeDescription:"Clique nos pontos de controle e os arraste para um nó para conectá-los",editNode:"Editar nó"},ru:{addDescription:"Кликните в свободное место, чтобы добавить новый узел.",addEdge:"Добавить ребро",addNode:"Добавить узел",back:"Назад",close:"Закрывать",createEdgeError:"Невозможно соединить ребра в кластер.",del:"Удалить выбранное",deleteClusterError:"Кластеры не могут быть удалены",edgeDescription:"Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.",edit:"Редактировать",editClusterError:"Кластеры недоступны для редактирования.",editEdge:"Редактировать ребро",editEdgeDescription:"Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.",editNode:"Редактировать узел"},uk:{addDescription:"Kлікніть на вільне місце, щоб додати новий вузол.",addEdge:"Додати край",addNode:"Додати вузол",back:"Назад",close:"Закрити",createEdgeError:"Не можливо об'єднати краї в групу.",del:"Видалити обране",deleteClusterError:"Групи не можуть бути видалені.",edgeDescription:"Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.",edit:"Редагувати",editClusterError:"Групи недоступні для редагування.",editEdge:"Редагувати край",editEdgeDescription:"Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.",editNode:"Редагувати вузол"}});function MU(n,e){try{const[i,o]=e.split(/[-_ /]/,2),r=i!=null?i.toLowerCase():null,A=o!=null?o.toUpperCase():null;if(r&&A){const I=r+"-"+A;if(Object.prototype.hasOwnProperty.call(n,I))return I;var t;console.warn(d0(t="Unknown variant ".concat(A," of language ")).call(t,r,"."))}if(r){const I=r;if(Object.prototype.hasOwnProperty.call(n,I))return I;console.warn("Unknown language ".concat(r))}return console.warn("Unknown locale ".concat(e,", falling back to English.")),"en"}catch(i){return console.error(i),console.warn("Unexpected error while normalizing locale ".concat(e,", falling back to English.")),"en"}}class zU{constructor(){this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}init(){if(this.initialized())return;this.src=this.image.src;const e=this.image.width,t=this.image.height;this.width=e,this.height=t;const i=Math.floor(t/2),o=Math.floor(t/4),r=Math.floor(t/8),A=Math.floor(t/16),I=Math.floor(e/2),l=Math.floor(e/4),c=Math.floor(e/8),h=Math.floor(e/16);this.canvas.width=3*l,this.canvas.height=i,this.coordinates=[[0,0,I,i],[I,0,l,o],[I,o,c,r],[5*c,o,h,A]],this._fillMipMap()}initialized(){return this.coordinates!==void 0}_fillMipMap(){const e=this.canvas.getContext("2d"),t=this.coordinates[0];e.drawImage(this.image,t[0],t[1],t[2],t[3]);for(let i=1;i2){t*=.5;let I=0;for(;t>2&&I=this.NUM_ITERATIONS&&(I=this.NUM_ITERATIONS-1);const l=this.coordinates[I];e.drawImage(this.canvas,l[0],l[1],l[2],l[3],i,o,r,A)}else e.drawImage(this.image,i,o,r,A)}}class kU{constructor(e){this.images={},this.imageBroken={},this.callback=e}_tryloadBrokenUrl(e,t,i){if(!(e===void 0||i===void 0)){if(t===void 0){console.warn("No broken url image defined");return}i.image.onerror=()=>{console.error("Could not load brokenImage:",t)},i.image.src=t}}_redrawWithImage(e){this.callback&&this.callback(e)}load(e,t){const i=this.images[e];if(i)return i;const o=new zU;return this.images[e]=o,o.image.onload=()=>{this._fixImageCoordinates(o.image),o.init(),this._redrawWithImage(o)},o.image.onerror=()=>{console.error("Could not load image:",e),this._tryloadBrokenUrl(e,t,o)},o.image.src=e,o}_fixImageCoordinates(e){e.width===0&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}}var j1={exports:{}},RU=gt,_U=RU(function(){if(typeof ArrayBuffer=="function"){var n=new ArrayBuffer(8);Object.isExtensible(n)&&Object.defineProperty(n,"a",{value:8})}}),jU=gt,ZU=xn,BU=Qi,Z1=_U,HC=Object.isExtensible,PU=jU(function(){HC(1)}),LU=PU||Z1?function(e){return!ZU(e)||Z1&&BU(e)==="ArrayBuffer"?!1:HC?HC(e):!0}:HC,GU=gt,B1=!GU(function(){return Object.isExtensible(Object.preventExtensions({}))}),FU=Me,VU=ot,UU=ea,YU=xn,gu=rn,HU=Hn.f,P1=ra,KU=fC,ou=LU,WU=oC,QU=B1,L1=!1,ig=WU("meta"),XU=0,su=function(n){HU(n,ig,{value:{objectID:"O"+XU++,weakData:{}}})},$U=function(n,e){if(!YU(n))return typeof n=="symbol"?n:(typeof n=="string"?"S":"P")+n;if(!gu(n,ig)){if(!ou(n))return"F";if(!e)return"E";su(n)}return n[ig].objectID},qU=function(n,e){if(!gu(n,ig)){if(!ou(n))return!0;if(!e)return!1;su(n)}return n[ig].weakData},JU=function(n){return QU&&L1&&ou(n)&&!gu(n,ig)&&su(n),n},eY=function(){tY.enable=function(){},L1=!0;var n=P1.f,e=VU([].splice),t={};t[ig]=1,n(t).length&&(P1.f=function(i){for(var o=n(i),r=0,A=o.length;rp;p++)if(b=O(n[p]),b&&Y1(K1,b))return b;return new WC(!1)}c=TY(n,h)}for(w=r?n.next:c.next;!(S=yY(w,c)).done;){try{b=O(S.value)}catch(E){H1(c,"throw",E)}if(typeof b=="object"&&b&&Y1(K1,b))return b}return new WC(!1)},DY=jt,MY=TypeError,au=function(n,e){if(DY(e,n))return n;throw new MY("Incorrect invocation")},zY=Me,kY=_t,RY=KC,_Y=gt,jY=fs,ZY=ru,BY=au,PY=dn,LY=xn,GY=cs,FY=bs,VY=Hn.f,UY=Og.forEach,YY=sn,W1=wo,HY=W1.set,KY=W1.getterFor,Au=function(n,e,t){var i=n.indexOf("Map")!==-1,o=n.indexOf("Weak")!==-1,r=i?"set":"add",A=kY[n],I=A&&A.prototype,l={},c;if(!YY||!PY(A)||!(o||I.forEach&&!_Y(function(){new A().entries().next()})))c=t.getConstructor(e,n,i,r),RY.enable();else{c=e(function(m,b){HY(BY(m,h),{type:n,collection:new A}),GY(b)||ZY(b,m[r],{that:m,AS_ENTRIES:i})});var h=c.prototype,p=KY(n);UY(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(m){var b=m==="add"||m==="set";m in I&&!(o&&m==="clear")&&jY(h,m,function(w,S){var x=p(this).collection;if(!b&&o&&!LY(w))return m==="get"?void 0:!1;var O=x[m](w===0?0:w,S);return b?this:O})}),o||VY(h,"size",{configurable:!0,get:function(){return p(this).collection.size}})}return FY(c,n,!1,!0),l[n]=c,zY({global:!0,forced:!0},l),o||t.setStrong(c,n,i),c},WY=aa,Cu=function(n,e,t){for(var i in e)t&&t.unsafe&&n[i]?n[i]=e[i]:WY(n,i,e[i],t);return n},QY=bi,XY=$c,$Y=Vt,qY=sn,Q1=$Y("species"),JY=function(n){var e=QY(n);qY&&e&&!e[Q1]&&XY(e,Q1,{configurable:!0,get:function(){return this}})},eH=sa,tH=$c,X1=Cu,nH=qr,iH=au,gH=cs,oH=ru,sH=pd,QC=md,rH=JY,ka=sn,$1=KC.fastKey,q1=wo,J1=q1.set,Iu=q1.getterFor,ew={getConstructor:function(n,e,t,i){var o=n(function(c,h){iH(c,r),J1(c,{type:e,index:eH(null),first:void 0,last:void 0,size:0}),ka||(c.size=0),gH(h)||oH(h,c[i],{that:c,AS_ENTRIES:t})}),r=o.prototype,A=Iu(e),I=function(c,h,p){var m=A(c),b=l(c,h),w,S;return b?b.value=p:(m.last=b={index:S=$1(h,!0),key:h,value:p,previous:w=m.last,next:void 0,removed:!1},m.first||(m.first=b),w&&(w.next=b),ka?m.size++:c.size++,S!=="F"&&(m.index[S]=b)),c},l=function(c,h){var p=A(c),m=$1(h),b;if(m!=="F")return p.index[m];for(b=p.first;b;b=b.next)if(b.key===h)return b};return X1(r,{clear:function(){for(var h=this,p=A(h),m=p.index,b=p.first;b;)b.removed=!0,b.previous&&(b.previous=b.previous.next=void 0),delete m[b.index],b=b.next;p.first=p.last=void 0,ka?p.size=0:h.size=0},delete:function(c){var h=this,p=A(h),m=l(h,c);if(m){var b=m.next,w=m.previous;delete p.index[m.index],m.removed=!0,w&&(w.next=b),b&&(b.previous=w),p.first===m&&(p.first=b),p.last===m&&(p.last=w),ka?p.size--:h.size--}return!!m},forEach:function(h){for(var p=A(this),m=nH(h,arguments.length>1?arguments[1]:void 0),b;b=b?b.next:p.first;)for(m(b.value,b.key,this);b&&b.removed;)b=b.previous},has:function(h){return!!l(this,h)}}),X1(r,t?{get:function(h){var p=l(this,h);return p&&p.value},set:function(h,p){return I(this,h===0?0:h,p)}}:{add:function(h){return I(this,h=h===0?0:h,h)}}),ka&&tH(r,"size",{configurable:!0,get:function(){return A(this).size}}),o},setStrong:function(n,e,t){var i=e+" Iterator",o=Iu(e),r=Iu(i);sH(n,e,function(A,I){J1(this,{type:i,target:A,state:o(A),kind:I,last:void 0})},function(){for(var A=r(this),I=A.kind,l=A.last;l&&l.removed;)l=l.previous;return!A.target||!(A.last=l=l?l.next:A.state.first)?(A.target=void 0,QC(void 0,!0)):QC(I==="keys"?l.key:I==="values"?l.value:[l.key,l.value],!1)},t?"entries":"values",!t,!0),rH(e)}},aH=Au,AH=ew;aH("Map",function(n){return function(){return n(this,arguments.length?arguments[0]:void 0)}},AH);var lu=ot,CH=AC,IH=zi,lH=Hr,cH=lu("".charAt),tw=lu("".charCodeAt),dH=lu("".slice),uH=function(n){return function(e,t){var i=IH(lH(e)),o=CH(t),r=i.length,A,I;return o<0||o>=r?n?"":void 0:(A=tw(i,o),A<55296||A>56319||o+1===r||(I=tw(i,o+1))<56320||I>57343?n?cH(i,o):A:n?dH(i,o,o+2):(A-55296<<10)+(I-56320)+65536)}},hH={charAt:uH(!0)},fH=hH.charAt,pH=zi,nw=wo,mH=pd,iw=md,gw="String Iterator",vH=nw.set,bH=nw.getterFor(gw);mH(String,"String",function(n){vH(this,{type:gw,string:pH(n),index:0})},function(){var e=bH(this),t=e.string,i=e.index,o;return i>=t.length?iw(void 0,!0):(o=fH(t,i),e.index+=o.length,iw(o,!1))});var yH=rt,wH=yH.Map,xH=wH,SH=xH,EH=SH,Ra=Oe(EH);class TH{constructor(){this.clear(),this._defaultIndex=0,this._groupIndex=0,this._defaultGroups=[{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},{border:"#FFA500",background:"#FFFF00",highlight:{border:"#FFA500",background:"#FFFFA3"},hover:{border:"#FFA500",background:"#FFFFA3"}},{border:"#FA0A10",background:"#FB7E81",highlight:{border:"#FA0A10",background:"#FFAFB1"},hover:{border:"#FA0A10",background:"#FFAFB1"}},{border:"#41A906",background:"#7BE141",highlight:{border:"#41A906",background:"#A1EC76"},hover:{border:"#41A906",background:"#A1EC76"}},{border:"#E129F0",background:"#EB7DF4",highlight:{border:"#E129F0",background:"#F0B3F5"},hover:{border:"#E129F0",background:"#F0B3F5"}},{border:"#7C29F0",background:"#AD85E4",highlight:{border:"#7C29F0",background:"#D3BDF0"},hover:{border:"#7C29F0",background:"#D3BDF0"}},{border:"#C37F00",background:"#FFA807",highlight:{border:"#C37F00",background:"#FFCA66"},hover:{border:"#C37F00",background:"#FFCA66"}},{border:"#4220FB",background:"#6E6EFD",highlight:{border:"#4220FB",background:"#9B9BFD"},hover:{border:"#4220FB",background:"#9B9BFD"}},{border:"#FD5A77",background:"#FFC0CB",highlight:{border:"#FD5A77",background:"#FFD1D9"},hover:{border:"#FD5A77",background:"#FFD1D9"}},{border:"#4AD63A",background:"#C2FABC",highlight:{border:"#4AD63A",background:"#E6FFE3"},hover:{border:"#4AD63A",background:"#E6FFE3"}},{border:"#990000",background:"#EE0000",highlight:{border:"#BB0000",background:"#FF3333"},hover:{border:"#BB0000",background:"#FF3333"}},{border:"#FF6000",background:"#FF6000",highlight:{border:"#FF6000",background:"#FF6000"},hover:{border:"#FF6000",background:"#FF6000"}},{border:"#97C2FC",background:"#2B7CE9",highlight:{border:"#D2E5FF",background:"#2B7CE9"},hover:{border:"#D2E5FF",background:"#2B7CE9"}},{border:"#399605",background:"#255C03",highlight:{border:"#399605",background:"#255C03"},hover:{border:"#399605",background:"#255C03"}},{border:"#B70054",background:"#FF007E",highlight:{border:"#B70054",background:"#FF007E"},hover:{border:"#B70054",background:"#FF007E"}},{border:"#AD85E4",background:"#7C29F0",highlight:{border:"#D3BDF0",background:"#7C29F0"},hover:{border:"#D3BDF0",background:"#7C29F0"}},{border:"#4557FA",background:"#000EA1",highlight:{border:"#6E6EFD",background:"#000EA1"},hover:{border:"#6E6EFD",background:"#000EA1"}},{border:"#FFC0CB",background:"#FD5A77",highlight:{border:"#FFD1D9",background:"#FD5A77"},hover:{border:"#FFD1D9",background:"#FD5A77"}},{border:"#C2FABC",background:"#74D66A",highlight:{border:"#E6FFE3",background:"#74D66A"},hover:{border:"#E6FFE3",background:"#74D66A"}},{border:"#EE0000",background:"#990000",highlight:{border:"#FF3333",background:"#BB0000"},hover:{border:"#FF3333",background:"#BB0000"}}],this.options={},this.defaultOptions={useDefaultGroups:!0},Ut(this.options,this.defaultOptions)}setOptions(e){const t=["useDefaultGroups"];if(e!==void 0){for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&At(t).call(t,i)===-1){const o=e[i];this.add(i,o)}}}clear(){this._groups=new Ra,this._groupNames=[]}get(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=this._groups.get(e);if(i===void 0&&t)if(this.options.useDefaultGroups===!1&&this._groupNames.length>0){const o=this._groupIndex%this._groupNames.length;++this._groupIndex,i={},i.color=this._groups.get(this._groupNames[o]),this._groups.set(e,i)}else{const o=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,i={},i.color=this._defaultGroups[o],this._groups.set(e,i)}return i}add(e,t){return this._groups.has(e)||this._groupNames.push(e),this._groups.set(e,t),t}}var OH=Me;OH({target:"Number",stat:!0},{isNaN:function(e){return e!==e}});var NH=rt,DH=NH.Number.isNaN,MH=DH,zH=MH,kH=zH,cu=Oe(kH),RH=_t,_H=RH.isFinite,jH=Number.isFinite||function(e){return typeof e=="number"&&_H(e)},ZH=Me,BH=jH;ZH({target:"Number",stat:!0},{isFinite:BH});var PH=rt,LH=PH.Number.isFinite,GH=LH,FH=GH,VH=FH,jo=Oe(VH),UH=Me,YH=Og.some,HH=Es,KH=HH("some");UH({target:"Array",proto:!0,forced:!KH},{some:function(e){return YH(this,e,arguments.length>1?arguments[1]:void 0)}});var WH=Xt,QH=WH("Array").some,XH=jt,$H=QH,du=Array.prototype,qH=function(n){var e=n.some;return n===du||XH(du,n)&&e===du.some?$H:e},JH=qH,e7=JH,t7=e7,ow=Oe(t7),n7=rt,i7=n7.Object.getOwnPropertySymbols,g7=i7,o7=g7,s7=o7,Pi=Oe(s7),sw={exports:{}},r7=Me,a7=gt,A7=vi,rw=Vr.f,aw=sn,C7=!aw||a7(function(){rw(1)});r7({target:"Object",stat:!0,forced:C7,sham:!aw},{getOwnPropertyDescriptor:function(e,t){return rw(A7(e),t)}});var I7=rt,Aw=I7.Object,l7=sw.exports=function(e,t){return Aw.getOwnPropertyDescriptor(e,t)};Aw.getOwnPropertyDescriptor.sham&&(l7.sham=!0);var c7=sw.exports,d7=c7,u7=d7,h7=u7,Li=Oe(h7),f7=Me,p7=sn,m7=i0,v7=vi,b7=Vr,y7=ia;f7({target:"Object",stat:!0,sham:!p7},{getOwnPropertyDescriptors:function(e){for(var t=v7(e),i=b7.f,o=m7(t),r={},A=0,I,l;o.length>A;)l=i(t,I=o[A++]),l!==void 0&&y7(r,I,l);return r}});var w7=rt,x7=w7.Object.getOwnPropertyDescriptors,S7=x7,E7=S7,T7=E7,Gi=Oe(T7),Cw={exports:{}},O7=Me,N7=sn,Iw=cC.f;O7({target:"Object",stat:!0,forced:Object.defineProperties!==Iw,sham:!N7},{defineProperties:Iw});var D7=rt,lw=D7.Object,M7=Cw.exports=function(e,t){return lw.defineProperties(e,t)};lw.defineProperties.sham&&(M7.sham=!0);var z7=Cw.exports,k7=z7,R7=k7,_7=R7,_a=Oe(_7),cw={exports:{}},j7=Me,Z7=sn,dw=Hn.f;j7({target:"Object",stat:!0,forced:Object.defineProperty!==dw,sham:!Z7},{defineProperty:dw});var B7=rt,uw=B7.Object,P7=cw.exports=function(e,t,i){return uw.defineProperty(e,t,i)};uw.defineProperty.sham&&(P7.sham=!0);var L7=cw.exports,G7=L7,hw=G7,F7=hw,V7=F7,U7=V7,Y7=U7,H7=Y7,K7=Oe(H7),W7=Vt,Q7=Hn.f,fw=W7("metadata"),pw=Function.prototype;pw[fw]===void 0&&Q7(pw,fw,{value:null});var X7=Zt;X7("asyncDispose");var $7=Zt;$7("dispose");var q7=Zt;q7("metadata");var J7=e0,eK=J7,tK=bi,nK=ot,uu=tK("Symbol"),iK=uu.keyFor,gK=nK(uu.prototype.valueOf),mw=uu.isRegisteredSymbol||function(e){try{return iK(gK(e))!==void 0}catch{return!1}},oK=Me,sK=mw;oK({target:"Symbol",stat:!0},{isRegisteredSymbol:sK});for(var rK=us,vw=bi,aK=ot,AK=Qr,CK=Vt,XC=vw("Symbol"),bw=XC.isWellKnownSymbol,yw=vw("Object","getOwnPropertyNames"),IK=aK(XC.prototype.valueOf),ww=rK("wks"),hu=0,xw=yw(XC),lK=xw.length;hu=0:I>l;l+=c)l in A&&(o=t(o,A[l],l,r));return o}},eW={left:JK(!1)},tW=_t,nW=Qi,iW=nW(tW.process)==="process",gW=Me,oW=eW.left,sW=Es,Ow=Wr,rW=iW,aW=!rW&&Ow>79&&Ow<83,AW=aW||!sW("reduce");gW({target:"Array",proto:!0,forced:AW},{reduce:function(e){var t=arguments.length;return oW(this,e,t,t>1?arguments[1]:void 0)}});var CW=Xt,IW=CW("Array").reduce,lW=jt,cW=IW,fu=Array.prototype,dW=function(n){var e=n.reduce;return n===fu||lW(fu,n)&&e===fu.reduce?cW:e},uW=dW,hW=uW,fW=hW,pu=Oe(fW),pW=Tg,mW=ii,vW=Uc,bW=qr,Nw=function(n,e,t,i,o,r,A,I){for(var l=o,c=0,h=A?bW(A,I):!1,p,m;c0&&pW(p)?(m=mW(p),l=Nw(n,e,p,m,l,r-1)-1):(vW(l+1),n[l]=p),l++),c++;return l},yW=Nw,wW=Me,xW=yW,SW=bo,EW=Yn,TW=ii,OW=lC;wW({target:"Array",proto:!0},{flatMap:function(e){var t=EW(this),i=TW(t),o;return SW(e),o=OW(t,0),o.length=xW(o,t,t,i,0,1,e,arguments.length>1?arguments[1]:void 0),o}});var NW=Xt;NW("Array").flatMap;var DW=Tw,Ps=Oe(DW),MW=Au,zW=ew;MW("Set",function(n){return function(){return n(this,arguments.length?arguments[0]:void 0)}},zW);var kW=rt,RW=kW.Set,_W=RW,jW=_W,ZW=jW,Ti=Oe(ZW),BW=V1,PW=BW,LW=PW,GW=LW,FW=GW,VW=FW,UW=VW,YW=UW,HW=YW,KW=HW,mu=Oe(KW),Dw=Ub,WW=Math.floor,vu=function(n,e){var t=n.length,i=WW(t/2);return t<8?QW(n,e):XW(n,vu(Dw(n,0,i),e),vu(Dw(n,i),e),e)},QW=function(n,e){for(var t=n.length,i=1,o,r;i0;)n[r]=n[--r];r!==i++&&(n[r]=o)}return n},XW=function(n,e,t,i){for(var o=e.length,r=t.length,A=0,I=0;A3)){if(CQ)return!0;if(Bw)return Bw<603;var n="",e,t,i,o;for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:i=3;break;case 68:case 71:i=4;break;default:i=2}for(o=0;o<47;o++)Bg.push({k:t+o,v:i})}for(Bg.sort(function(r,A){return A.v-r.v}),o=0;o_w(t)?1:-1}};gQ({target:"Array",proto:!0,forced:uQ},{sort:function(e){e!==void 0&&oQ(e);var t=sQ(this);if(Lw)return e===void 0?Pw(t):Pw(t,e);var i=[],o=Rw(t),r,A;for(A=0;A{i.flush()};const o=[{name:"flush",original:void 0}];if(t&&t.replace)for(let r=0;rthis.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay=="number"&&(this._timeout=_i(()=>{this.flush()},this.delay))}flush(){var e,t;et(e=Ri(t=this._queue).call(t,0)).call(e,i=>{i.fn.apply(i.context||i.fn,i.args||[])})}}class eI{constructor(){Jt(this,"_subscribers",{"*":[],add:[],remove:[],update:[]}),Jt(this,"subscribe",eI.prototype.on),Jt(this,"unsubscribe",eI.prototype.off)}_trigger(e,t,i){var o;if(e==="*")throw new Error("Cannot trigger event *");et(o=[...this._subscribers[e],...this._subscribers["*"]]).call(o,r=>{r(e,t,i??null)})}on(e,t){typeof t=="function"&&this._subscribers[e].push(t)}off(e,t){var i;this._subscribers[e]=$t(i=this._subscribers[e]).call(i,o=>o!==t)}}class Zo{constructor(e){Jt(this,"_pairs",void 0),this._pairs=e}*[Ps](){for(const[e,t]of this._pairs)yield[e,t]}*entries(){for(const[e,t]of this._pairs)yield[e,t]}*keys(){for(const[e]of this._pairs)yield e}*values(){for(const[,e]of this._pairs)yield e}toIdArray(){var e;return un(e=[...this._pairs]).call(e,t=>t[0])}toItemArray(){var e;return un(e=[...this._pairs]).call(e,t=>t[1])}toEntryArray(){return[...this._pairs]}toObjectMap(){const e=Mg(null);for(const[t,i]of this._pairs)e[t]=i;return e}toMap(){return new Ra(this._pairs)}toIdSet(){return new Ti(this.toIdArray())}toItemSet(){return new Ti(this.toItemArray())}cache(){return new Zo([...this._pairs])}distinct(e){const t=new Ti;for(const[i,o]of this._pairs)t.add(e(o,i));return t}filter(e){const t=this._pairs;return new Zo({*[Ps](){for(const[i,o]of t)e(o,i)&&(yield[i,o])}})}forEach(e){for(const[t,i]of this._pairs)e(i,t)}map(e){const t=this._pairs;return new Zo({*[Ps](){for(const[i,o]of t)yield[i,e(o,i)]}})}max(e){const t=mu(this._pairs);let i=t.next();if(i.done)return null;let o=i.value[1],r=e(i.value[1],i.value[0]);for(;!(i=t.next()).done;){const[A,I]=i.value,l=e(I,A);l>r&&(r=l,o=I)}return o}min(e){const t=mu(this._pairs);let i=t.next();if(i.done)return null;let o=i.value[1],r=e(i.value[1],i.value[0]);for(;!(i=t.next()).done;){const[A,I]=i.value,l=e(I,A);l{var t;return mu(gg(t=[...this._pairs]).call(t,(i,o)=>{let[r,A]=i,[I,l]=o;return e(A,l,r,I)}))}})}}function AX(n,e){return n[e]==null&&(n[e]=Gs()),n}class Fs extends eI{get idProp(){return this._idProp}constructor(e,t){super(),Jt(this,"flush",void 0),Jt(this,"length",void 0),Jt(this,"_options",void 0),Jt(this,"_data",void 0),Jt(this,"_idProp",void 0),Jt(this,"_queue",null),e&&!tt(e)&&(t=e,e=[]),this._options=t||{},this._data=new Ra,this.length=0,this._idProp=this._options.fieldId||"id",e&&e.length&&this.add(e),this.setOptions(t)}setOptions(e){e&&e.queue!==void 0&&(e.queue===!1?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=Eu.extend(this,{replace:["add","update","remove"]})),e.queue&&typeof e.queue=="object"&&this._queue.setOptions(e.queue)))}add(e,t){const i=[];let o;if(tt(e)){const r=un(e).call(e,A=>A[this._idProp]);if(ow(r).call(r,A=>this._data.has(A)))throw new Error("A duplicate id was found in the parameter array.");for(let A=0,I=e.length;A{const h=c[I];if(h!=null&&this._data.has(h)){const p=c,m=Ut({},this._data.get(h)),b=this._updateItem(p);o.push(b),A.push(p),r.push(m)}else{const p=this._addItem(c);i.push(p)}};if(tt(e))for(let c=0,h=e.length;c{const A=this._data.get(r[this._idProp]);if(A==null)throw new Error("Updating non-existent items is not allowed.");return{oldData:A,update:r}})).call(i,r=>{let{oldData:A,update:I}=r;const l=A[this._idProp],c=WV(A,I);return this._data.set(l,c),{id:l,oldData:A,updatedData:c}});if(o.length){const r={items:un(o).call(o,A=>A.id),oldData:un(o).call(o,A=>A.oldData),data:un(o).call(o,A=>A.updatedData)};return this._trigger("update",r,t),r.items}else return[]}get(e,t){let i,o,r;Uw(e)?(i=e,r=t):tt(e)?(o=e,r=t):r=e;const A=r&&r.returnType==="Object"?"Object":"Array",I=r&&$t(r),l=[];let c,h,p;if(i!=null)c=this._data.get(i),c&&I&&!I(c)&&(c=void 0);else if(o!=null)for(let w=0,S=o.length;w(o[r]=e[r],o),{})}_sort(e,t){if(typeof t=="string"){const i=t;gg(e).call(e,(o,r)=>{const A=o[i],I=r[i];return A>I?1:Ai)&&(t=r,i=A)}return t||null}min(e){let t=null,i=null;for(const r of qC(o=this._data).call(o)){var o;const A=r[e];typeof A=="number"&&(i==null||Ae.x&&n.tope.y}function nI(n){return typeof n=="string"&&n!==""}function $w(n,e,t,i){let o=i.x,r=i.y;if(typeof i.distanceToBorder=="function"){const A=i.distanceToBorder(n,e),I=Math.sin(e)*A,l=Math.cos(e)*A;l===A?(o+=A,r=i.y):I===A?(o=i.x,r-=A):(o+=l,r-=I)}else i.shape.width>i.shape.height?(o=i.x+i.shape.width*.5,r=i.y-t):(o=i.x+t,r=i.y-i.shape.height*.5);return{x:o,y:r}}class jX{constructor(e){this.measureText=e,this.current=0,this.width=0,this.height=0,this.lines=[]}_add(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"normal";this.lines[e]===void 0&&(this.lines[e]={width:0,height:0,blocks:[]});let o=t;(t===void 0||t==="")&&(o=" ");const r=this.measureText(o,i),A=Ut({},qC(r));A.text=t,A.width=r.width,A.mod=i,(t===void 0||t==="")&&(A.width=0),this.lines[e].blocks.push(A),this.lines[e].width+=A.width}curWidth(){const e=this.lines[this.current];return e===void 0?0:e.width}append(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t)}newLine(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t),this.current++}determineLineHeights(){for(let e=0;ee&&(e=o.width),t+=o.height}this.width=e,this.height=t}removeEmptyBlocks(){const e=[];for(let t=0;t"://,""://,""://,"":/<\/b>/,"":/<\/i>/,"":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/};class qw{constructor(e){this.text=e,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}mod(){return this.modStack.length===0?"normal":this.modStack[0]}modName(){if(this.modStack.length===0)return"normal";if(this.modStack[0]==="mono")return"mono";if(this.bold&&this.ital)return"boldital";if(this.bold)return"bold";if(this.ital)return"ital"}emitBlock(){this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}add(e){e===" "&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1),e!=" "&&(this.buffer+=e)}parseWS(e){return/[ \t]/.test(e)?(this.mono?this.add(e):this.spacing=!0,!0):!1}setTag(e){this.emitBlock(),this[e]=!0,this.modStack.unshift(e)}unsetTag(e){this.emitBlock(),this[e]=!1,this.modStack.shift()}parseStartTag(e,t){return!this.mono&&!this[e]&&this.match(t)?(this.setTag(e),!0):!1}match(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const[i,o]=this.prepareRegExp(e),r=i.test(this.text.substr(this.position,o));return r&&t&&(this.position+=o-1),r}parseEndTag(e,t,i){let o=this.mod()===e;return e==="mono"?o=o&&this.mono:o=o&&!this.mono,o&&this.match(t)?(i!==void 0?(this.position===this.text.length-1||this.match(i,!1))&&this.unsetTag(e):this.unsetTag(e),!0):!1}replace(e,t){return this.match(e)?(this.add(t),this.position+=length-1,!0):!1}prepareRegExp(e){let t,i;if(e instanceof RegExp)i=e,t=1;else{const o=ZX[e];o!==void 0?i=o:i=new RegExp(e),t=e.length}return[i,t]}}class BX{constructor(e,t,i,o){this.ctx=e,this.parent=t,this.selected=i,this.hover=o;const r=(A,I)=>{if(A===void 0)return 0;const l=this.parent.getFormattingValues(e,i,o,I);let c=0;return A!==""&&(c=this.ctx.measureText(A).width),{width:c,values:l}};this.lines=new jX(r)}process(e){if(!nI(e))return this.lines.finalize();const t=this.parent.fontOptions;e=e.replace(/\r\n/g,` +`||Ue==="\r";)In()}while(n);if(Ue===""){Zn=On.DELIMITER;return}var t=Ue+Bs();if(k1[t]){Zn=On.DELIMITER,De=t,In(),In();return}if(k1[Ue]){Zn=On.DELIMITER,De=Ue,In();return}if(_1(Ue)||Ue==="-"){for(De+=Ue,In();_1(Ue);)De+=Ue,In();De==="false"?De=!1:De==="true"?De=!0:isNaN(Number(De))||(De=Number(De)),Zn=On.IDENTIFIER;return}if(Ue==='"'){for(In();Ue!=""&&(Ue!='"'||Ue==='"'&&Bs()==='"');)Ue==='"'?(De+=Ue,In()):Ue==="\\"&&Bs()==="n"?(De+=` +`,In()):De+=Ue,In();if(Ue!='"')throw Nn('End of string " expected');In(),Zn=On.IDENTIFIER;return}for(Zn=On.UNKNOWN;Ue!="";)De+=Ue,In();throw new SyntaxError('Syntax error in part "'+G1(De,30)+'"')}function iY(){var n={};if(eY(),bt(),De==="strict"&&(n.strict=!0,bt()),(De==="graph"||De==="digraph")&&(n.type=De,bt()),Zn===On.IDENTIFIER&&(n.id=De,bt()),De!="{")throw Nn("Angle bracket { expected");if(bt(),P1(n),De!="}")throw Nn("Angle bracket } expected");if(bt(),De!=="")throw Nn("End of file expected");return bt(),delete n.node,delete n.edge,delete n.graph,n}function P1(n){for(;De!==""&&De!="}";)gY(n),De===";"&&bt()}function gY(n){var e=B1(n);if(e){L1(n,e);return}var t=oY(n);if(!t){if(Zn!=On.IDENTIFIER)throw Nn("Identifier expected");var i=De;if(bt(),De==="="){if(bt(),Zn!=On.IDENTIFIER)throw Nn("Identifier expected");n[i]=De,bt()}else sY(n,i)}}function B1(n){var e=null;if(De==="subgraph"&&(e={},e.type="subgraph",bt(),Zn===On.IDENTIFIER&&(e.id=De,bt())),De==="{"){if(bt(),e||(e={}),e.parent=n,e.node=n.node,e.edge=n.edge,e.graph=n.graph,P1(e),De!="}")throw Nn("Angle bracket } expected");bt(),delete e.node,delete e.edge,delete e.graph,delete e.parent,n.subgraphs||(n.subgraphs=[]),n.subgraphs.push(e)}return e}function oY(n){return De==="node"?(bt(),n.node=Ra(),"node"):De==="edge"?(bt(),n.edge=Ra(),"edge"):De==="graph"?(bt(),n.graph=Ra(),"graph"):null}function sY(n,e){var t={id:e},i=Ra();i&&(t.attr=i),j1(n,t),L1(n,e)}function L1(n,e){for(;De==="->"||De==="--";){var t,i=De;bt();var o=B1(n);if(o)t=o;else{if(Zn!=On.IDENTIFIER)throw Nn("Identifier or subgraph expected");t=De,j1(n,{id:t}),bt()}var r=Ra(),A=Z1(n,e,t,i,r);nY(n,A),e=t}}function Ra(){for(var n,e=null,t={dashed:!0,solid:!1,dotted:[1,5]},i={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},o=new Array,r=new Array;De==="[";){for(bt(),e={};De!==""&&De!="]";){if(Zn!=On.IDENTIFIER)throw Nn("Attribute name expected");var A=De;if(bt(),De!="=")throw Nn("Equal sign = expected");if(bt(),Zn!=On.IDENTIFIER)throw Nn("Attribute value expected");var I=De;A==="style"&&(I=t[I]);var l;A==="arrowhead"&&(l=i[I],A="arrows",I={to:{enabled:!0,type:l}}),A==="arrowtail"&&(l=i[I],A="arrows",I={from:{enabled:!0,type:l}}),o.push({attr:e,name:A,value:I}),r.push(A),bt(),De==","&&bt()}if(De!="]")throw Nn("Bracket ] expected");bt()}if(Dg(r).call(r,"dir")){var c={};for(c.arrows={},n=0;n"&&(I.arrows="to"),I};tt(o=e.edges).call(o,function(A){var I,l;if(A.from instanceof Object?I=A.from.nodes:I={id:A.from},A.to instanceof Object?l=A.to.nodes:l={id:A.to},A.from instanceof Object&&A.from.edges){var c;tt(c=A.from.edges).call(c,function(p){var m=r(p);t.edges.push(m)})}if(rY(I,l,function(p,m){var b=Z1(t,p.id,m.id,A.type,A.attr),w=r(b);t.edges.push(w)}),A.to instanceof Object&&A.to.edges){var h;tt(h=A.to.edges).call(h,function(p){var m=r(p);t.edges.push(m)})}})}return e.attr&&(t.options=e.attr),t}function AY(n,e){var t;const i={edges:{inheritColor:!1},nodes:{fixed:!1,parseColor:!1}};e!=null&&(e.fixed!=null&&(i.nodes.fixed=e.fixed),e.parseColor!=null&&(i.nodes.parseColor=e.parseColor),e.inheritColor!=null&&(i.edges.inheritColor=e.inheritColor));const o=n.edges,r=un(o).call(o,I=>{const l={from:I.source,id:I.id,to:I.target};return I.attributes!=null&&(l.attributes=I.attributes),I.label!=null&&(l.label=I.label),I.attributes!=null&&I.attributes.title!=null&&(l.title=I.attributes.title),I.type==="Directed"&&(l.arrows="to"),I.color&&i.edges.inheritColor===!1&&(l.color=I.color),l});return{nodes:un(t=n.nodes).call(t,I=>{const l={id:I.id,fixed:i.nodes.fixed&&I.x!=null&&I.y!=null};return I.attributes!=null&&(l.attributes=I.attributes),I.label!=null&&(l.label=I.label),I.size!=null&&(l.size=I.size),I.attributes!=null&&I.attributes.title!=null&&(l.title=I.attributes.title),I.title!=null&&(l.title=I.title),I.x!=null&&(l.x=I.x),I.y!=null&&(l.y=I.y),I.color!=null&&(i.nodes.parseColor===!0?l.color=I.color:l.color={background:I.color,border:I.color,highlight:{background:I.color,border:I.color},hover:{background:I.color,border:I.color}}),l}),edges:r}}var CY=Object.freeze({__proto__:null,cn:{addDescription:"单击空白处放置新节点。",addEdge:"添加连接线",addNode:"添加节点",back:"返回",close:"關閉",createEdgeError:"无法将连接线连接到群集。",del:"删除选定",deleteClusterError:"无法删除群集。",edgeDescription:"单击某个节点并将该连接线拖动到另一个节点以连接它们。",edit:"编辑",editClusterError:"无法编辑群集。",editEdge:"编辑连接线",editEdgeDescription:"单击控制节点并将它们拖到节点上连接。",editNode:"编辑节点"},cs:{addDescription:"Kluknutím do prázdného prostoru můžete přidat nový vrchol.",addEdge:"Přidat hranu",addNode:"Přidat vrchol",back:"Zpět",close:"Zavřít",createEdgeError:"Nelze připojit hranu ke shluku.",del:"Smazat výběr",deleteClusterError:"Nelze mazat shluky.",edgeDescription:"Přetažením z jednoho vrcholu do druhého můžete spojit tyto vrcholy novou hranou.",edit:"Upravit",editClusterError:"Nelze upravovat shluky.",editEdge:"Upravit hranu",editEdgeDescription:"Přetažením kontrolního vrcholu hrany ji můžete připojit k jinému vrcholu.",editNode:"Upravit vrchol"},de:{addDescription:"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",addEdge:"Kante hinzufügen",addNode:"Knoten hinzufügen",back:"Zurück",close:"Schließen",createEdgeError:"Es ist nicht möglich, Kanten mit Clustern zu verbinden.",del:"Lösche Auswahl",deleteClusterError:"Cluster können nicht gelöscht werden.",edgeDescription:"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",edit:"Editieren",editClusterError:"Cluster können nicht editiert werden.",editEdge:"Kante editieren",editEdgeDescription:"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",editNode:"Knoten editieren"},en:{addDescription:"Click in an empty space to place a new node.",addEdge:"Add Edge",addNode:"Add Node",back:"Back",close:"Close",createEdgeError:"Cannot link edges to a cluster.",del:"Delete selected",deleteClusterError:"Clusters cannot be deleted.",edgeDescription:"Click on a node and drag the edge to another node to connect them.",edit:"Edit",editClusterError:"Clusters cannot be edited.",editEdge:"Edit Edge",editEdgeDescription:"Click on the control points and drag them to a node to connect to it.",editNode:"Edit Node"},es:{addDescription:"Haga clic en un lugar vacío para colocar un nuevo nodo.",addEdge:"Añadir arista",addNode:"Añadir nodo",back:"Atrás",close:"Cerrar",createEdgeError:"No se puede conectar una arista a un grupo.",del:"Eliminar selección",deleteClusterError:"No es posible eliminar grupos.",edgeDescription:"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",edit:"Editar",editClusterError:"No es posible editar grupos.",editEdge:"Editar arista",editEdgeDescription:"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",editNode:"Editar nodo"},fr:{addDescription:"Cliquez dans un endroit vide pour placer un nœud.",addEdge:"Ajouter un lien",addNode:"Ajouter un nœud",back:"Retour",close:"Fermer",createEdgeError:"Impossible de créer un lien vers un cluster.",del:"Effacer la sélection",deleteClusterError:"Les clusters ne peuvent pas être effacés.",edgeDescription:"Cliquez sur un nœud et glissez le lien vers un autre nœud pour les connecter.",edit:"Éditer",editClusterError:"Les clusters ne peuvent pas être édités.",editEdge:"Éditer le lien",editEdgeDescription:"Cliquez sur les points de contrôle et glissez-les pour connecter un nœud.",editNode:"Éditer le nœud"},it:{addDescription:"Clicca per aggiungere un nuovo nodo",addEdge:"Aggiungi un vertice",addNode:"Aggiungi un nodo",back:"Indietro",close:"Chiudere",createEdgeError:"Non si possono collegare vertici ad un cluster",del:"Cancella la selezione",deleteClusterError:"I cluster non possono essere cancellati",edgeDescription:"Clicca su un nodo e trascinalo ad un altro nodo per connetterli.",edit:"Modifica",editClusterError:"I clusters non possono essere modificati.",editEdge:"Modifica il vertice",editEdgeDescription:"Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.",editNode:"Modifica il nodo"},nl:{addDescription:"Klik op een leeg gebied om een nieuwe node te maken.",addEdge:"Link toevoegen",addNode:"Node toevoegen",back:"Terug",close:"Sluiten",createEdgeError:"Kan geen link maken naar een cluster.",del:"Selectie verwijderen",deleteClusterError:"Clusters kunnen niet worden verwijderd.",edgeDescription:"Klik op een node en sleep de link naar een andere node om ze te verbinden.",edit:"Wijzigen",editClusterError:"Clusters kunnen niet worden aangepast.",editEdge:"Link wijzigen",editEdgeDescription:"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",editNode:"Node wijzigen"},pt:{addDescription:"Clique em um espaço em branco para adicionar um novo nó",addEdge:"Adicionar aresta",addNode:"Adicionar nó",back:"Voltar",close:"Fechar",createEdgeError:"Não foi possível linkar arestas a um cluster.",del:"Remover selecionado",deleteClusterError:"Clusters não puderam ser removidos.",edgeDescription:"Clique em um nó e arraste a aresta até outro nó para conectá-los",edit:"Editar",editClusterError:"Clusters não puderam ser editados.",editEdge:"Editar aresta",editEdgeDescription:"Clique nos pontos de controle e os arraste para um nó para conectá-los",editNode:"Editar nó"},ru:{addDescription:"Кликните в свободное место, чтобы добавить новый узел.",addEdge:"Добавить ребро",addNode:"Добавить узел",back:"Назад",close:"Закрывать",createEdgeError:"Невозможно соединить ребра в кластер.",del:"Удалить выбранное",deleteClusterError:"Кластеры не могут быть удалены",edgeDescription:"Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.",edit:"Редактировать",editClusterError:"Кластеры недоступны для редактирования.",editEdge:"Редактировать ребро",editEdgeDescription:"Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.",editNode:"Редактировать узел"},uk:{addDescription:"Kлікніть на вільне місце, щоб додати новий вузол.",addEdge:"Додати край",addNode:"Додати вузол",back:"Назад",close:"Закрити",createEdgeError:"Не можливо об'єднати краї в групу.",del:"Видалити обране",deleteClusterError:"Групи не можуть бути видалені.",edgeDescription:"Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.",edit:"Редагувати",editClusterError:"Групи недоступні для редагування.",editEdge:"Редагувати край",editEdgeDescription:"Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.",editNode:"Редагувати вузол"}});function IY(n,e){try{const[i,o]=e.split(/[-_ /]/,2),r=i!=null?i.toLowerCase():null,A=o!=null?o.toUpperCase():null;if(r&&A){const I=r+"-"+A;if(Object.prototype.hasOwnProperty.call(n,I))return I;var t;console.warn(b0(t="Unknown variant ".concat(A," of language ")).call(t,r,"."))}if(r){const I=r;if(Object.prototype.hasOwnProperty.call(n,I))return I;console.warn("Unknown language ".concat(r))}return console.warn("Unknown locale ".concat(e,", falling back to English.")),"en"}catch(i){return console.error(i),console.warn("Unexpected error while normalizing locale ".concat(e,", falling back to English.")),"en"}}class lY{constructor(){this.NUM_ITERATIONS=4,this.image=new Image,this.canvas=document.createElement("canvas")}init(){if(this.initialized())return;this.src=this.image.src;const e=this.image.width,t=this.image.height;this.width=e,this.height=t;const i=Math.floor(t/2),o=Math.floor(t/4),r=Math.floor(t/8),A=Math.floor(t/16),I=Math.floor(e/2),l=Math.floor(e/4),c=Math.floor(e/8),h=Math.floor(e/16);this.canvas.width=3*l,this.canvas.height=i,this.coordinates=[[0,0,I,i],[I,0,l,o],[I,o,c,r],[5*c,o,h,A]],this._fillMipMap()}initialized(){return this.coordinates!==void 0}_fillMipMap(){const e=this.canvas.getContext("2d"),t=this.coordinates[0];e.drawImage(this.image,t[0],t[1],t[2],t[3]);for(let i=1;i2){t*=.5;let I=0;for(;t>2&&I=this.NUM_ITERATIONS&&(I=this.NUM_ITERATIONS-1);const l=this.coordinates[I];e.drawImage(this.canvas,l[0],l[1],l[2],l[3],i,o,r,A)}else e.drawImage(this.image,i,o,r,A)}}class cY{constructor(e){this.images={},this.imageBroken={},this.callback=e}_tryloadBrokenUrl(e,t,i){if(!(e===void 0||i===void 0)){if(t===void 0){console.warn("No broken url image defined");return}i.image.onerror=()=>{console.error("Could not load brokenImage:",t)},i.image.src=t}}_redrawWithImage(e){this.callback&&this.callback(e)}load(e,t){const i=this.images[e];if(i)return i;const o=new lY;return this.images[e]=o,o.image.onload=()=>{this._fixImageCoordinates(o.image),o.init(),this._redrawWithImage(o)},o.image.onerror=()=>{console.error("Could not load image:",e),this._tryloadBrokenUrl(e,t,o)},o.image.src=e,o}_fixImageCoordinates(e){e.width===0&&(document.body.appendChild(e),e.width=e.offsetWidth,e.height=e.offsetHeight,document.body.removeChild(e))}}var V1={exports:{}},dY=ot,uY=dY(function(){if(typeof ArrayBuffer=="function"){var n=new ArrayBuffer(8);Object.isExtensible(n)&&Object.defineProperty(n,"a",{value:8})}}),hY=ot,fY=xn,pY=Qi,U1=uY,WC=Object.isExtensible,mY=hY(function(){WC(1)}),vY=mY||U1?function(e){return!fY(e)||U1&&pY(e)==="ArrayBuffer"?!1:WC?WC(e):!0}:WC,bY=ot,Y1=!bY(function(){return Object.isExtensible(Object.preventExtensions({}))}),yY=ze,wY=st,xY=ea,EY=xn,ou=rn,SY=Hn.f,H1=ra,TY=mC,su=vY,OY=rC,NY=Y1,K1=!1,ig=OY("meta"),DY=0,ru=function(n){SY(n,ig,{value:{objectID:"O"+DY++,weakData:{}}})},MY=function(n,e){if(!EY(n))return typeof n=="symbol"?n:(typeof n=="string"?"S":"P")+n;if(!ou(n,ig)){if(!su(n))return"F";if(!e)return"E";ru(n)}return n[ig].objectID},RY=function(n,e){if(!ou(n,ig)){if(!su(n))return!0;if(!e)return!1;ru(n)}return n[ig].weakData},zY=function(n){return NY&&K1&&su(n)&&!ou(n,ig)&&ru(n),n},kY=function(){_Y.enable=function(){},K1=!0;var n=H1.f,e=wY([].splice),t={};t[ig]=1,n(t).length&&(H1.f=function(i){for(var o=n(i),r=0,A=o.length;rp;p++)if(b=S(n[p]),b&&q1(ew,b))return b;return new XC(!1)}c=rH(n,h)}for(w=r?n.next:c.next;!(O=nH(w,c)).done;){try{b=S(O.value)}catch(E){J1(c,"throw",E)}if(typeof b=="object"&&b&&q1(ew,b))return b}return new XC(!1)},CH=Zt,IH=TypeError,Au=function(n,e){if(CH(e,n))return n;throw new IH("Incorrect invocation")},lH=ze,cH=jt,dH=QC,uH=ot,hH=ps,fH=au,pH=Au,mH=dn,vH=xn,bH=ds,yH=ys,wH=Hn.f,xH=Og.forEach,EH=sn,tw=wo,SH=tw.set,TH=tw.getterFor,Cu=function(n,e,t){var i=n.indexOf("Map")!==-1,o=n.indexOf("Weak")!==-1,r=i?"set":"add",A=cH[n],I=A&&A.prototype,l={},c;if(!EH||!mH(A)||!(o||I.forEach&&!uH(function(){new A().entries().next()})))c=t.getConstructor(e,n,i,r),dH.enable();else{c=e(function(m,b){SH(pH(m,h),{type:n,collection:new A}),bH(b)||fH(b,m[r],{that:m,AS_ENTRIES:i})});var h=c.prototype,p=TH(n);xH(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(m){var b=m==="add"||m==="set";m in I&&!(o&&m==="clear")&&hH(h,m,function(w,O){var x=p(this).collection;if(!b&&o&&!vH(w))return m==="get"?void 0:!1;var S=x[m](w===0?0:w,O);return b?this:S})}),o||wH(h,"size",{configurable:!0,get:function(){return p(this).collection.size}})}return yH(c,n,!1,!0),l[n]=c,lH({global:!0,forced:!0},l),o||t.setStrong(c,n,i),c},OH=aa,Iu=function(n,e,t){for(var i in e)t&&t.unsafe&&n[i]?n[i]=e[i]:OH(n,i,e[i],t);return n},NH=bi,DH=qc,MH=Ut,RH=sn,nw=MH("species"),zH=function(n){var e=NH(n);RH&&e&&!e[nw]&&DH(e,nw,{configurable:!0,get:function(){return this}})},kH=sa,_H=qc,iw=Iu,jH=qr,ZH=Au,PH=ds,BH=au,LH=md,$C=vd,GH=zH,za=sn,gw=QC.fastKey,ow=wo,sw=ow.set,lu=ow.getterFor,rw={getConstructor:function(n,e,t,i){var o=n(function(c,h){ZH(c,r),sw(c,{type:e,index:kH(null),first:void 0,last:void 0,size:0}),za||(c.size=0),PH(h)||BH(h,c[i],{that:c,AS_ENTRIES:t})}),r=o.prototype,A=lu(e),I=function(c,h,p){var m=A(c),b=l(c,h),w,O;return b?b.value=p:(m.last=b={index:O=gw(h,!0),key:h,value:p,previous:w=m.last,next:void 0,removed:!1},m.first||(m.first=b),w&&(w.next=b),za?m.size++:c.size++,O!=="F"&&(m.index[O]=b)),c},l=function(c,h){var p=A(c),m=gw(h),b;if(m!=="F")return p.index[m];for(b=p.first;b;b=b.next)if(b.key===h)return b};return iw(r,{clear:function(){for(var h=this,p=A(h),m=p.index,b=p.first;b;)b.removed=!0,b.previous&&(b.previous=b.previous.next=void 0),delete m[b.index],b=b.next;p.first=p.last=void 0,za?p.size=0:h.size=0},delete:function(c){var h=this,p=A(h),m=l(h,c);if(m){var b=m.next,w=m.previous;delete p.index[m.index],m.removed=!0,w&&(w.next=b),b&&(b.previous=w),p.first===m&&(p.first=b),p.last===m&&(p.last=w),za?p.size--:h.size--}return!!m},forEach:function(h){for(var p=A(this),m=jH(h,arguments.length>1?arguments[1]:void 0),b;b=b?b.next:p.first;)for(m(b.value,b.key,this);b&&b.removed;)b=b.previous},has:function(h){return!!l(this,h)}}),iw(r,t?{get:function(h){var p=l(this,h);return p&&p.value},set:function(h,p){return I(this,h===0?0:h,p)}}:{add:function(h){return I(this,h=h===0?0:h,h)}}),za&&_H(r,"size",{configurable:!0,get:function(){return A(this).size}}),o},setStrong:function(n,e,t){var i=e+" Iterator",o=lu(e),r=lu(i);LH(n,e,function(A,I){sw(this,{type:i,target:A,state:o(A),kind:I,last:void 0})},function(){for(var A=r(this),I=A.kind,l=A.last;l&&l.removed;)l=l.previous;return!A.target||!(A.last=l=l?l.next:A.state.first)?(A.target=void 0,$C(void 0,!0)):$C(I==="keys"?l.key:I==="values"?l.value:[l.key,l.value],!1)},t?"entries":"values",!t,!0),GH(e)}},FH=Cu,VH=rw;FH("Map",function(n){return function(){return n(this,arguments.length?arguments[0]:void 0)}},VH);var cu=st,UH=IC,YH=Ri,HH=Hr,KH=cu("".charAt),aw=cu("".charCodeAt),WH=cu("".slice),QH=function(n){return function(e,t){var i=YH(HH(e)),o=UH(t),r=i.length,A,I;return o<0||o>=r?n?"":void 0:(A=aw(i,o),A<55296||A>56319||o+1===r||(I=aw(i,o+1))<56320||I>57343?n?KH(i,o):A:n?WH(i,o,o+2):(A-55296<<10)+(I-56320)+65536)}},XH={charAt:QH(!0)},$H=XH.charAt,qH=Ri,Aw=wo,JH=md,Cw=vd,Iw="String Iterator",e7=Aw.set,t7=Aw.getterFor(Iw);JH(String,"String",function(n){e7(this,{type:Iw,string:qH(n),index:0})},function(){var e=t7(this),t=e.string,i=e.index,o;return i>=t.length?Cw(void 0,!0):(o=$H(t,i),e.index+=o.length,Cw(o,!1))});var n7=At,i7=n7.Map,g7=i7,o7=g7,s7=o7,ka=Ne(s7);class r7{constructor(){this.clear(),this._defaultIndex=0,this._groupIndex=0,this._defaultGroups=[{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},{border:"#FFA500",background:"#FFFF00",highlight:{border:"#FFA500",background:"#FFFFA3"},hover:{border:"#FFA500",background:"#FFFFA3"}},{border:"#FA0A10",background:"#FB7E81",highlight:{border:"#FA0A10",background:"#FFAFB1"},hover:{border:"#FA0A10",background:"#FFAFB1"}},{border:"#41A906",background:"#7BE141",highlight:{border:"#41A906",background:"#A1EC76"},hover:{border:"#41A906",background:"#A1EC76"}},{border:"#E129F0",background:"#EB7DF4",highlight:{border:"#E129F0",background:"#F0B3F5"},hover:{border:"#E129F0",background:"#F0B3F5"}},{border:"#7C29F0",background:"#AD85E4",highlight:{border:"#7C29F0",background:"#D3BDF0"},hover:{border:"#7C29F0",background:"#D3BDF0"}},{border:"#C37F00",background:"#FFA807",highlight:{border:"#C37F00",background:"#FFCA66"},hover:{border:"#C37F00",background:"#FFCA66"}},{border:"#4220FB",background:"#6E6EFD",highlight:{border:"#4220FB",background:"#9B9BFD"},hover:{border:"#4220FB",background:"#9B9BFD"}},{border:"#FD5A77",background:"#FFC0CB",highlight:{border:"#FD5A77",background:"#FFD1D9"},hover:{border:"#FD5A77",background:"#FFD1D9"}},{border:"#4AD63A",background:"#C2FABC",highlight:{border:"#4AD63A",background:"#E6FFE3"},hover:{border:"#4AD63A",background:"#E6FFE3"}},{border:"#990000",background:"#EE0000",highlight:{border:"#BB0000",background:"#FF3333"},hover:{border:"#BB0000",background:"#FF3333"}},{border:"#FF6000",background:"#FF6000",highlight:{border:"#FF6000",background:"#FF6000"},hover:{border:"#FF6000",background:"#FF6000"}},{border:"#97C2FC",background:"#2B7CE9",highlight:{border:"#D2E5FF",background:"#2B7CE9"},hover:{border:"#D2E5FF",background:"#2B7CE9"}},{border:"#399605",background:"#255C03",highlight:{border:"#399605",background:"#255C03"},hover:{border:"#399605",background:"#255C03"}},{border:"#B70054",background:"#FF007E",highlight:{border:"#B70054",background:"#FF007E"},hover:{border:"#B70054",background:"#FF007E"}},{border:"#AD85E4",background:"#7C29F0",highlight:{border:"#D3BDF0",background:"#7C29F0"},hover:{border:"#D3BDF0",background:"#7C29F0"}},{border:"#4557FA",background:"#000EA1",highlight:{border:"#6E6EFD",background:"#000EA1"},hover:{border:"#6E6EFD",background:"#000EA1"}},{border:"#FFC0CB",background:"#FD5A77",highlight:{border:"#FFD1D9",background:"#FD5A77"},hover:{border:"#FFD1D9",background:"#FD5A77"}},{border:"#C2FABC",background:"#74D66A",highlight:{border:"#E6FFE3",background:"#74D66A"},hover:{border:"#E6FFE3",background:"#74D66A"}},{border:"#EE0000",background:"#990000",highlight:{border:"#FF3333",background:"#BB0000"},hover:{border:"#FF3333",background:"#BB0000"}}],this.options={},this.defaultOptions={useDefaultGroups:!0},Yt(this.options,this.defaultOptions)}setOptions(e){const t=["useDefaultGroups"];if(e!==void 0){for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&It(t).call(t,i)===-1){const o=e[i];this.add(i,o)}}}clear(){this._groups=new ka,this._groupNames=[]}get(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=this._groups.get(e);if(i===void 0&&t)if(this.options.useDefaultGroups===!1&&this._groupNames.length>0){const o=this._groupIndex%this._groupNames.length;++this._groupIndex,i={},i.color=this._groups.get(this._groupNames[o]),this._groups.set(e,i)}else{const o=this._defaultIndex%this._defaultGroups.length;this._defaultIndex++,i={},i.color=this._defaultGroups[o],this._groups.set(e,i)}return i}add(e,t){return this._groups.has(e)||this._groupNames.push(e),this._groups.set(e,t),t}}var a7=ze;a7({target:"Number",stat:!0},{isNaN:function(e){return e!==e}});var A7=At,C7=A7.Number.isNaN,I7=C7,l7=I7,c7=l7,du=Ne(c7),d7=jt,u7=d7.isFinite,h7=Number.isFinite||function(e){return typeof e=="number"&&u7(e)},f7=ze,p7=h7;f7({target:"Number",stat:!0},{isFinite:p7});var m7=At,v7=m7.Number.isFinite,b7=v7,y7=b7,w7=y7,jo=Ne(w7),x7=ze,E7=Og.some,S7=Ts,T7=S7("some");x7({target:"Array",proto:!0,forced:!T7},{some:function(e){return E7(this,e,arguments.length>1?arguments[1]:void 0)}});var O7=Xt,N7=O7("Array").some,D7=Zt,M7=N7,uu=Array.prototype,R7=function(n){var e=n.some;return n===uu||D7(uu,n)&&e===uu.some?M7:e},z7=R7,k7=z7,_7=k7,lw=Ne(_7),j7=At,Z7=j7.Object.getOwnPropertySymbols,P7=Z7,B7=P7,L7=B7,Bi=Ne(L7),cw={exports:{}},G7=ze,F7=ot,V7=vi,dw=Vr.f,uw=sn,U7=!uw||F7(function(){dw(1)});G7({target:"Object",stat:!0,forced:U7,sham:!uw},{getOwnPropertyDescriptor:function(e,t){return dw(V7(e),t)}});var Y7=At,hw=Y7.Object,H7=cw.exports=function(e,t){return hw.getOwnPropertyDescriptor(e,t)};hw.getOwnPropertyDescriptor.sham&&(H7.sham=!0);var K7=cw.exports,W7=K7,Q7=W7,X7=Q7,Li=Ne(X7),$7=ze,q7=sn,J7=C0,eK=vi,tK=Vr,nK=ia;$7({target:"Object",stat:!0,sham:!q7},{getOwnPropertyDescriptors:function(e){for(var t=eK(e),i=tK.f,o=J7(t),r={},A=0,I,l;o.length>A;)l=i(t,I=o[A++]),l!==void 0&&nK(r,I,l);return r}});var iK=At,gK=iK.Object.getOwnPropertyDescriptors,oK=gK,sK=oK,rK=sK,Gi=Ne(rK),fw={exports:{}},aK=ze,AK=sn,pw=uC.f;aK({target:"Object",stat:!0,forced:Object.defineProperties!==pw,sham:!AK},{defineProperties:pw});var CK=At,mw=CK.Object,IK=fw.exports=function(e,t){return mw.defineProperties(e,t)};mw.defineProperties.sham&&(IK.sham=!0);var lK=fw.exports,cK=lK,dK=cK,uK=dK,_a=Ne(uK),vw={exports:{}},hK=ze,fK=sn,bw=Hn.f;hK({target:"Object",stat:!0,forced:Object.defineProperty!==bw,sham:!fK},{defineProperty:bw});var pK=At,yw=pK.Object,mK=vw.exports=function(e,t,i){return yw.defineProperty(e,t,i)};yw.defineProperty.sham&&(mK.sham=!0);var vK=vw.exports,bK=vK,ww=bK,yK=ww,wK=yK,xK=wK,EK=xK,SK=EK,TK=Ne(SK),OK=Ut,NK=Hn.f,xw=OK("metadata"),Ew=Function.prototype;Ew[xw]===void 0&&NK(Ew,xw,{value:null});var DK=Pt;DK("asyncDispose");var MK=Pt;MK("dispose");var RK=Pt;RK("metadata");var zK=r0,kK=zK,_K=bi,jK=st,hu=_K("Symbol"),ZK=hu.keyFor,PK=jK(hu.prototype.valueOf),Sw=hu.isRegisteredSymbol||function(e){try{return ZK(PK(e))!==void 0}catch{return!1}},BK=ze,LK=Sw;BK({target:"Symbol",stat:!0},{isRegisteredSymbol:LK});for(var GK=hs,Tw=bi,FK=st,VK=Qr,UK=Ut,qC=Tw("Symbol"),Ow=qC.isWellKnownSymbol,Nw=Tw("Object","getOwnPropertyNames"),YK=FK(qC.prototype.valueOf),Dw=GK("wks"),fu=0,Mw=Nw(qC),HK=Mw.length;fu=0:I>l;l+=c)l in A&&(o=t(o,A[l],l,r));return o}},kW={left:zW(!1)},_W=jt,jW=Qi,ZW=jW(_W.process)==="process",PW=ze,BW=kW.left,LW=Ts,_w=Wr,GW=ZW,FW=!GW&&_w>79&&_w<83,VW=FW||!LW("reduce");PW({target:"Array",proto:!0,forced:VW},{reduce:function(e){var t=arguments.length;return BW(this,e,t,t>1?arguments[1]:void 0)}});var UW=Xt,YW=UW("Array").reduce,HW=Zt,KW=YW,pu=Array.prototype,WW=function(n){var e=n.reduce;return n===pu||HW(pu,n)&&e===pu.reduce?KW:e},QW=WW,XW=QW,$W=XW,mu=Ne($W),qW=Tg,JW=ii,eQ=Yc,tQ=qr,jw=function(n,e,t,i,o,r,A,I){for(var l=o,c=0,h=A?tQ(A,I):!1,p,m;c0&&qW(p)?(m=JW(p),l=jw(n,e,p,m,l,r-1)-1):(eQ(l+1),n[l]=p),l++),c++;return l},nQ=jw,iQ=ze,gQ=nQ,oQ=bo,sQ=Yn,rQ=ii,aQ=dC;iQ({target:"Array",proto:!0},{flatMap:function(e){var t=sQ(this),i=rQ(t),o;return oQ(e),o=aQ(t,0),o.length=gQ(o,t,t,i,0,1,e,arguments.length>1?arguments[1]:void 0),o}});var AQ=Xt;AQ("Array").flatMap;var CQ=kw,Ls=Ne(CQ),IQ=Cu,lQ=rw;IQ("Set",function(n){return function(){return n(this,arguments.length?arguments[0]:void 0)}},lQ);var cQ=At,dQ=cQ.Set,uQ=dQ,hQ=uQ,fQ=hQ,Ti=Ne(fQ),pQ=X1,mQ=pQ,vQ=mQ,bQ=vQ,yQ=bQ,wQ=yQ,xQ=wQ,EQ=xQ,SQ=EQ,TQ=SQ,vu=Ne(TQ),Zw=$b,OQ=Math.floor,bu=function(n,e){var t=n.length,i=OQ(t/2);return t<8?NQ(n,e):DQ(n,bu(Zw(n,0,i),e),bu(Zw(n,i),e),e)},NQ=function(n,e){for(var t=n.length,i=1,o,r;i0;)n[r]=n[--r];r!==i++&&(n[r]=o)}return n},DQ=function(n,e,t,i){for(var o=e.length,r=t.length,A=0,I=0;A3)){if(UQ)return!0;if(Yw)return Yw<603;var n="",e,t,i,o;for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:i=3;break;case 68:case 71:i=4;break;default:i=2}for(o=0;o<47;o++)Pg.push({k:t+o,v:i})}for(Pg.sort(function(r,A){return A.v-r.v}),o=0;oFw(t)?1:-1}};PQ({target:"Array",proto:!0,forced:QQ},{sort:function(e){e!==void 0&&BQ(e);var t=LQ(this);if(Kw)return e===void 0?Hw(t):Hw(t,e);var i=[],o=Gw(t),r,A;for(A=0;A{i.flush()};const o=[{name:"flush",original:void 0}];if(t&&t.replace)for(let r=0;rthis.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay=="number"&&(this._timeout=_i(()=>{this.flush()},this.delay))}flush(){var e,t;tt(e=ki(t=this._queue).call(t,0)).call(e,i=>{i.fn.apply(i.context||i.fn,i.args||[])})}}class nI{constructor(){Jt(this,"_subscribers",{"*":[],add:[],remove:[],update:[]}),Jt(this,"subscribe",nI.prototype.on),Jt(this,"unsubscribe",nI.prototype.off)}_trigger(e,t,i){var o;if(e==="*")throw new Error("Cannot trigger event *");tt(o=[...this._subscribers[e],...this._subscribers["*"]]).call(o,r=>{r(e,t,i??null)})}on(e,t){typeof t=="function"&&this._subscribers[e].push(t)}off(e,t){var i;this._subscribers[e]=$t(i=this._subscribers[e]).call(i,o=>o!==t)}}class Zo{constructor(e){Jt(this,"_pairs",void 0),this._pairs=e}*[Ls](){for(const[e,t]of this._pairs)yield[e,t]}*entries(){for(const[e,t]of this._pairs)yield[e,t]}*keys(){for(const[e]of this._pairs)yield e}*values(){for(const[,e]of this._pairs)yield e}toIdArray(){var e;return un(e=[...this._pairs]).call(e,t=>t[0])}toItemArray(){var e;return un(e=[...this._pairs]).call(e,t=>t[1])}toEntryArray(){return[...this._pairs]}toObjectMap(){const e=Mg(null);for(const[t,i]of this._pairs)e[t]=i;return e}toMap(){return new ka(this._pairs)}toIdSet(){return new Ti(this.toIdArray())}toItemSet(){return new Ti(this.toItemArray())}cache(){return new Zo([...this._pairs])}distinct(e){const t=new Ti;for(const[i,o]of this._pairs)t.add(e(o,i));return t}filter(e){const t=this._pairs;return new Zo({*[Ls](){for(const[i,o]of t)e(o,i)&&(yield[i,o])}})}forEach(e){for(const[t,i]of this._pairs)e(i,t)}map(e){const t=this._pairs;return new Zo({*[Ls](){for(const[i,o]of t)yield[i,e(o,i)]}})}max(e){const t=vu(this._pairs);let i=t.next();if(i.done)return null;let o=i.value[1],r=e(i.value[1],i.value[0]);for(;!(i=t.next()).done;){const[A,I]=i.value,l=e(I,A);l>r&&(r=l,o=I)}return o}min(e){const t=vu(this._pairs);let i=t.next();if(i.done)return null;let o=i.value[1],r=e(i.value[1],i.value[0]);for(;!(i=t.next()).done;){const[A,I]=i.value,l=e(I,A);l{var t;return vu(gg(t=[...this._pairs]).call(t,(i,o)=>{let[r,A]=i,[I,l]=o;return e(A,l,r,I)}))}})}}function VX(n,e){return n[e]==null&&(n[e]=Fs()),n}class Vs extends nI{get idProp(){return this._idProp}constructor(e,t){super(),Jt(this,"flush",void 0),Jt(this,"length",void 0),Jt(this,"_options",void 0),Jt(this,"_data",void 0),Jt(this,"_idProp",void 0),Jt(this,"_queue",null),e&&!nt(e)&&(t=e,e=[]),this._options=t||{},this._data=new ka,this.length=0,this._idProp=this._options.fieldId||"id",e&&e.length&&this.add(e),this.setOptions(t)}setOptions(e){e&&e.queue!==void 0&&(e.queue===!1?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=Tu.extend(this,{replace:["add","update","remove"]})),e.queue&&typeof e.queue=="object"&&this._queue.setOptions(e.queue)))}add(e,t){const i=[];let o;if(nt(e)){const r=un(e).call(e,A=>A[this._idProp]);if(lw(r).call(r,A=>this._data.has(A)))throw new Error("A duplicate id was found in the parameter array.");for(let A=0,I=e.length;A{const h=c[I];if(h!=null&&this._data.has(h)){const p=c,m=Yt({},this._data.get(h)),b=this._updateItem(p);o.push(b),A.push(p),r.push(m)}else{const p=this._addItem(c);i.push(p)}};if(nt(e))for(let c=0,h=e.length;c{const A=this._data.get(r[this._idProp]);if(A==null)throw new Error("Updating non-existent items is not allowed.");return{oldData:A,update:r}})).call(i,r=>{let{oldData:A,update:I}=r;const l=A[this._idProp],c=OU(A,I);return this._data.set(l,c),{id:l,oldData:A,updatedData:c}});if(o.length){const r={items:un(o).call(o,A=>A.id),oldData:un(o).call(o,A=>A.oldData),data:un(o).call(o,A=>A.updatedData)};return this._trigger("update",r,t),r.items}else return[]}get(e,t){let i,o,r;$w(e)?(i=e,r=t):nt(e)?(o=e,r=t):r=e;const A=r&&r.returnType==="Object"?"Object":"Array",I=r&&$t(r),l=[];let c,h,p;if(i!=null)c=this._data.get(i),c&&I&&!I(c)&&(c=void 0);else if(o!=null)for(let w=0,O=o.length;w(o[r]=e[r],o),{})}_sort(e,t){if(typeof t=="string"){const i=t;gg(e).call(e,(o,r)=>{const A=o[i],I=r[i];return A>I?1:Ai)&&(t=r,i=A)}return t||null}min(e){let t=null,i=null;for(const r of eI(o=this._data).call(o)){var o;const A=r[e];typeof A=="number"&&(i==null||Ae.x&&n.tope.y}function gI(n){return typeof n=="string"&&n!==""}function gx(n,e,t,i){let o=i.x,r=i.y;if(typeof i.distanceToBorder=="function"){const A=i.distanceToBorder(n,e),I=Math.sin(e)*A,l=Math.cos(e)*A;l===A?(o+=A,r=i.y):I===A?(o=i.x,r-=A):(o+=l,r-=I)}else i.shape.width>i.shape.height?(o=i.x+i.shape.width*.5,r=i.y-t):(o=i.x+t,r=i.y-i.shape.height*.5);return{x:o,y:r}}class h${constructor(e){this.measureText=e,this.current=0,this.width=0,this.height=0,this.lines=[]}_add(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"normal";this.lines[e]===void 0&&(this.lines[e]={width:0,height:0,blocks:[]});let o=t;(t===void 0||t==="")&&(o=" ");const r=this.measureText(o,i),A=Yt({},eI(r));A.text=t,A.width=r.width,A.mod=i,(t===void 0||t==="")&&(A.width=0),this.lines[e].blocks.push(A),this.lines[e].width+=A.width}curWidth(){const e=this.lines[this.current];return e===void 0?0:e.width}append(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t)}newLine(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"normal";this._add(this.current,e,t),this.current++}determineLineHeights(){for(let e=0;ee&&(e=o.width),t+=o.height}this.width=e,this.height=t}removeEmptyBlocks(){const e=[];for(let t=0;t"://,""://,""://,"":/<\/b>/,"":/<\/i>/,"":/<\/code>/,"*":/\*/,_:/_/,"`":/`/,afterBold:/[^*]/,afterItal:/[^_]/,afterMono:/[^`]/};class ox{constructor(e){this.text=e,this.bold=!1,this.ital=!1,this.mono=!1,this.spacing=!1,this.position=0,this.buffer="",this.modStack=[],this.blocks=[]}mod(){return this.modStack.length===0?"normal":this.modStack[0]}modName(){if(this.modStack.length===0)return"normal";if(this.modStack[0]==="mono")return"mono";if(this.bold&&this.ital)return"boldital";if(this.bold)return"bold";if(this.ital)return"ital"}emitBlock(){this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(this.blocks.push({text:this.buffer,mod:this.modName()}),this.buffer="")}add(e){e===" "&&(this.spacing=!0),this.spacing&&(this.buffer+=" ",this.spacing=!1),e!=" "&&(this.buffer+=e)}parseWS(e){return/[ \t]/.test(e)?(this.mono?this.add(e):this.spacing=!0,!0):!1}setTag(e){this.emitBlock(),this[e]=!0,this.modStack.unshift(e)}unsetTag(e){this.emitBlock(),this[e]=!1,this.modStack.shift()}parseStartTag(e,t){return!this.mono&&!this[e]&&this.match(t)?(this.setTag(e),!0):!1}match(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const[i,o]=this.prepareRegExp(e),r=i.test(this.text.substr(this.position,o));return r&&t&&(this.position+=o-1),r}parseEndTag(e,t,i){let o=this.mod()===e;return e==="mono"?o=o&&this.mono:o=o&&!this.mono,o&&this.match(t)?(i!==void 0?(this.position===this.text.length-1||this.match(i,!1))&&this.unsetTag(e):this.unsetTag(e),!0):!1}replace(e,t){return this.match(e)?(this.add(t),this.position+=length-1,!0):!1}prepareRegExp(e){let t,i;if(e instanceof RegExp)i=e,t=1;else{const o=f$[e];o!==void 0?i=o:i=new RegExp(e),t=e.length}return[i,t]}}class p${constructor(e,t,i,o){this.ctx=e,this.parent=t,this.selected=i,this.hover=o;const r=(A,I)=>{if(A===void 0)return 0;const l=this.parent.getFormattingValues(e,i,o,I);let c=0;return A!==""&&(c=this.ctx.measureText(A).width),{width:c,values:l}};this.lines=new h$(r)}process(e){if(!gI(e))return this.lines.finalize();const t=this.parent.fontOptions;e=e.replace(/\r\n/g,` `),e=e.replace(/\r/g,` `);const i=String(e).split(` -`),o=i.length;if(t.multi)for(let r=0;r0)for(let I=0;I0)for(let r=0;r/&/.test(o)?(t.replace(t.text,"<","<")||t.replace(t.text,"&","&")||t.add("&"),!0):!1;for(;t.position")||t.parseStartTag("ital","")||t.parseStartTag("mono","")||t.parseEndTag("bold","")||t.parseEndTag("ital","")||t.parseEndTag("mono",""))||i(o)||t.add(o),t.position++}return t.emitBlock(),t.blocks}splitMarkdownBlocks(e){const t=new qw(e);let i=!0;const o=r=>/\\/.test(r)?(t.positionthis.parent.fontOptions.maxWdt}getLongestFit(e){let t="",i=0;for(;i1&&arguments[1]!==void 0?arguments[1]:"normal",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");let o=e.split("\r");for(;o.length>0;){let r=this.getLongestFit(o);if(r===0){const A=o[0],I=this.getLongestFitWord(A);this.lines.newLine(xi(A).call(A,0,I),t),o[0]=xi(A).call(A,I)}else{let A=r;o[r-1]===" "?r--:o[A]===" "&&A++;const I=xi(o).call(o,0,r).join("");r==o.length&&i?this.lines.append(I,t):this.lines.newLine(I,t),o=xi(o).call(o,A)}}}}const Ba=["bold","ital","boldital","mono"];class Vs{constructor(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(t),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=i}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),nI(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font=="string")this.baseSize=this.fontOptions.size;else if(typeof e.font=="object"){const t=e.font.size;t!==void 0&&(this.baseSize=t)}}}initFontOptions(e){if(Ke(Ba,t=>{this.fontOptions[t]={}}),Vs.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}Ke(e,(t,i)=>{t!=null&&typeof t!="object"&&(this.fontOptions[i]=t)})}static parseFontString(e,t){if(!t||typeof t!="string")return!1;const i=t.split(" ");return e.size=+i[0].replace("px",""),e.face=i[1],e.color=i[2],!0}constrain(e){const t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},i=_g(e,"widthConstraint");if(typeof i=="number")t.maxWdt=Number(i),t.minWdt=Number(i);else if(typeof i=="object"){const r=_g(e,["widthConstraint","maximum"]);typeof r=="number"&&(t.maxWdt=Number(r));const A=_g(e,["widthConstraint","minimum"]);typeof A=="number"&&(t.minWdt=Number(A))}const o=_g(e,"heightConstraint");if(typeof o=="number")t.minHgt=Number(o);else if(typeof o=="object"){const r=_g(e,["heightConstraint","minimum"]);typeof r=="number"&&(t.minHgt=Number(r));const A=_g(e,["heightConstraint","valign"]);typeof A=="string"&&(A==="top"||A==="bottom")&&(t.valign=A)}return t}update(e,t){this.setOptions(e,!0),this.propagateFonts(t),vt(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=Tu("label",t)}adjustSizes(e){const t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);const i=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=i)}addFontOptionsToPile(e,t){for(let i=0;i{A!==void 0&&(Object.prototype.hasOwnProperty.call(t,I)||(At(Ba).call(Ba,I)!==-1?t[I]={}:t[I]=A))})}return t}getFontOption(e,t,i){let o;for(let r=0;r{r[l]=I}),r.size=Number(r.size),r.vadjust=Number(r.vadjust)}}draw(e,t,i,o,r){let A=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";if(this.elementOptions.label===void 0)return;let I=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&I=this.elementOptions.scaling.label.maxVisible&&(I=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,o,r,t,i,A),this._drawBackground(e),this._drawText(e,t,this.size.yLine,A,I))}_drawBackground(e){if(this.fontOptions.background!==void 0&&this.fontOptions.background!=="none"){e.fillStyle=this.fontOptions.background;const t=this.getSize();e.fillRect(t.left,t.top,t.width,t.height)}}_drawText(e,t,i){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"middle",r=arguments.length>4?arguments[4]:void 0;[t,i]=this._setAlignment(e,t,i,o),e.textAlign="left",t=t-this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign==="top"&&(i-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign==="bottom"&&(i+=(this.size.height-this.size.labelHeight)/2));for(let A=0;A0&&(e.lineWidth=h.strokeWidth,e.strokeStyle=m,e.lineJoin="round"),e.fillStyle=p,h.strokeWidth>0&&e.strokeText(h.text,t+l,i+h.vadjust),e.fillText(h.text,t+l,i+h.vadjust),l+=h.width}i+=I.height}}}_setAlignment(e,t,i,o){if(this.isEdgeLabel&&this.fontOptions.align!=="horizontal"&&this.pointToSelf===!1){t=0,i=0;const r=2;this.fontOptions.align==="top"?(e.textBaseline="alphabetic",i-=2*r):this.fontOptions.align==="bottom"?(e.textBaseline="hanging",i+=2*r):e.textBaseline="middle"}else e.textBaseline=o;return[t,i]}_getColor(e,t,i){let o=e||"#000000",r=i||"#ffffff";if(t<=this.elementOptions.scaling.label.drawThreshold){const A=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-t)));o=si(o,A),r=si(r,A)}return[o,r]}getTextSize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this._processLabel(e,t,i),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}getSize(){let t=this.size.left,i=this.size.top-.5*2;if(this.isEdgeLabel){const r=-this.size.width*.5;switch(this.fontOptions.align){case"middle":t=r,i=-this.size.height*.5;break;case"top":t=r,i=-(this.size.height+2);break;case"bottom":t=r,i=2;break}}return{left:t,top:i,width:this.size.width,height:this.size.height}}calculateLabelSize(e,t,i){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,A=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";this._processLabel(e,t,i),this.size.left=o-this.size.width*.5,this.size.top=r-this.size.height*.5,this.size.yLine=r+(1-this.lineCount)*.5*this.fontOptions.size,A==="hanging"&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}getFormattingValues(e,t,i,o){const r=function(l,c,h){return c==="normal"?h==="mod"?"":l[h]:l[c][h]!==void 0?l[c][h]:l[h]},A={color:r(this.fontOptions,o,"color"),size:r(this.fontOptions,o,"size"),face:r(this.fontOptions,o,"face"),mod:r(this.fontOptions,o,"mod"),vadjust:r(this.fontOptions,o,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(t||i)&&(o==="normal"&&this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?A.mod="bold":typeof this.fontOptions.chooser=="function"&&this.fontOptions.chooser(A,this.elementOptions.id,t,i));let I="";return A.mod!==void 0&&A.mod!==""&&(I+=A.mod+" "),I+=A.size+"px "+A.face,e.font=I.replace(/"/g,""),A.font=e.font,A.height=A.size,A}differentState(e,t){return e!==this.selectedState||t!==this.hoverState}_processLabelText(e,t,i,o){return new BX(e,this,t,i).process(o)}_processLabel(e,t,i){if(this.labelDirty===!1&&!this.differentState(t,i))return;const o=this._processLabelText(e,t,i,this.elementOptions.label);this.fontOptions.minWdt>0&&o.width0&&o.height0&&(this.enableBorderDashes(e,t),e.stroke(),this.disableBorderDashes(e,t)),e.restore()}performFill(e,t){e.save(),e.fillStyle=t.color,this.enableShadow(e,t),fa(e).call(e),this.disableShadow(e,t),e.restore(),this.performStroke(e,t)}_addBoundingBoxMargin(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}_updateBoundingBox(e,t,i,o,r){i!==void 0&&this.resize(i,o,r),this.left=e-this.width/2,this.top=t-this.height/2,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}updateBoundingBox(e,t,i,o,r){this._updateBoundingBox(e,t,i,o,r)}getDimensionsFromLabel(e,t,i){this.textSize=this.labelModule.getTextSize(e,t,i);let o=this.textSize.width,r=this.textSize.height;const A=14;return o===0&&(o=A,r=A),{width:o,height:r}}}let PX=class extends Bo{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,i)){const o=this.getDimensionsFromLabel(e,t,i);this.width=o.width+this.margin.right+this.margin.left,this.height=o.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}draw(e,t,i,o,r,A){this.resize(e,o,r),this.left=t-this.width/2,this.top=i-this.height/2,this.initContextForDraw(e,A),mb(e,this.left,this.top,this.width,this.height,A.borderRadius),this.performFill(e,A),this.updateBoundingBox(t,i,e,o,r),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,o,r)}updateBoundingBox(e,t,i,o,r){this._updateBoundingBox(e,t,i,o,r);const A=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(A)}distanceToBorder(e,t){e&&this.resize(e);const i=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+i}};class Nu extends Bo{constructor(e,t,i){super(e,t,i),this.labelOffset=0,this.selected=!1}setOptions(e,t,i){this.options=e,t===void 0&&i===void 0||this.setImages(t,i)}setImages(e,t){t&&this.selected?(this.imageObj=t,this.imageObjAlt=e):(this.imageObj=e,this.imageObjAlt=t)}switchImages(e){const t=e&&!this.selected||!e&&this.selected;if(this.selected=e,this.imageObjAlt!==void 0&&t){const i=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=i}}_getImagePadding(){const e={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){const t=this.options.imagePadding;typeof t=="object"?(e.top=t.top,e.right=t.right,e.bottom=t.bottom,e.left=t.left):(e.top=t,e.right=t,e.bottom=t,e.left=t)}return e}_resizeImage(){let e,t;if(this.options.shapeProperties.useImageSize===!1){let i=1,o=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?i=this.imageObj.width/this.imageObj.height:o=this.imageObj.height/this.imageObj.width),e=this.options.size*2*i,t=this.options.size*2*o}else{const i=this._getImagePadding();e=this.imageObj.width+i.left+i.right,t=this.imageObj.height+i.top+i.bottom}this.width=e,this.height=t,this.radius=.5*this.width}_drawRawCircle(e,t,i,o){this.initContextForDraw(e,o),Fc(e,t,i,o.size),this.performFill(e,o)}_drawImageAtPosition(e,t){if(this.imageObj.width!=0){e.globalAlpha=t.opacity!==void 0?t.opacity:1,this.enableShadow(e,t);let i=1;this.options.shapeProperties.interpolation===!0&&(i=this.imageObj.width/this.width/this.body.view.scale);const o=this._getImagePadding(),r=this.left+o.left,A=this.top+o.top,I=this.width-o.left-o.right,l=this.height-o.top-o.bottom;this.imageObj.drawImageAtPosition(e,i,r,A,I,l),this.disableShadow(e,t)}}_drawImageLabel(e,t,i,o,r){let A=0;if(this.height!==void 0){A=this.height*.5;const l=this.labelModule.getTextSize(e,o,r);l.lineCount>=1&&(A+=l.height/2)}const I=i+A;this.options.label&&(this.labelOffset=A),this.labelModule.draw(e,t,I,o,r,"hanging")}}let LX=class extends Nu{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,i)){const o=this.getDimensionsFromLabel(e,t,i),r=Math.max(o.width+this.margin.right+this.margin.left,o.height+this.margin.top+this.margin.bottom);this.options.size=r/2,this.width=r,this.height=r,this.radius=this.width/2}}draw(e,t,i,o,r,A){this.resize(e,o,r),this.left=t-this.width/2,this.top=i-this.height/2,this._drawRawCircle(e,t,i,A),this.updateBoundingBox(t,i),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,i,o,r)}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size}distanceToBorder(e){return e&&this.resize(e),this.width*.5}};class GX extends Nu{constructor(e,t,i,o,r){super(e,t,i),this.setImages(o,r)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){const r=this.options.size*2;this.width=r,this.height=r,this.radius=.5*this.width;return}this.needsRefresh(t,i)&&this._resizeImage()}draw(e,t,i,o,r,A){this.switchImages(o),this.resize();let I=t,l=i;this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=t,this.top=i,I+=this.width/2,l+=this.height/2):(this.left=t-this.width/2,this.top=i-this.height/2),this._drawRawCircle(e,I,l,A),e.save(),e.clip(),this._drawImageAtPosition(e,A),e.restore(),this._drawImageLabel(e,I,l,o,r),this.updateBoundingBox(t,i)}updateBoundingBox(e,t){this.options.shapeProperties.coordinateOrigin==="top-left"?(this.boundingBox.top=t,this.boundingBox.left=e,this.boundingBox.right=e+this.options.size*2,this.boundingBox.bottom=t+this.options.size*2):(this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size),this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}distanceToBorder(e){return e&&this.resize(e),this.width*.5}}class Pg extends Bo{constructor(e,t,i){super(e,t,i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(t,i)){var r,A;this.labelModule.getTextSize(e,t,i);const I=2*o.size;this.width=(r=this.customSizeWidth)!==null&&r!==void 0?r:I,this.height=(A=this.customSizeHeight)!==null&&A!==void 0?A:I,this.radius=.5*this.width}}_drawShape(e,t,i,o,r,A,I,l){return this.resize(e,A,I,l),this.left=o-this.width/2,this.top=r-this.height/2,this.initContextForDraw(e,l),w4(t)(e,o,r,l.size),this.performFill(e,l),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(e.font=(A?"bold ":"")+this.height/2+"px "+(this.options.icon.face||"FontAwesome"),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",e.fillText(this.options.icon.code,o,r)),{drawExternalLabel:()=>{if(this.options.label!==void 0){this.labelModule.calculateLabelSize(e,A,I,o,r,"hanging");const c=r+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(e,o,c,A,I,"hanging")}this.updateBoundingBox(o,r)}}}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}}function Jw(n,e){var t=xt(n);if(Pi){var i=Pi(n);e&&(i=$t(i).call(i,function(o){return Li(n,o).enumerable})),t.push.apply(t,i)}return t}function FX(n){for(var e=1;e{e.save(),l(),e.restore()}}return I.nodeDimensions&&(this.customSizeWidth=I.nodeDimensions.width,this.customSizeHeight=I.nodeDimensions.height),I}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class UX extends Bo{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e,t,i){if(this.needsRefresh(t,i)){const r=this.getDimensionsFromLabel(e,t,i).width+this.margin.right+this.margin.left;this.width=r,this.height=r,this.radius=this.width/2}}draw(e,t,i,o,r,A){this.resize(e,o,r),this.left=t-this.width/2,this.top=i-this.height/2,this.initContextForDraw(e,A),vb(e,t-this.width/2,i-this.height/2,this.width,this.height),this.performFill(e,A),this.updateBoundingBox(t,i,e,o,r),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,o,r)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let YX=class extends Pg{constructor(e,t,i){super(e,t,i)}draw(e,t,i,o,r,A){return this._drawShape(e,"diamond",4,t,i,o,r,A)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};class HX extends Pg{constructor(e,t,i){super(e,t,i)}draw(e,t,i,o,r,A){return this._drawShape(e,"circle",2,t,i,o,r,A)}distanceToBorder(e){return e&&this.resize(e),this.options.size}}class ex extends Bo{constructor(e,t,i){super(e,t,i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,i)){const o=this.getDimensionsFromLabel(e,t,i);this.height=o.height*2,this.width=o.width+o.height,this.radius=.5*this.width}}draw(e,t,i,o,r,A){this.resize(e,o,r),this.left=t-this.width*.5,this.top=i-this.height*.5,this.initContextForDraw(e,A),Vc(e,this.left,this.top,this.width,this.height),this.performFill(e,A),this.updateBoundingBox(t,i,e,o,r),this.labelModule.draw(e,t,i,o,r)}distanceToBorder(e,t){e&&this.resize(e);const i=this.width*.5,o=this.height*.5,r=Math.sin(t)*i,A=Math.cos(t)*o;return i*o/Math.sqrt(r*r+A*A)}}class KX extends Bo{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e,t,i){this.needsRefresh(t,i)&&(this.iconSize={width:Number(this.options.icon.size),height:Number(this.options.icon.size)},this.width=this.iconSize.width+this.margin.right+this.margin.left,this.height=this.iconSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(e,t,i,o,r,A){return this.resize(e,o,r),this.options.icon.size=this.options.icon.size||50,this.left=t-this.width/2,this.top=i-this.height/2,this._icon(e,t,i,o,r,A),{drawExternalLabel:()=>{this.options.label!==void 0&&this.labelModule.draw(e,this.left+this.iconSize.width/2+this.margin.left,i+this.height/2+5,o),this.updateBoundingBox(t,i)}}}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.icon.size*.5,this.boundingBox.left=e-this.options.icon.size*.5,this.boundingBox.right=e+this.options.icon.size*.5,this.boundingBox.bottom=t+this.options.icon.size*.5,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+5))}_icon(e,t,i,o,r,A){const I=Number(this.options.icon.size);this.options.icon.code!==void 0?(e.font=[this.options.icon.weight!=null?this.options.icon.weight:o?"bold":"",(this.options.icon.weight!=null&&o?5:0)+I+"px",this.options.icon.face].join(" "),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",this.enableShadow(e,A),e.fillText(this.options.icon.code,t,i),this.disableShadow(e,A)):console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.")}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let WX=class extends Nu{constructor(e,t,i,o,r){super(e,t,i),this.setImages(o,r)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){const r=this.options.size*2;this.width=r,this.height=r;return}this.needsRefresh(t,i)&&this._resizeImage()}draw(e,t,i,o,r,A){e.save(),this.switchImages(o),this.resize();let I=t,l=i;if(this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=t,this.top=i,I+=this.width/2,l+=this.height/2):(this.left=t-this.width/2,this.top=i-this.height/2),this.options.shapeProperties.useBorderWithImage===!0){const c=this.options.borderWidth,h=this.options.borderWidthSelected||2*this.options.borderWidth,p=(o?h:c)/this.body.view.scale;e.lineWidth=Math.min(this.width,p),e.beginPath();let m=o?this.options.color.highlight.border:r?this.options.color.hover.border:this.options.color.border,b=o?this.options.color.highlight.background:r?this.options.color.hover.background:this.options.color.background;A.opacity!==void 0&&(m=si(m,A.opacity),b=si(b,A.opacity)),e.strokeStyle=m,e.fillStyle=b,e.rect(this.left-.5*e.lineWidth,this.top-.5*e.lineWidth,this.width+e.lineWidth,this.height+e.lineWidth),fa(e).call(e),this.performStroke(e,A),e.closePath()}this._drawImageAtPosition(e,A),this._drawImageLabel(e,I,l,o,r),this.updateBoundingBox(t,i),e.restore()}updateBoundingBox(e,t){this.resize(),this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=e,this.top=t):(this.left=e-this.width/2,this.top=t-this.height/2),this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};class QX extends Pg{constructor(e,t,i){super(e,t,i)}draw(e,t,i,o,r,A){return this._drawShape(e,"square",2,t,i,o,r,A)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class XX extends Pg{constructor(e,t,i){super(e,t,i)}draw(e,t,i,o,r,A){return this._drawShape(e,"hexagon",4,t,i,o,r,A)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class $X extends Pg{constructor(e,t,i){super(e,t,i)}draw(e,t,i,o,r,A){return this._drawShape(e,"star",4,t,i,o,r,A)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class qX extends Bo{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e,t,i){this.needsRefresh(t,i)&&(this.textSize=this.labelModule.getTextSize(e,t,i),this.width=this.textSize.width+this.margin.right+this.margin.left,this.height=this.textSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(e,t,i,o,r,A){this.resize(e,o,r),this.left=t-this.width/2,this.top=i-this.height/2,this.enableShadow(e,A),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,o,r),this.disableShadow(e,A),this.updateBoundingBox(t,i,e,o,r)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let JX=class extends Pg{constructor(e,t,i){super(e,t,i)}draw(e,t,i,o,r,A){return this._drawShape(e,"triangle",3,t,i,o,r,A)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};class e$ extends Pg{constructor(e,t,i){super(e,t,i)}draw(e,t,i,o,r,A){return this._drawShape(e,"triangleDown",3,t,i,o,r,A)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}function tx(n,e){var t=xt(n);if(Pi){var i=Pi(n);e&&(i=$t(i).call(i,function(o){return Li(n,o).enumerable})),t.push.apply(t,i)}return t}function nx(n){for(var e=1;et[c]!=null);l.push("font"),VC(l,e,I),e.color=qd(e.color)}static parseOptions(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},r=arguments.length>4?arguments[4]:void 0;if(VC(["color","fixed","shadow"],e,t,i),Nt.checkMass(t),e.opacity!==void 0&&(Nt.checkOpacity(e.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity),e.opacity=void 0)),t.opacity!==void 0&&(Nt.checkOpacity(t.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+t.opacity),t.opacity=void 0)),t.shapeProperties&&!Nt.checkCoordinateOrigin(t.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+t.shapeProperties.coordinateOrigin),ri(e,t,"shadow",o),t.color!==void 0&&t.color!==null){const I=qd(t.color);v1(e.color,I)}else i===!0&&t.color===null&&(e.color=Rg(o.color));t.fixed!==void 0&&t.fixed!==null&&(typeof t.fixed=="boolean"?(e.fixed.x=t.fixed,e.fixed.y=t.fixed):(t.fixed.x!==void 0&&typeof t.fixed.x=="boolean"&&(e.fixed.x=t.fixed.x),t.fixed.y!==void 0&&typeof t.fixed.y=="boolean"&&(e.fixed.y=t.fixed.y))),i===!0&&t.font===null&&(e.font=Rg(o.font)),Nt.updateGroupOptions(e,t,r),t.scaling!==void 0&&ri(e.scaling,t.scaling,"label",o.scaling)}getFormattingValues(){const e={color:this.options.color.background,opacity:this.options.opacity,borderWidth:this.options.borderWidth,borderColor:this.options.color.border,size:this.options.size,borderDashes:this.options.shapeProperties.borderDashes,borderRadius:this.options.shapeProperties.borderRadius,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y};if(this.selected||this.hover?this.chooser===!0?this.selected?(this.options.borderWidthSelected!=null?e.borderWidth=this.options.borderWidthSelected:e.borderWidth*=2,e.color=this.options.color.highlight.background,e.borderColor=this.options.color.highlight.border,e.shadow=this.options.shadow.enabled):this.hover&&(e.color=this.options.color.hover.background,e.borderColor=this.options.color.hover.border,e.shadow=this.options.shadow.enabled):typeof this.chooser=="function"&&(this.chooser(e,this.options.id,this.selected,this.hover),e.shadow===!1&&(e.shadowColor!==this.options.shadow.color||e.shadowSize!==this.options.shadow.size||e.shadowX!==this.options.shadow.x||e.shadowY!==this.options.shadow.y)&&(e.shadow=!0)):e.shadow=this.options.shadow.enabled,this.options.opacity!==void 0){const t=this.options.opacity;e.borderColor=si(e.borderColor,t),e.color=si(e.color,t),e.shadowColor=si(e.shadowColor,t)}return e}updateLabelModule(e){(this.options.label===void 0||this.options.label===null)&&(this.options.label=""),Nt.updateGroupOptions(this.options,nx(nx({},e),{},{color:e&&e.color||this._localColor||void 0}),this.grouplist);const t=this.grouplist.get(this.options.group,!1),i=[e,this.options,t,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,i),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateShape(e){if(e===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case"box":this.shape=new PX(this.options,this.body,this.labelModule);break;case"circle":this.shape=new LX(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new GX(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"custom":this.shape=new VX(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case"database":this.shape=new UX(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new YX(this.options,this.body,this.labelModule);break;case"dot":this.shape=new HX(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new ex(this.options,this.body,this.labelModule);break;case"icon":this.shape=new KX(this.options,this.body,this.labelModule);break;case"image":this.shape=new WX(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new QX(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new XX(this.options,this.body,this.labelModule);break;case"star":this.shape=new $X(this.options,this.body,this.labelModule);break;case"text":this.shape=new qX(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new JX(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new e$(this.options,this.body,this.labelModule);break;default:this.shape=new ex(this.options,this.body,this.labelModule);break}this.needsRefresh()}select(){this.selected=!0,this.needsRefresh()}unselect(){this.selected=!1,this.needsRefresh()}needsRefresh(){this.shape.refreshNeeded=!0}getTitle(){return this.options.title}distanceToBorder(e,t){return this.shape.distanceToBorder(e,t)}isFixed(){return this.options.fixed.x&&this.options.fixed.y}isSelected(){return this.selected}getValue(){return this.options.value}getLabelSize(){return this.labelModule.size()}setValueRange(e,t,i){if(this.options.value!==void 0){const o=this.options.scaling.customScalingFunction(e,t,i,this.options.value),r=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){const A=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+o*A}this.options.size=this.options.scaling.min+o*r}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}draw(e){const t=this.getFormattingValues();return this.shape.draw(e,this.x,this.y,this.selected,this.hover,t)||{}}updateBoundingBox(e){this.shape.updateBoundingBox(this.x,this.y,e)}resize(e){const t=this.getFormattingValues();this.shape.resize(e,this.selected,this.hover,t)}getItemsOnPoint(e){const t=[];return this.labelModule.visible()&&Ou(this.labelModule.getSize(),e)&&t.push({nodeId:this.id,labelId:0}),Ou(this.shape.boundingBox,e)&&t.push({nodeId:this.id}),t}isOverlappingWith(e){return this.shape.lefte.left&&this.shape.tope.top}isBoundingBoxOverlappingWith(e){return this.shape.boundingBox.lefte.left&&this.shape.boundingBox.tope.top}static checkMass(e,t){if(e.mass!==void 0&&e.mass<=0){let i="";t!==void 0&&(i=" in node id: "+t),console.error("%cNegative or zero mass disallowed"+i+", setting mass to 1.",S1),e.mass=1}}}class t${constructor(e,t,i,o){var r;if(this.body=e,this.images=t,this.groups=i,this.layoutEngine=o,this.body.functions.createNode=ge(r=this.create).call(r,this),this.nodesListeners={add:(A,I)=>{this.add(I.items)},update:(A,I)=>{this.update(I.items,I.data,I.oldData)},remove:(A,I)=>{this.remove(I.items)}},this.defaultOptions={borderWidth:1,borderWidthSelected:void 0,brokenImage:void 0,color:{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},opacity:void 0,fixed:{x:!1,y:!1},font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:0,strokeColor:"#ffffff",align:"center",vadjust:0,multi:!1,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"monospace",vadjust:2}},group:void 0,hidden:!1,icon:{face:"FontAwesome",code:void 0,size:50,color:"#2B7CE9"},image:void 0,imagePadding:{top:0,right:0,bottom:0,left:0},label:void 0,labelHighlightBold:!0,level:void 0,margin:{top:5,right:5,bottom:5,left:5},mass:1,physics:!0,scaling:{min:10,max:30,label:{enabled:!1,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(A,I,l,c){if(I===A)return .5;{const h=1/(I-A);return Math.max(0,(c-A)*h)}}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},shape:"ellipse",shapeProperties:{borderDashes:!1,borderRadius:6,interpolation:!0,useImageSize:!1,useBorderWithImage:!1,coordinateOrigin:"center"},size:25,title:void 0,value:void 0,x:void 0,y:void 0},this.defaultOptions.mass<=0)throw"Internal error: mass in defaultOptions of NodesHandler may not be zero or negative";this.options=Rg(this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e,t;this.body.emitter.on("refreshNodes",ge(e=this.refresh).call(e,this)),this.body.emitter.on("refresh",ge(t=this.refresh).call(t,this)),this.body.emitter.on("destroy",()=>{Ke(this.nodesListeners,(i,o)=>{this.body.data.nodes&&this.body.data.nodes.off(o,i)}),delete this.body.functions.createNode,delete this.nodesListeners.add,delete this.nodesListeners.update,delete this.nodesListeners.remove,delete this.nodesListeners})}setOptions(e){if(e!==void 0){if(Nt.parseOptions(this.options,e),e.opacity!==void 0&&(cu(e.opacity)||!jo(e.opacity)||e.opacity<0||e.opacity>1?console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity):this.options.opacity=e.opacity),e.shape!==void 0)for(const t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].updateShape();if(typeof e.font<"u"||typeof e.widthConstraint<"u"||typeof e.heightConstraint<"u")for(const t of xt(this.body.nodes))this.body.nodes[t].updateLabelModule(),this.body.nodes[t].needsRefresh();if(e.size!==void 0)for(const t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].needsRefresh();(e.hidden!==void 0||e.physics!==void 0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.body.data.nodes;if(Yw("id",e))this.body.data.nodes=e;else if(tt(e))this.body.data.nodes=new Fs,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new Fs;else throw new TypeError("Array or DataSet expected");if(i&&Ke(this.nodesListeners,function(o,r){i.off(r,o)}),this.body.nodes={},this.body.data.nodes){const o=this;Ke(this.nodesListeners,function(A,I){o.body.data.nodes.on(I,A)});const r=this.body.data.nodes.getIds();this.add(r,!0)}t===!1&&this.body.emitter.emit("_dataChanged")}add(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i;const o=[];for(let r=0;r1&&arguments[1]!==void 0?arguments[1]:Nt;return new t(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Ke(this.body.nodes,(t,i)=>{const o=this.body.data.nodes.get(i);o!==void 0&&(e===!0&&t.setOptions({x:null,y:null}),t.setOptions({fixed:!1}),t.setOptions(o))})}getPositions(e){const t={};if(e!==void 0){if(tt(e)===!0){for(let i=0;i{this.body.emitter.emit("startSimulation")},0)):console.error("Node id supplied to moveNode does not exist. Provided: ",e)}}var n$=Me,ix=Math.hypot,i$=Math.abs,g$=Math.sqrt,o$=!!ix&&ix(1/0,NaN)!==1/0;n$({target:"Math",stat:!0,forced:o$},{hypot:function(e,t){for(var i=0,o=0,r=arguments.length,A=0,I,l;o0?(l=I/A,i+=l*l):i+=I;return A===1/0?1/0:A*g$(i)}});var s$=rt,r$=s$.Math.hypot,a$=r$,A$=a$,C$=A$,I$=Oe(C$);class Yt{static transform(e,t){tt(e)||(e=[e]);const i=t.point.x,o=t.point.y,r=t.angle,A=t.length;for(let I=0;I4&&arguments[4]!==void 0?arguments[4]:this.getViaNode();e.strokeStyle=this.getColor(e,t),e.lineWidth=t.width,t.dashes!==!1?this._drawDashedLine(e,t,r):this._drawLine(e,t,r)}_drawLine(e,t,i,o,r){if(this.from!=this.to)this._line(e,t,i,o,r);else{const[A,I,l]=this._getCircleData(e);this._circle(e,t,A,I,l)}}_drawDashedLine(e,t,i,o,r){e.lineCap="round";const A=tt(t.dashes)?t.dashes:[5,5];if(e.setLineDash!==void 0){if(e.save(),e.setLineDash(A),e.lineDashOffset=0,this.from!=this.to)this._line(e,t,i);else{const[I,l,c]=this._getCircleData(e);this._circle(e,t,I,l,c)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)bb(e,this.from.x,this.from.y,this.to.x,this.to.y,A);else{const[I,l,c]=this._getCircleData(e);this._circle(e,t,I,l,c)}this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}}findBorderPosition(e,t,i){return this.from!=this.to?this._findBorderPosition(e,t,i):this._findBorderPositionCircle(e,t,i)}findBorderPositions(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};{var t;const[i,o]=xi(t=this._getCircleData(e)).call(t,0,2);return{from:this._findBorderPositionCircle(this.from,e,{x:i,y:o,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:i,y:o,low:.6,high:.8,direction:1})}}}_getCircleData(e){const t=this.options.selfReference.size;e!==void 0&&this.from.shape.width===void 0&&this.from.shape.resize(e);const i=$w(e,this.options.selfReference.angle,t,this.from);return[i.x,i.y,t]}_pointOnCircle(e,t,i,o){const r=o*2*Math.PI;return{x:e+i*Math.cos(r),y:t-i*Math.sin(r)}}_findBorderPositionCircle(e,t,i){const o=i.x,r=i.y;let A=i.low,I=i.high;const l=i.direction,c=10,h=this.options.selfReference.size,p=.05;let m,b=(A+I)*.5,w=0;this.options.arrowStrikethrough===!0&&(l===-1?w=this.options.endPointOffset.from:l===1&&(w=this.options.endPointOffset.to));let S=0;do{b=(A+I)*.5,m=this._pointOnCircle(o,r,h,b);const x=Math.atan2(e.y-m.y,e.x-m.x),O=e.distanceToBorder(t,x)+w,E=Math.sqrt(Math.pow(m.x-e.x,2)+Math.pow(m.y-e.y,2)),R=O-E;if(Math.abs(R)0?l>0?A=b:I=b:l>0?I=b:A=b,++S}while(A<=I&&S1?h=1:h<0&&(h=0);const p=e+h*I,m=t+h*l,b=p-r,w=m-A;return Math.sqrt(b*b+w*w)}getArrowData(e,t,i,o,r,A){let I,l,c,h,p,m,b;const w=A.width;t==="from"?(c=this.from,h=this.to,p=A.fromArrowScale<0,m=Math.abs(A.fromArrowScale),b=A.fromArrowType):t==="to"?(c=this.to,h=this.from,p=A.toArrowScale<0,m=Math.abs(A.toArrowScale),b=A.toArrowType):(c=this.to,h=this.from,p=A.middleArrowScale<0,m=Math.abs(A.middleArrowScale),b=A.middleArrowType);const S=15*m+3*w;if(c!=h){const R=I$(c.x-h.x,c.y-h.y),B=S/R;if(t!=="middle")if(this.options.smooth.enabled===!0){const W=this._findBorderPosition(c,e,{via:i}),ne=this.getPoint(W.t+B*(t==="from"?1:-1),i);I=Math.atan2(W.y-ne.y,W.x-ne.x),l=W}else I=Math.atan2(c.y-h.y,c.x-h.x),l=this._findBorderPosition(c,e);else{const W=(p?-B:B)/2,ne=this.getPoint(.5+W,i),L=this.getPoint(.5-W,i);I=Math.atan2(ne.y-L.y,ne.x-L.x),l=this.getPoint(.5,i)}}else{const[R,B,W]=this._getCircleData(e);if(t==="from"){const ne=this.options.selfReference.angle,L=this.options.selfReference.angle+Math.PI,G=this._findBorderPositionCircle(this.from,e,{x:R,y:B,low:ne,high:L,direction:-1});I=G.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI,l=G}else if(t==="to"){const ne=this.options.selfReference.angle,L=this.options.selfReference.angle+Math.PI,G=this._findBorderPositionCircle(this.from,e,{x:R,y:B,low:ne,high:L,direction:1});I=G.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI,l=G}else{const ne=this.options.selfReference.angle/(2*Math.PI);l=this._pointOnCircle(R,B,W,ne),I=ne*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}const x=l.x-S*.9*Math.cos(I),O=l.y-S*.9*Math.sin(I);return{point:l,core:{x,y:O},angle:I,length:S,type:b}}drawArrowHead(e,t,i,o,r){e.strokeStyle=this.getColor(e,t),e.fillStyle=e.strokeStyle,e.lineWidth=t.width,gx.draw(e,r)&&(this.enableShadow(e,t),fa(e).call(e),this.disableShadow(e,t))}enableShadow(e,t){t.shadow===!0&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}disableShadow(e,t){t.shadow===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}drawBackground(e,t){if(t.background!==!1){const i={strokeStyle:e.strokeStyle,lineWidth:e.lineWidth,dashes:e.dashes};e.strokeStyle=t.backgroundColor,e.lineWidth=t.backgroundSize,this.setStrokeDashed(e,t.backgroundDashes),e.stroke(),e.strokeStyle=i.strokeStyle,e.lineWidth=i.lineWidth,e.dashes=i.dashes,this.setStrokeDashed(e,t.dashes)}}setStrokeDashed(e,t){if(t!==!1)if(e.setLineDash!==void 0){const i=tt(t)?t:[5,5];e.setLineDash(i)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else e.setLineDash!==void 0?e.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}}function ax(n,e){var t=xt(n);if(Pi){var i=Pi(n);e&&(i=$t(i).call(i,function(o){return Li(n,o).enumerable})),t.push.apply(t,i)}return t}function Ax(n){for(var e=1;e2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates();const o=10,r=.2;let A=!1,I=1,l=0,c=this.to,h,p,m=this.options.endPointOffset?this.options.endPointOffset.to:0;e.id===this.from.id&&(c=this.from,A=!0,m=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(m=0);let b=0;do{p=(l+I)*.5,h=this.getPoint(p,i);const w=Math.atan2(c.y-h.y,c.x-h.x),S=c.distanceToBorder(t,w)+m,x=Math.sqrt(Math.pow(h.x-c.x,2)+Math.pow(h.y-c.y,2)),O=S-x;if(Math.abs(O)0&&(c=this._getDistanceToLine(w,S,m,b,r,A),l=c{this.positionBezierNode()},this._body.emitter.on("_repositionBezierNodes",this._boundFunction)}setOptions(e){super.setOptions(e);let t=!1;this.options.physics!==e.physics&&(t=!0),this.options=e,this.id=this.options.id,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.setupSupportNode(),this.connect(),t===!0&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.from===void 0||this.to===void 0||this.options.physics===!1?this.via.setOptions({physics:!1}):this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}cleanup(){return this._body.emitter.off("_repositionBezierNodes",this._boundFunction),this.via!==void 0?(delete this._body.nodes[this.via.id],this.via=void 0,!0):!1}setupSupportNode(){if(this.via===void 0){const e="edgeId:"+this.id,t=this._body.functions.createNode({id:e,shape:"circle",physics:!0,hidden:!0});this._body.nodes[e]=t,this.via=t,this.via.parentEdgeId=this.id,this.positionBezierNode()}}positionBezierNode(){this.via!==void 0&&this.from!==void 0&&this.to!==void 0?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):this.via!==void 0&&(this.via.x=0,this.via.y=0)}_line(e,t,i){this._bezierCurve(e,t,i)}_getViaCoordinates(){return this.via}getViaNode(){return this.via}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.via;if(this.from===this.to){const[i,o,r]=this._getCircleData(),A=2*Math.PI*(1-e);return{x:i+r*Math.sin(A),y:o+r-r*(1-Math.cos(A))}}else return{x:Math.pow(1-e,2)*this.fromPoint.x+2*e*(1-e)*t.x+Math.pow(e,2)*this.toPoint.x,y:Math.pow(1-e,2)*this.fromPoint.y+2*e*(1-e)*t.y+Math.pow(e,2)*this.toPoint.y}}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t,this.via)}_getDistanceToEdge(e,t,i,o,r,A){return this._getDistanceToBezierEdge(e,t,i,o,r,A,this.via)}}class Ix extends Du{constructor(e,t,i){super(e,t,i)}_line(e,t,i){this._bezierCurve(e,t,i)}getViaNode(){return this._getViaCoordinates()}_getViaCoordinates(){const e=this.options.smooth.roundness,t=this.options.smooth.type;let i=Math.abs(this.from.x-this.to.x),o=Math.abs(this.from.y-this.to.y);if(t==="discrete"||t==="diagonalCross"){let r,A;i<=o?r=A=e*o:r=A=e*i,this.from.x>this.to.x&&(r=-r),this.from.y>=this.to.y&&(A=-A);let I=this.from.x+r,l=this.from.y+A;return t==="discrete"&&(i<=o?I=ithis.to.x&&(r=-r),this.from.y>=this.to.y&&(A=-A);let I=this.from.x+r,l=this.from.y+A;return i<=o?this.from.x<=this.to.x?I=this.to.xI?this.to.x:I:this.from.y>=this.to.y?l=this.to.y>l?this.to.y:l:l=this.to.y2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(e,t,i.via)}_getDistanceToEdge(e,t,i,o,r,A){let I=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(e,t,i,o,r,A,I)}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates();const i=e,o=Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*t.x+Math.pow(i,2)*this.toPoint.x,r=Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*t.y+Math.pow(i,2)*this.toPoint.y;return{x:o,y:r}}}class x$ extends Du{constructor(e,t,i){super(e,t,i)}_getDistanceToBezierEdge2(e,t,i,o,r,A,I,l){let c=1e9,h=e,p=t;const m=[0,0,0,0];for(let b=1;b<10;b++){const w=.1*b;m[0]=Math.pow(1-w,3),m[1]=3*w*Math.pow(1-w,2),m[2]=3*Math.pow(w,2)*(1-w),m[3]=Math.pow(w,3);const S=m[0]*e+m[1]*I.x+m[2]*l.x+m[3]*i,x=m[0]*t+m[1]*I.y+m[2]*l.y+m[3]*o;if(b>0){const O=this._getDistanceToLine(h,p,S,x,r,A);c=OMath.abs(t)||this.options.smooth.forceDirection===!0||this.options.smooth.forceDirection==="horizontal")&&this.options.smooth.forceDirection!=="vertical"?(o=this.from.y,A=this.to.y,i=this.from.x-I*e,r=this.to.x+I*e):(o=this.from.y-I*t,A=this.to.y+I*t,i=this.from.x,r=this.to.x),[{x:i,y:o},{x:r,y:A}]}getViaNode(){return this._getViaCoordinates()}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t)}_getDistanceToEdge(e,t,i,o,r,A){let[I,l]=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge2(e,t,i,o,r,A,I,l)}getPoint(e){let[t,i]=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates();const o=e,r=[Math.pow(1-o,3),3*o*Math.pow(1-o,2),3*Math.pow(o,2)*(1-o),Math.pow(o,3)],A=r[0]*this.fromPoint.x+r[1]*t.x+r[2]*i.x+r[3]*this.toPoint.x,I=r[0]*this.fromPoint.y+r[1]*t.y+r[2]*i.y+r[3]*this.toPoint.y;return{x:A,y:I}}}class cx extends rx{constructor(e,t,i){super(e,t,i)}_line(e,t){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),e.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}getViaNode(){}getPoint(e){return{x:(1-e)*this.fromPoint.x+e*this.toPoint.x,y:(1-e)*this.fromPoint.y+e*this.toPoint.y}}_findBorderPosition(e,t){let i=this.to,o=this.from;e.id===this.from.id&&(i=this.from,o=this.to);const r=Math.atan2(i.y-o.y,i.x-o.x),A=i.x-o.x,I=i.y-o.y,l=Math.sqrt(A*A+I*I),c=e.distanceToBorder(t,r),h=(l-c)/l;return{x:(1-h)*o.x+h*i.x,y:(1-h)*o.y+h*i.y,t:0}}_getDistanceToEdge(e,t,i,o,r,A){return this._getDistanceToLine(e,t,i,o,r,A)}}class Lg{constructor(e,t,i,o,r){if(t===void 0)throw new Error("No body provided");this.options=Rg(o),this.globalOptions=o,this.defaultOptions=r,this.body=t,this.imagelist=i,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new Vs(this.body,this.options,!0),this.setOptions(e)}setOptions(e){if(!e)return;let t=typeof e.physics<"u"&&this.options.physics!==e.physics||typeof e.hidden<"u"&&(this.options.hidden||!1)!==(e.hidden||!1)||typeof e.from<"u"&&this.options.from!==e.from||typeof e.to<"u"&&this.options.to!==e.to;Lg.parseOptions(this.options,e,!0,this.globalOptions),e.id!==void 0&&(this.id=e.id),e.from!==void 0&&(this.fromId=e.from),e.to!==void 0&&(this.toId=e.to),e.title!==void 0&&(this.title=e.title),e.value!==void 0&&(e.value=Xw(e.value));const i=[e,this.options,this.defaultOptions];return this.chooser=Tu("edge",i),this.updateLabelModule(e),t=this.updateEdgeType()||t,this._setInteractionWidths(),this.connect(),t}static parseOptions(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(_s(["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"],e,t,i),t.endPointOffset!==void 0&&t.endPointOffset.from!==void 0&&(jo(t.endPointOffset.from)?e.endPointOffset.from=t.endPointOffset.from:(e.endPointOffset.from=o.endPointOffset.from!==void 0?o.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),t.endPointOffset!==void 0&&t.endPointOffset.to!==void 0&&(jo(t.endPointOffset.to)?e.endPointOffset.to=t.endPointOffset.to:(e.endPointOffset.to=o.endPointOffset.to!==void 0?o.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),nI(t.label)?e.label=t.label:nI(e.label)||(e.label=void 0),ri(e,t,"smooth",o),ri(e,t,"shadow",o),ri(e,t,"background",o),t.dashes!==void 0&&t.dashes!==null?e.dashes=t.dashes:i===!0&&t.dashes===null&&(e.dashes=Mg(o.dashes)),t.scaling!==void 0&&t.scaling!==null?(t.scaling.min!==void 0&&(e.scaling.min=t.scaling.min),t.scaling.max!==void 0&&(e.scaling.max=t.scaling.max),ri(e.scaling,t.scaling,"label",o.scaling)):i===!0&&t.scaling===null&&(e.scaling=Mg(o.scaling)),t.arrows!==void 0&&t.arrows!==null)if(typeof t.arrows=="string"){const I=t.arrows.toLowerCase();e.arrows.to.enabled=At(I).call(I,"to")!=-1,e.arrows.middle.enabled=At(I).call(I,"middle")!=-1,e.arrows.from.enabled=At(I).call(I,"from")!=-1}else if(typeof t.arrows=="object")ri(e.arrows,t.arrows,"to",o.arrows),ri(e.arrows,t.arrows,"middle",o.arrows),ri(e.arrows,t.arrows,"from",o.arrows);else throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+Ts(t.arrows));else i===!0&&t.arrows===null&&(e.arrows=Mg(o.arrows));if(t.color!==void 0&&t.color!==null){const I=Rs(t.color)?{color:t.color,highlight:t.color,hover:t.color,inherit:!1,opacity:1}:t.color,l=e.color;if(r)vt(l,o.color,!1,i);else for(const c in l)Object.prototype.hasOwnProperty.call(l,c)&&delete l[c];if(Rs(l))l.color=l,l.highlight=l,l.hover=l,l.inherit=!1,I.opacity===void 0&&(l.opacity=1);else{let c=!1;I.color!==void 0&&(l.color=I.color,c=!0),I.highlight!==void 0&&(l.highlight=I.highlight,c=!0),I.hover!==void 0&&(l.hover=I.hover,c=!0),I.inherit!==void 0&&(l.inherit=I.inherit),I.opacity!==void 0&&(l.opacity=Math.min(1,Math.max(0,I.opacity))),c===!0?l.inherit=!1:l.inherit===void 0&&(l.inherit="from")}}else i===!0&&t.color===null&&(e.color=Rg(o.color));i===!0&&t.font===null&&(e.font=Rg(o.font)),Object.prototype.hasOwnProperty.call(t,"selfReferenceSize")&&(console.warn("The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}"),e.selfReference.size=t.selfReferenceSize)}getFormattingValues(){const e=this.options.arrows.to===!0||this.options.arrows.to.enabled===!0,t=this.options.arrows.from===!0||this.options.arrows.from.enabled===!0,i=this.options.arrows.middle===!0||this.options.arrows.middle.enabled===!0,o=this.options.color.inherit,r={toArrow:e,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,toArrowSrc:this.options.arrows.to.src,toArrowImageWidth:this.options.arrows.to.imageWidth,toArrowImageHeight:this.options.arrows.to.imageHeight,middleArrow:i,middleArrowScale:this.options.arrows.middle.scaleFactor,middleArrowType:this.options.arrows.middle.type,middleArrowSrc:this.options.arrows.middle.src,middleArrowImageWidth:this.options.arrows.middle.imageWidth,middleArrowImageHeight:this.options.arrows.middle.imageHeight,fromArrow:t,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,fromArrowSrc:this.options.arrows.from.src,fromArrowImageWidth:this.options.arrows.from.imageWidth,fromArrowImageHeight:this.options.arrows.from.imageHeight,arrowStrikethrough:this.options.arrowStrikethrough,color:o?void 0:this.options.color.color,inheritsColor:o,opacity:this.options.color.opacity,hidden:this.options.hidden,length:this.options.length,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y,dashes:this.options.dashes,width:this.options.width,background:this.options.background.enabled,backgroundColor:this.options.background.color,backgroundSize:this.options.background.size,backgroundDashes:this.options.background.dashes};if(this.selected||this.hover)if(this.chooser===!0){if(this.selected){const A=this.options.selectionWidth;typeof A=="function"?r.width=A(r.width):typeof A=="number"&&(r.width+=A),r.width=Math.max(r.width,.3/this.body.view.scale),r.color=this.options.color.highlight,r.shadow=this.options.shadow.enabled}else if(this.hover){const A=this.options.hoverWidth;typeof A=="function"?r.width=A(r.width):typeof A=="number"&&(r.width+=A),r.width=Math.max(r.width,.3/this.body.view.scale),r.color=this.options.color.hover,r.shadow=this.options.shadow.enabled}}else typeof this.chooser=="function"&&(this.chooser(r,this.options.id,this.selected,this.hover),r.color!==void 0&&(r.inheritsColor=!1),r.shadow===!1&&(r.shadowColor!==this.options.shadow.color||r.shadowSize!==this.options.shadow.size||r.shadowX!==this.options.shadow.x||r.shadowY!==this.options.shadow.y)&&(r.shadow=!0));else r.shadow=this.options.shadow.enabled,r.width=Math.max(r.width,.3/this.body.view.scale);return r}updateLabelModule(e){const t=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateEdgeType(){const e=this.options.smooth;let t=!1,i=!0;return this.edgeType!==void 0&&((this.edgeType instanceof Cx&&e.enabled===!0&&e.type==="dynamic"||this.edgeType instanceof lx&&e.enabled===!0&&e.type==="cubicBezier"||this.edgeType instanceof Ix&&e.enabled===!0&&e.type!=="dynamic"&&e.type!=="cubicBezier"||this.edgeType instanceof cx&&e.type.enabled===!1)&&(i=!1),i===!0&&(t=this.cleanup())),i===!0?e.enabled===!0?e.type==="dynamic"?(t=!0,this.edgeType=new Cx(this.options,this.body,this.labelModule)):e.type==="cubicBezier"?this.edgeType=new lx(this.options,this.body,this.labelModule):this.edgeType=new Ix(this.options,this.body,this.labelModule):this.edgeType=new cx(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),t}connect(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=this.from!==void 0&&this.to!==void 0,this.connected===!0?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}disconnect(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}getTitle(){return this.title}isSelected(){return this.selected}getValue(){return this.options.value}setValueRange(e,t,i){if(this.options.value!==void 0){const o=this.options.scaling.customScalingFunction(e,t,i,this.options.value),r=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){const A=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+o*A}this.options.width=this.options.scaling.min+o*r}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}_setInteractionWidths(){typeof this.options.hoverWidth=="function"?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,typeof this.options.selectionWidth=="function"?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}draw(e){const t=this.getFormattingValues();if(t.hidden)return;const i=this.edgeType.getViaNode();this.edgeType.drawLine(e,t,this.selected,this.hover,i),this.drawLabel(e,i)}drawArrows(e){const t=this.getFormattingValues();if(t.hidden)return;const i=this.edgeType.getViaNode(),o={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,t.fromArrow&&(o.from=this.edgeType.getArrowData(e,"from",i,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.fromPoint=o.from.core),t.fromArrowSrc&&(o.from.image=this.imagelist.load(t.fromArrowSrc)),t.fromArrowImageWidth&&(o.from.imageWidth=t.fromArrowImageWidth),t.fromArrowImageHeight&&(o.from.imageHeight=t.fromArrowImageHeight)),t.toArrow&&(o.to=this.edgeType.getArrowData(e,"to",i,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.toPoint=o.to.core),t.toArrowSrc&&(o.to.image=this.imagelist.load(t.toArrowSrc)),t.toArrowImageWidth&&(o.to.imageWidth=t.toArrowImageWidth),t.toArrowImageHeight&&(o.to.imageHeight=t.toArrowImageHeight)),t.middleArrow&&(o.middle=this.edgeType.getArrowData(e,"middle",i,this.selected,this.hover,t),t.middleArrowSrc&&(o.middle.image=this.imagelist.load(t.middleArrowSrc)),t.middleArrowImageWidth&&(o.middle.imageWidth=t.middleArrowImageWidth),t.middleArrowImageHeight&&(o.middle.imageHeight=t.middleArrowImageHeight)),t.fromArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,o.from),t.middleArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,o.middle),t.toArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,o.to)}drawLabel(e,t){if(this.options.label!==void 0){const i=this.from,o=this.to;this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover);let r;if(i.id!=o.id){this.labelModule.pointToSelf=!1,r=this.edgeType.getPoint(.5,t),e.save();const A=this._getRotation(e);A.angle!=0&&(e.translate(A.x,A.y),e.rotate(A.angle)),this.labelModule.draw(e,r.x,r.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;const A=$w(e,this.options.selfReference.angle,this.options.selfReference.size,i);r=this._pointOnCircle(A.x,A.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(e,r.x,r.y,this.selected,this.hover)}}}getItemsOnPoint(e){const t=[];if(this.labelModule.visible()){const o=this._getRotation();Ou(this.labelModule.getSize(),e,o)&&t.push({edgeId:this.id,labelId:0})}const i={left:e.x,top:e.y};return this.isOverlappingWith(i)&&t.push({edgeId:this.id}),t}isOverlappingWith(e){if(this.connected){const i=this.from.x,o=this.from.y,r=this.to.x,A=this.to.y,I=e.left,l=e.top;return this.edgeType.getDistanceToEdge(i,o,r,A,I,l)<10}else return!1}_getRotation(e){const t=this.edgeType.getViaNode(),i=this.edgeType.getPoint(.5,t);e!==void 0&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,i.x,i.y);const o={x:i.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible()||this.options.font.align==="horizontal")return o;const r=this.from.y-this.to.y,A=this.from.x-this.to.x;let I=Math.atan2(r,A);return(I<-1&&A<0||I>0&&A<0)&&(I+=Math.PI),o.angle=I,o}_pointOnCircle(e,t,i,o){return{x:e+i*Math.cos(o),y:t-i*Math.sin(o)}}select(){this.selected=!0}unselect(){this.selected=!1}cleanup(){return this.edgeType.cleanup()}remove(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}endPointsValid(){return this.body.nodes[this.fromId]!==void 0&&this.body.nodes[this.toId]!==void 0}}class S${constructor(e,t,i){var o;this.body=e,this.images=t,this.groups=i,this.body.functions.createEdge=ge(o=this.create).call(o,this),this.edgesListeners={add:(r,A)=>{this.add(A.items)},update:(r,A)=>{this.update(A.items)},remove:(r,A)=>{this.remove(A.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1,type:"arrow"},middle:{enabled:!1,scaleFactor:1,type:"arrow"},from:{enabled:!1,scaleFactor:1,type:"arrow"}},endPointOffset:{from:0,to:0},arrowStrikethrough:!0,color:{color:"#848484",highlight:"#848484",hover:"#848484",inherit:"from",opacity:1},dashes:!1,font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:2,strokeColor:"#ffffff",align:"horizontal",multi:!1,vadjust:0,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"courier new",vadjust:2}},hidden:!1,hoverWidth:1.5,label:void 0,labelHighlightBold:!0,length:void 0,physics:!0,scaling:{min:1,max:15,label:{enabled:!0,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(r,A,I,l){if(A===r)return .5;{const c=1/(A-r);return Math.max(0,(l-r)*c)}}},selectionWidth:1.5,selfReference:{size:20,angle:Math.PI/4,renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},background:{enabled:!1,color:"rgba(111,111,111,1)",size:10,dashes:!1},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},vt(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e=this,t,i;this.body.emitter.on("_forceDisableDynamicCurves",function(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;o==="dynamic"&&(o="continuous");let A=!1;for(const I in e.body.edges)if(Object.prototype.hasOwnProperty.call(e.body.edges,I)){const l=e.body.edges[I],c=e.body.data.edges.get(I);if(c!=null){const h=c.smooth;h!==void 0&&h.enabled===!0&&h.type==="dynamic"&&(o===void 0?l.setOptions({smooth:!1}):l.setOptions({smooth:{type:o}}),A=!0)}}r===!0&&A===!0&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",()=>{this.reconnectEdges()}),this.body.emitter.on("refreshEdges",ge(t=this.refresh).call(t,this)),this.body.emitter.on("refresh",ge(i=this.refresh).call(i,this)),this.body.emitter.on("destroy",()=>{Ke(this.edgesListeners,(o,r)=>{this.body.data.edges&&this.body.data.edges.off(r,o)}),delete this.body.functions.createEdge,delete this.edgesListeners.add,delete this.edgesListeners.update,delete this.edgesListeners.remove,delete this.edgesListeners})}setOptions(e){if(e!==void 0){Lg.parseOptions(this.options,e,!0,this.defaultOptions,!0);let t=!1;if(e.smooth!==void 0)for(const i in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,i)&&(t=this.body.edges[i].updateEdgeType()||t);if(e.font!==void 0)for(const i in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,i)&&this.body.edges[i].updateLabelModule();(e.hidden!==void 0||e.physics!==void 0||t===!0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.body.data.edges;if(Yw("id",e))this.body.data.edges=e;else if(tt(e))this.body.data.edges=new Fs,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new Fs;else throw new TypeError("Array or DataSet expected");if(i&&Ke(this.edgesListeners,(o,r)=>{i.off(r,o)}),this.body.edges={},this.body.data.edges){Ke(this.edgesListeners,(r,A)=>{this.body.data.edges.on(A,r)});const o=this.body.data.edges.getIds();this.add(o,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),t===!1&&this.body.emitter.emit("_dataChanged")}add(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.body.edges,o=this.body.data.edges;for(let r=0;r1&&arguments[1]!==void 0?arguments[1]:!0;if(e.length===0)return;const i=this.body.edges;Ke(e,o=>{const r=i[o];r!==void 0&&r.remove()}),t&&this.body.emitter.emit("_dataChanged")}refresh(){Ke(this.body.edges,(e,t)=>{const i=this.body.data.edges.get(t);i!==void 0&&e.setOptions(i)})}create(e){return new Lg(e,this.body,this.images,this.options,this.defaultOptions)}reconnectEdges(){let e;const t=this.body.nodes,i=this.body.edges;for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(t[e].edges=[]);for(e in i)if(Object.prototype.hasOwnProperty.call(i,e)){const o=i[e];o.from=null,o.to=null,o.connect()}}getConnectedNodes(e){const t=[];if(this.body.edges[e]!==void 0){const i=this.body.edges[e];i.fromId!==void 0&&t.push(i.fromId),i.toId!==void 0&&t.push(i.toId)}return t}_updateState(){this._addMissingEdges(),this._removeInvalidEdges()}_removeInvalidEdges(){const e=[];Ke(this.body.edges,(t,i)=>{const o=this.body.nodes[t.toId],r=this.body.nodes[t.fromId];o!==void 0&&o.isCluster===!0||r!==void 0&&r.isCluster===!0||(o===void 0||r===void 0)&&e.push(i)}),this.remove(e,!1)}_addMissingEdges(){const e=this.body.data.edges;if(e==null)return;const t=this.body.edges,i=[];et(e).call(e,(o,r)=>{t[r]===void 0&&i.push(r)}),this.add(i,!0)}}class dx{constructor(e,t,i){this.body=e,this.physicsBody=t,this.barnesHutTree,this.setOptions(i),this._rng=FC("BARNES HUT SOLVER")}setOptions(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}solve(){if(this.options.gravitationalConstant!==0&&this.physicsBody.physicsNodeIndices.length>0){let e;const t=this.body.nodes,i=this.physicsBody.physicsNodeIndices,o=i.length,r=this._formBarnesHutTree(t,i);this.barnesHutTree=r;for(let A=0;A0&&this._getForceContributions(r.root,e)}}_getForceContributions(e,t){this._getForceContribution(e.children.NW,t),this._getForceContribution(e.children.NE,t),this._getForceContribution(e.children.SW,t),this._getForceContribution(e.children.SE,t)}_getForceContribution(e,t){if(e.childrenCount>0){const i=e.centerOfMass.x-t.x,o=e.centerOfMass.y-t.y,r=Math.sqrt(i*i+o*o);r*e.calcSize>this.thetaInversed?this._calculateForces(r,i,o,t,e):e.childrenCount===4?this._getForceContributions(e,t):e.children.data.id!=t.id&&this._calculateForces(r,i,o,t,e)}}_calculateForces(e,t,i,o,r){e===0&&(e=.1,t=e),this.overlapAvoidanceFactor<1&&o.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*o.shape.radius,e-o.shape.radius));const A=this.options.gravitationalConstant*r.mass*o.options.mass/Math.pow(e,3),I=t*A,l=i*A;this.physicsBody.forces[o.id].x+=I,this.physicsBody.forces[o.id].y+=l}_formBarnesHutTree(e,t){let i;const o=t.length;let r=e[t[0]].x,A=e[t[0]].y,I=e[t[0]].x,l=e[t[0]].y;for(let x=1;x0&&(EI&&(I=E),Rl&&(l=R))}const c=Math.abs(I-r)-Math.abs(l-A);c>0?(A-=.5*c,l+=.5*c):(r+=.5*c,I-=.5*c);const p=Math.max(1e-5,Math.abs(I-r)),m=.5*p,b=.5*(r+I),w=.5*(A+l),S={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:b-m,maxX:b+m,minY:w-m,maxY:w+m},size:p,calcSize:1/p,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(S.root);for(let x=0;x0&&this._placeInTree(S.root,i);return S}_updateBranchMass(e,t){const i=e.centerOfMass,o=e.mass+t.options.mass,r=1/o;i.x=i.x*e.mass+t.x*t.options.mass,i.x*=r,i.y=i.y*e.mass+t.y*t.options.mass,i.y*=r,e.mass=o;const A=Math.max(Math.max(t.height,t.radius),t.width);e.maxWidth=e.maxWidtht.x?o.maxY>t.y?r="NW":r="SW":o.maxY>t.y?r="NE":r="SE",this._placeInRegion(e,t,r)}_placeInRegion(e,t,i){const o=e.children[i];switch(o.childrenCount){case 0:o.children.data=t,o.childrenCount=1,this._updateBranchMass(o,t);break;case 1:o.children.data.x===t.x&&o.children.data.y===t.y?(t.x+=this._rng(),t.y+=this._rng()):(this._splitBranch(o),this._placeInTree(o,t));break;case 4:this._placeInTree(o,t);break}}_splitBranch(e){let t=null;e.childrenCount===1&&(t=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,"NW"),this._insertRegion(e,"NE"),this._insertRegion(e,"SW"),this._insertRegion(e,"SE"),t!=null&&this._placeInTree(e,t)}_insertRegion(e,t){let i,o,r,A;const I=.5*e.size;switch(t){case"NW":i=e.range.minX,o=e.range.minX+I,r=e.range.minY,A=e.range.minY+I;break;case"NE":i=e.range.minX+I,o=e.range.maxX,r=e.range.minY,A=e.range.minY+I;break;case"SW":i=e.range.minX,o=e.range.minX+I,r=e.range.minY+I,A=e.range.maxY;break;case"SE":i=e.range.minX+I,o=e.range.maxX,r=e.range.minY+I,A=e.range.maxY;break}e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:i,maxX:o,minY:r,maxY:A},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}_debug(e,t){this.barnesHutTree!==void 0&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}_drawBranch(e,t,i){i===void 0&&(i="#FF0000"),e.childrenCount===4&&(this._drawBranch(e.children.NW,t),this._drawBranch(e.children.NE,t),this._drawBranch(e.children.SE,t),this._drawBranch(e.children.SW,t)),t.strokeStyle=i,t.beginPath(),t.moveTo(e.range.minX,e.range.minY),t.lineTo(e.range.maxX,e.range.minY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.minY),t.lineTo(e.range.maxX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.maxY),t.lineTo(e.range.minX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.minX,e.range.maxY),t.lineTo(e.range.minX,e.range.minY),t.stroke()}}class E${constructor(e,t,i){this._rng=FC("REPULSION SOLVER"),this.body=e,this.physicsBody=t,this.setOptions(i)}setOptions(e){this.options=e}solve(){let e,t,i,o,r,A,I,l;const c=this.body.nodes,h=this.physicsBody.physicsNodeIndices,p=this.physicsBody.forces,m=this.options.nodeDistance,b=-2/3/m,w=4/3;for(let S=0;S0){const A=r.edges.length+1,I=this.options.centralGravity*A*r.options.mass;o[r.id].x=t*I,o[r.id].y=i*I}}}class M${constructor(e){this.body=e,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:"barnesHut",stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0,wind:{x:0,y:0}},Ut(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("initPhysics",()=>{this.initPhysics()}),this.body.emitter.on("_layoutFailed",()=>{this.layoutFailed=!0}),this.body.emitter.on("resetPhysics",()=>{this.stopSimulation(),this.ready=!1}),this.body.emitter.on("disablePhysics",()=>{this.physicsEnabled=!1,this.stopSimulation()}),this.body.emitter.on("restorePhysics",()=>{this.setOptions(this.options),this.ready===!0&&this.startSimulation()}),this.body.emitter.on("startSimulation",()=>{this.ready===!0&&this.startSimulation()}),this.body.emitter.on("stopSimulation",()=>{this.stopSimulation()}),this.body.emitter.on("destroy",()=>{this.stopSimulation(!1),this.body.emitter.off()}),this.body.emitter.on("_dataChanged",()=>{this.updatePhysicsData()})}setOptions(e){if(e!==void 0)if(e===!1)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(e===!0)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,VC(["stabilization"],this.options,e),ri(this.options,e,"stabilization"),e.enabled===void 0&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation());const t=this.options.wind;t&&((typeof t.x!="number"||cu(t.x))&&(t.x=0),(typeof t.y!="number"||cu(t.y))&&(t.y=0)),this.timestep=this.options.timestep}this.init()}init(){let e;this.options.solver==="forceAtlas2Based"?(e=this.options.forceAtlas2Based,this.nodesSolver=new N$(this.body,this.physicsBody,e),this.edgesSolver=new Mu(this.body,this.physicsBody,e),this.gravitySolver=new D$(this.body,this.physicsBody,e)):this.options.solver==="repulsion"?(e=this.options.repulsion,this.nodesSolver=new E$(this.body,this.physicsBody,e),this.edgesSolver=new Mu(this.body,this.physicsBody,e),this.gravitySolver=new iI(this.body,this.physicsBody,e)):this.options.solver==="hierarchicalRepulsion"?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new T$(this.body,this.physicsBody,e),this.edgesSolver=new O$(this.body,this.physicsBody,e),this.gravitySolver=new iI(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new dx(this.body,this.physicsBody,e),this.edgesSolver=new Mu(this.body,this.physicsBody,e),this.gravitySolver=new iI(this.body,this.physicsBody,e)),this.modelOptions=e}initPhysics(){this.physicsEnabled===!0&&this.options.enabled===!0?this.options.stabilization.enabled===!0?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}startSimulation(){if(this.physicsEnabled===!0&&this.options.enabled===!0){if(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),this.viewFunction===void 0){var e;this.viewFunction=ge(e=this.simulationStep).call(e,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}else this.body.emitter.emit("_redraw")}stopSimulation(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.stabilized=!0,e===!0&&this._emitStabilized(),this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,e===!0&&this.body.emitter.emit("_stopRendering"))}simulationStep(){const e=MC();this.physicsTick(),(MC()-e<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}_emitStabilized(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&_i(()=>{this.body.emitter.emit("stabilized",{iterations:e}),this.startedStabilization=!1,this.stabilizationIterations=0},0)}physicsStep(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}adjustTimeStep(){this._evaluateStepQuality()===!0?this.timestep=1.2*this.timestep:this.timestep/1.2A))return!1;return!0}moveNodes(){const e=this.physicsBody.physicsNodeIndices;let t=0,i=0;const o=5;for(let r=0;rA&&(e=e>0?A:-A),e}_performStep(e){const t=this.body.nodes[e],i=this.physicsBody.forces[e];this.options.wind&&(i.x+=this.options.wind.x,i.y+=this.options.wind.y);const o=this.physicsBody.velocities[e];return this.previousStates[e]={x:t.x,y:t.y,vx:o.x,vy:o.y},t.options.fixed.x===!1?(o.x=this.calculateComponentVelocity(o.x,i.x,t.options.mass),t.x+=o.x*this.timestep):(i.x=0,o.x=0),t.options.fixed.y===!1?(o.y=this.calculateComponentVelocity(o.y,i.y,t.options.mass),t.y+=o.y*this.timestep):(i.y=0,o.y=0),Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2))}_freezeNodes(){const e=this.body.nodes;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t].x&&e[t].y){const i=e[t].options.fixed;this.freezeCache[t]={x:i.x,y:i.y},i.x=!0,i.y=!0}}_restoreFrozenNodes(){const e=this.body.nodes;for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.freezeCache[t]!==void 0&&(e[t].options.fixed.x=this.freezeCache[t].x,e[t].options.fixed.y=this.freezeCache[t].y);this.freezeCache={}}stabilize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.stabilization.iterations;if(typeof e!="number"&&(e=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",e)),this.physicsBody.physicsNodeIndices.length===0){this.ready=!0;return}this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=e,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,_i(()=>this._stabilizationBatch(),0)}_startStabilizing(){return this.startedStabilization===!0?!1:(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}_stabilizationBatch(){const e=()=>this.stabilized===!1&&this.stabilizationIterations{this.body.emitter.emit("stabilizationProgress",{iterations:this.stabilizationIterations,total:this.targetIterations})};this._startStabilizing()&&t();let i=0;for(;e()&&i1&&arguments[1]!==void 0?arguments[1]:[],i=1e9,o=-1e9,r=1e9,A=-1e9,I;if(t.length>0)for(let l=0;lI.shape.boundingBox.left&&(r=I.shape.boundingBox.left),AI.shape.boundingBox.top&&(i=I.shape.boundingBox.top),o1&&arguments[1]!==void 0?arguments[1]:[],i=1e9,o=-1e9,r=1e9,A=-1e9,I;if(t.length>0)for(let l=0;lI.x&&(r=I.x),AI.y&&(i=I.y),o{delete this.containedEdges[i.id]}),Ke(t.containedNodes,(i,o)=>{this.containedNodes[o]=i}),t.containedNodes={},Ke(t.containedEdges,(i,o)=>{this.containedEdges[o]=i}),t.containedEdges={},Ke(t.edges,i=>{Ke(this.edges,o=>{var r,A;const I=At(r=o.clusteringEdgeReplacingIds).call(r,i.id);I!==-1&&(Ke(i.clusteringEdgeReplacingIds,l=>{o.clusteringEdgeReplacingIds.push(l),this.body.edges[l].edgeReplacedById=o.id}),Ri(A=o.clusteringEdgeReplacingIds).call(A,I,1))})}),t.edges=[]}}class k${constructor(e){this.body=e,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},Ut(this.options,this.defaultOptions),this.body.emitter.on("_resetData",()=>{this.clusteredNodes={},this.clusteredEdges={}})}clusterByHubsize(e,t){e===void 0?e=this._getHubSize():typeof e=="object"&&(t=this._checkOptions(e),e=this._getHubSize());const i=[];for(let o=0;o=e&&i.push(r.id)}for(let o=0;o0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.joinCondition===void 0)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");e=this._checkOptions(e);const i={},o={};Ke(this.body.nodes,(r,A)=>{r.options&&e.joinCondition(r.options)===!0&&(i[A]=r,Ke(r.edges,I=>{this.clusteredEdges[I.id]===void 0&&(o[I.id]=I)}))}),this._cluster(i,o,e,t)}clusterByEdgeCount(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;t=this._checkOptions(t);const o=[],r={};let A,I,l;for(let c=0;c0&&xt(p).length>0&&S===!0){const O=function(){for(let E=0;E1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(1,e,t)}clusterBridges(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(2,e,t)}clusterByConnection(e,t){var i;let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No nodeId supplied to clusterByConnection!");if(this.body.nodes[e]===void 0)throw new Error("The nodeId given to clusterByConnection does not exist!");const r=this.body.nodes[e];t=this._checkOptions(t,r),t.clusterNodeProperties.x===void 0&&(t.clusterNodeProperties.x=r.x),t.clusterNodeProperties.y===void 0&&(t.clusterNodeProperties.y=r.y),t.clusterNodeProperties.fixed===void 0&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=r.options.fixed.x,t.clusterNodeProperties.fixed.y=r.options.fixed.y);const A={},I={},l=r.id,c=Dn.cloneOptions(r);A[l]=r;for(let p=0;p-1&&(I[w.id]=w)}}this._cluster(A,I,t,o)}_createClusterEdges(e,t,i,o){let r,A,I,l,c,h;const p=xt(e),m=[];for(let S=0;S0&&arguments[0]!==void 0?arguments[0]:{};return e.clusterEdgeProperties===void 0&&(e.clusterEdgeProperties={}),e.clusterNodeProperties===void 0&&(e.clusterNodeProperties={}),e}_cluster(e,t,i){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;const r=[];for(const h in e)Object.prototype.hasOwnProperty.call(e,h)&&this.clusteredNodes[h]!==void 0&&r.push(h);for(let h=0;ho?I.x:o,r=I.yA?I.y:A;return{x:.5*(i+o),y:.5*(r+A)}}openCluster(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No clusterNodeId supplied to openCluster.");const o=this.body.nodes[e];if(o===void 0)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(o.isCluster!==!0||o.containedNodes===void 0||o.containedEdges===void 0)throw new Error("The node:"+e+" is not a valid cluster.");const r=this.findNode(e),A=At(r).call(r,e)-1;if(A>=0){const h=r[A];this.body.nodes[h]._openChildCluster(e),delete this.body.nodes[e],i===!0&&this.body.emitter.emit("_dataChanged");return}const I=o.containedNodes,l=o.containedEdges;if(t!==void 0&&t.releaseFunction!==void 0&&typeof t.releaseFunction=="function"){const h={},p={x:o.x,y:o.y};for(const b in I)if(Object.prototype.hasOwnProperty.call(I,b)){const w=this.body.nodes[b];h[b]={x:w.x,y:w.y}}const m=t.releaseFunction(p,h);for(const b in I)if(Object.prototype.hasOwnProperty.call(I,b)){const w=this.body.nodes[b];m[b]!==void 0&&(w.x=m[b].x===void 0?o.x:m[b].x,w.y=m[b].y===void 0?o.y:m[b].y)}}else Ke(I,function(h){h.options.fixed.x===!1&&(h.x=o.x),h.options.fixed.y===!1&&(h.y=o.y)});for(const h in I)if(Object.prototype.hasOwnProperty.call(I,h)){const p=this.body.nodes[h];p.vx=o.vx,p.vy=o.vy,p.setOptions({physics:!0}),delete this.clusteredNodes[h]}const c=[];for(let h=0;h0&&Ao&&(o=c.edges.length),e+=c.edges.length,t+=Math.pow(c.edges.length,2),i+=1}e=e/i,t=t/i;const r=t-Math.pow(e,2),A=Math.sqrt(r);let I=Math.floor(e+2*A);return I>o&&(I=o),I}_createClusteredEdge(e,t,i,o,r){const A=Dn.cloneOptions(i,"edge");vt(A,o),A.from=e,A.to=t,A.id="clusterEdge:"+Gs(),r!==void 0&&vt(A,r);const I=this.body.functions.createEdge(A);return I.clusteringEdgeReplacingIds=[i.id],I.connect(),this.body.edges[I.id]=I,I}_clusterEdges(e,t,i,o){if(t instanceof Lg){const r=t,A={};A[r.id]=r,t=A}if(e instanceof Nt){const r=e,A={};A[r.id]=r,e=A}if(i==null)throw new Error("_clusterEdges: parameter clusterNode required");o===void 0&&(o=i.clusterEdgeProperties),this._createClusterEdges(e,t,i,o);for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&this.body.edges[r]!==void 0){const A=this.body.edges[r];this._backupEdgeOptions(A),A.setOptions({physics:!1})}for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(this.clusteredNodes[r]={clusterId:i.id,node:this.body.nodes[r]},this.body.nodes[r].setOptions({physics:!1}))}_getClusterNodeForNode(e){if(e===void 0)return;const t=this.clusteredNodes[e];if(t===void 0)return;const i=t.clusterId;if(i!==void 0)return this.body.nodes[i]}_filter(e,t){const i=[];return Ke(e,o=>{t(o)&&i.push(o)}),i}_updateState(){let e;const t=[],i={},o=l=>{Ke(this.body.nodes,c=>{c.isCluster===!0&&l(c)})};for(e in this.clusteredNodes){if(!Object.prototype.hasOwnProperty.call(this.clusteredNodes,e))continue;this.body.nodes[e]===void 0&&t.push(e)}o(function(l){for(let c=0;c{const c=this.body.edges[l];(c===void 0||!c.endPointsValid())&&(i[l]=l)}),o(function(l){Ke(l.containedEdges,(c,h)=>{!c.endPointsValid()&&!i[h]&&(i[h]=h)})}),Ke(this.body.edges,(l,c)=>{let h=!0;const p=l.clusteringEdgeReplacingIds;if(p!==void 0){let m=0;Ke(p,b=>{const w=this.body.edges[b];w!==void 0&&w.endPointsValid()&&(m+=1)}),h=m>0}(!l.endPointsValid()||!h)&&(i[c]=c)}),o(l=>{Ke(i,c=>{delete l.containedEdges[c],Ke(l.edges,(h,p)=>{if(h.id===c){l.edges[p]=null;return}h.clusteringEdgeReplacingIds=this._filter(h.clusteringEdgeReplacingIds,function(m){return!i[m]})}),l.edges=this._filter(l.edges,function(h){return h!==null})})}),Ke(i,l=>{delete this.clusteredEdges[l]}),Ke(i,l=>{delete this.body.edges[l]});const r=xt(this.body.edges);Ke(r,l=>{const c=this.body.edges[l],h=this._isClusteredNode(c.fromId)||this._isClusteredNode(c.toId);if(h!==this._isClusteredEdge(c.id))if(h){const p=this._getClusterNodeForNode(c.fromId);p!==void 0&&this._clusterEdges(this.body.nodes[c.fromId],c,p);const m=this._getClusterNodeForNode(c.toId);m!==void 0&&this._clusterEdges(this.body.nodes[c.toId],c,m)}else delete this._clusterEdges[l],this._restoreEdge(c)});let A=!1,I=!0;for(;I;){const l=[];o(function(c){const h=xt(c.containedNodes).length,p=c.options.allowSingleNodeCluster===!0;(p&&h<1||!p&&h<2)&&l.push(c.id)});for(let c=0;c0,A=A||I}A&&this._updateState()}_isClusteredNode(e){return this.clusteredNodes[e]!==void 0}_isClusteredEdge(e){return this.clusteredEdges[e]!==void 0}}class R${constructor(e,t){this.body=e,this.canvas=t,this.redrawRequested=!1,this.requestAnimationFrameRequestId=void 0,this.renderingActive=!1,this.renderRequests=0,this.allowRedraw=!0,this.dragging=!1,this.zooming=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1},Ut(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.on("dragStart",()=>{this.dragging=!0}),this.body.emitter.on("dragEnd",()=>{this.dragging=!1}),this.body.emitter.on("zoom",()=>{this.zooming=!0,window.clearTimeout(this.zoomTimeoutId),this.zoomTimeoutId=_i(()=>{var t;this.zooming=!1,ge(t=this._requestRedraw).call(t,this)()},250)}),this.body.emitter.on("_resizeNodes",()=>{this._resizeNodes()}),this.body.emitter.on("_redraw",()=>{this.renderingActive===!1&&this._redraw()}),this.body.emitter.on("_blockRedraw",()=>{this.allowRedraw=!1}),this.body.emitter.on("_allowRedraw",()=>{this.allowRedraw=!0,this.redrawRequested=!1}),this.body.emitter.on("_requestRedraw",ge(e=this._requestRedraw).call(e,this)),this.body.emitter.on("_startRendering",()=>{this.renderRequests+=1,this.renderingActive=!0,this._startRendering()}),this.body.emitter.on("_stopRendering",()=>{this.renderRequests-=1,this.renderingActive=this.renderRequests>0,this.requestAnimationFrameRequestId=void 0}),this.body.emitter.on("destroy",()=>{this.renderRequests=0,this.allowRedraw=!1,this.renderingActive=!1,window.cancelAnimationFrame(this.requestAnimationFrameRequestId),this.body.emitter.off()})}setOptions(e){e!==void 0&&_s(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,e)}_startRendering(){if(this.renderingActive===!0&&this.requestAnimationFrameRequestId===void 0){var e;this.requestAnimationFrameRequestId=window.requestAnimationFrame(ge(e=this._renderStep).call(e,this),this.simulationInterval)}}_renderStep(){this.renderingActive===!0&&(this.requestAnimationFrameRequestId=void 0,this._startRendering(),this._redraw())}redraw(){this.body.emitter.emit("setSize"),this._redraw()}_requestRedraw(){this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,window.requestAnimationFrame(()=>{this._redraw(!1)}))}_redraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;const t={drawExternalLabels:null};(this.canvas.frame.canvas.width===0||this.canvas.frame.canvas.height===0)&&this.canvas.setSize(),this.canvas.setTransform();const i=this.canvas.getContext(),o=this.canvas.frame.canvas.clientWidth,r=this.canvas.frame.canvas.clientHeight;if(i.clearRect(0,0,o,r),this.canvas.frame.clientWidth===0)return;if(i.save(),i.translate(this.body.view.translation.x,this.body.view.translation.y),i.scale(this.body.view.scale,this.body.view.scale),i.beginPath(),this.body.emitter.emit("beforeDrawing",i),i.closePath(),e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawEdges(i),this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1){const{drawExternalLabels:A}=this._drawNodes(i,e);t.drawExternalLabels=A}e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawArrows(i),t.drawExternalLabels!=null&&t.drawExternalLabels(),e===!1&&this._drawSelectionBox(i),i.beginPath(),this.body.emitter.emit("afterDrawing",i),i.closePath(),i.restore(),e===!0&&i.clearRect(0,0,o,r)}}_resizeNodes(){this.canvas.setTransform();const e=this.canvas.getContext();e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);const t=this.body.nodes;let i;for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(i=t[o],i.resize(e),i.updateBoundingBox(e,i.selected));e.restore()}_drawNodes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.body.nodes,o=this.body.nodeIndices;let r;const A=[],I=[],l=20,c=this.canvas.DOMtoCanvas({x:-l,y:-l}),h=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+l,y:this.canvas.frame.canvas.clientHeight+l}),p={top:c.y,left:c.x,bottom:h.y,right:h.x},m=[];for(let x=0;x{for(const x of m)x()}}}_drawEdges(e){const t=this.body.edges,i=this.body.edgeIndices;for(let o=0;o{t.width!==0&&(this.body.view.translation.x=t.width*.5),t.height!==0&&(this.body.view.translation.y=t.height*.5)}),this.body.emitter.on("setSize",ge(e=this.setSize).call(e,this)),this.body.emitter.on("destroy",()=>{this.hammerFrame.destroy(),this.hammer.destroy(),this._cleanUp()})}setOptions(e){if(e!==void 0&&_s(["width","height","autoResize"],this.options,e),this._cleanUp(),this.options.autoResize===!0){var t;if(window.ResizeObserver){const o=new ResizeObserver(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")}),{frame:r}=this;o.observe(r),this._cleanupCallbacks.push(()=>{o.unobserve(r)})}else{const o=B$(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")},1e3);this._cleanupCallbacks.push(()=>{clearInterval(o)})}const i=ge(t=this._onResize).call(t,this);window.addEventListener("resize",i),this._cleanupCallbacks.push(()=>{window.removeEventListener("resize",i)})}}_cleanUp(){var e,t,i;et(e=To(t=Ri(i=this._cleanupCallbacks).call(i,0)).call(t)).call(e,o=>{try{o()}catch(r){console.error(r)}})}_onResize(){this.setSize(),this.body.emitter.emit("_redraw")}_getCameraState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.pixelRatio;this.initialized===!0&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}_setCameraState(){if(this.cameraState.scale!==void 0&&this.frame.canvas.clientWidth!==0&&this.frame.canvas.clientHeight!==0&&this.pixelRatio!==0&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){const e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight;let i=this.cameraState.scale;e!=1&&t!=1?i=this.cameraState.scale*.5*(e+t):e!=1?i=this.cameraState.scale*e:t!=1&&(i=this.cameraState.scale*t),this.body.view.scale=i;const o=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),r={x:o.x-this.cameraState.position.x,y:o.y-this.cameraState.position.y};this.body.view.translation.x+=r.x*this.body.view.scale,this.body.view.translation.y+=r.y*this.body.view.scale}}_prepareValue(e){if(typeof e=="number")return e+"px";if(typeof e=="string"){if(At(e).call(e,"%")!==-1||At(e).call(e,"px")!==-1)return e;if(At(e).call(e,"%")===-1)return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}_create(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=0,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext)this._setPixelRatio(),this.setTransform();else{const e=document.createElement("DIV");e.style.color="red",e.style.fontWeight="bold",e.style.padding="10px",e.innerText="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(e)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}_bindHammer(){this.hammer!==void 0&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new js(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:js.DIRECTION_ALL}),gI(this.hammer,e=>{this.body.eventListeners.onTouch(e)}),this.hammer.on("tap",e=>{this.body.eventListeners.onTap(e)}),this.hammer.on("doubletap",e=>{this.body.eventListeners.onDoubleTap(e)}),this.hammer.on("press",e=>{this.body.eventListeners.onHold(e)}),this.hammer.on("panstart",e=>{this.body.eventListeners.onDragStart(e)}),this.hammer.on("panmove",e=>{this.body.eventListeners.onDrag(e)}),this.hammer.on("panend",e=>{this.body.eventListeners.onDragEnd(e)}),this.hammer.on("pinch",e=>{this.body.eventListeners.onPinch(e)}),this.frame.canvas.addEventListener("wheel",e=>{this.body.eventListeners.onMouseWheel(e)}),this.frame.canvas.addEventListener("mousemove",e=>{this.body.eventListeners.onMouseMove(e)}),this.frame.canvas.addEventListener("contextmenu",e=>{this.body.eventListeners.onContext(e)}),this.hammerFrame=new js(this.frame),ux(this.hammerFrame,e=>{this.body.eventListeners.onRelease(e)})}setSize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.width,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.height;e=this._prepareValue(e),t=this._prepareValue(t);let i=!1;const o=this.frame.canvas.width,r=this.frame.canvas.height,A=this.pixelRatio;if(this._setPixelRatio(),e!=this.options.width||t!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=t)this._getCameraState(A),this.frame.style.width=e,this.frame.style.height=t,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=e,this.options.height=t,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},i=!0;else{const I=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),l=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==I||this.frame.canvas.height!==l)&&this._getCameraState(A),this.frame.canvas.width!==I&&(this.frame.canvas.width=I,i=!0),this.frame.canvas.height!==l&&(this.frame.canvas.height=l,i=!0)}return i===!0&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(o/this.pixelRatio),oldHeight:Math.round(r/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,i}getContext(){return this.frame.canvas.getContext("2d")}_determinePixelRatio(){const e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");let t=1;typeof window<"u"&&(t=window.devicePixelRatio||1);const i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/i}_setPixelRatio(){this.pixelRatio=this._determinePixelRatio()}setTransform(){const e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}_XconvertDOMtoCanvas(e){return(e-this.body.view.translation.x)/this.body.view.scale}_XconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.x}_YconvertDOMtoCanvas(e){return(e-this.body.view.translation.y)/this.body.view.scale}_YconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.y}canvasToDOM(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}DOMtoCanvas(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}}function L$(n,e){const t=Ut({nodes:e,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},n??{});if(!tt(t.nodes))throw new TypeError("Nodes has to be an array of ids.");if(t.nodes.length===0&&(t.nodes=e),!(typeof t.minZoomLevel=="number"&&t.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!(typeof t.maxZoomLevel=="number"&&t.minZoomLevel<=t.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return t}class G${constructor(e,t){var i,o;this.body=e,this.canvas=t,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction="easeInOutQuint",this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on("fit",ge(i=this.fit).call(i,this)),this.body.emitter.on("animationFinished",()=>{this.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",ge(o=this.releaseNode).call(o,this))}setOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=e}fit(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;e=L$(e,this.body.nodeIndices);const i=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;let r,A;if(i===0||o===0)A=1,r=Dn.getRange(this.body.nodes,e.nodes);else if(t===!0){let c=0;for(const m in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,m)&&this.body.nodes[m].predefinedPosition===!0&&(c+=1);if(c>.5*this.body.nodeIndices.length){this.fit(e,!1);return}r=Dn.getRange(this.body.nodes,e.nodes),A=12.662/(this.body.nodeIndices.length+7.4147)+.0964822;const p=Math.min(i/600,o/600);A*=p}else{this.body.emitter.emit("_resizeNodes"),r=Dn.getRange(this.body.nodes,e.nodes);const c=Math.abs(r.maxX-r.minX)*1.1,h=Math.abs(r.maxY-r.minY)*1.1,p=i/c,m=o/h;A=p<=m?p:m}A>e.maxZoomLevel?A=e.maxZoomLevel:A1&&arguments[1]!==void 0?arguments[1]:{};if(this.body.nodes[e]!==void 0){const i={x:this.body.nodes[e].x,y:this.body.nodes[e].y};t.position=i,t.lockedOnNode=e,this.moveTo(t)}else console.error("Node: "+e+" cannot be found.")}moveTo(e){if(e===void 0){e={};return}if(e.offset!=null){if(e.offset.x!=null){if(e.offset.x=+e.offset.x,!jo(e.offset.x))throw new TypeError('The option "offset.x" has to be a finite number.')}else e.offset.x=0;if(e.offset.y!=null){if(e.offset.y=+e.offset.y,!jo(e.offset.y))throw new TypeError('The option "offset.y" has to be a finite number.')}else e.offset.x=0}else e.offset={x:0,y:0};if(e.position!=null){if(e.position.x!=null){if(e.position.x=+e.position.x,!jo(e.position.x))throw new TypeError('The option "position.x" has to be a finite number.')}else e.position.x=0;if(e.position.y!=null){if(e.position.y=+e.position.y,!jo(e.position.y))throw new TypeError('The option "position.y" has to be a finite number.')}else e.position.x=0}else e.position=this.getViewPosition();if(e.scale!=null){if(e.scale=+e.scale,!(e.scale>0))throw new TypeError('The option "scale" has to be a number greater than zero.')}else e.scale=this.body.view.scale;e.animation===void 0&&(e.animation={duration:0}),e.animation===!1&&(e.animation={duration:0}),e.animation===!0&&(e.animation={}),e.animation.duration===void 0&&(e.animation.duration=1e3),e.animation.easingFunction===void 0&&(e.animation.easingFunction="easeInOutQuad"),this.animateView(e)}animateView(e){if(e===void 0)return;this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),e.locked===!0&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),this.easingTime!=0&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;const t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:t.x-e.position.x,y:t.y-e.position.y};if(this.targetTranslation={x:this.sourceTranslation.x+i.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+i.y*this.targetScale+e.offset.y},e.animation.duration===0)if(this.lockedOnNodeId!=null){var o;this.viewFunction=ge(o=this._lockedRedraw).call(o,this),this.body.emitter.on("initRedraw",this.viewFunction)}else this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw");else{var r;this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=ge(r=this._transitionRedraw).call(r,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}_lockedRedraw(){const e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:t.x-e.x,y:t.y-e.y},o=this.body.view.translation,r={x:o.x+i.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:o.y+i.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=r}releaseNode(){this.lockedOnNodeId!==void 0&&this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}_transitionRedraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;const t=AU[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},this.easingTime>=1){if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,this.lockedOnNodeId!=null){var i;this.viewFunction=ge(i=this._lockedRedraw).call(i,this),this.body.emitter.on("initRedraw",this.viewFunction)}this.body.emitter.emit("animationFinished")}}getScale(){return this.body.view.scale}getViewPosition(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}var F$=`div.vis-network div.vis-navigation div.vis-button { +`),o=i.length;if(t.multi)for(let r=0;r0)for(let I=0;I0)for(let r=0;r/&/.test(o)?(t.replace(t.text,"<","<")||t.replace(t.text,"&","&")||t.add("&"),!0):!1;for(;t.position")||t.parseStartTag("ital","")||t.parseStartTag("mono","")||t.parseEndTag("bold","")||t.parseEndTag("ital","")||t.parseEndTag("mono",""))||i(o)||t.add(o),t.position++}return t.emitBlock(),t.blocks}splitMarkdownBlocks(e){const t=new ox(e);let i=!0;const o=r=>/\\/.test(r)?(t.positionthis.parent.fontOptions.maxWdt}getLongestFit(e){let t="",i=0;for(;i1&&arguments[1]!==void 0?arguments[1]:"normal",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");let o=e.split("\r");for(;o.length>0;){let r=this.getLongestFit(o);if(r===0){const A=o[0],I=this.getLongestFitWord(A);this.lines.newLine(xi(A).call(A,0,I),t),o[0]=xi(A).call(A,I)}else{let A=r;o[r-1]===" "?r--:o[A]===" "&&A++;const I=xi(o).call(o,0,r).join("");r==o.length&&i?this.lines.append(I,t):this.lines.newLine(I,t),o=xi(o).call(o,A)}}}}const Pa=["bold","ital","boldital","mono"];class Us{constructor(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(t),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=i}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),gI(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font=="string")this.baseSize=this.fontOptions.size;else if(typeof e.font=="object"){const t=e.font.size;t!==void 0&&(this.baseSize=t)}}}initFontOptions(e){if(Ke(Pa,t=>{this.fontOptions[t]={}}),Us.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}Ke(e,(t,i)=>{t!=null&&typeof t!="object"&&(this.fontOptions[i]=t)})}static parseFontString(e,t){if(!t||typeof t!="string")return!1;const i=t.split(" ");return e.size=+i[0].replace("px",""),e.face=i[1],e.color=i[2],!0}constrain(e){const t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},i=_g(e,"widthConstraint");if(typeof i=="number")t.maxWdt=Number(i),t.minWdt=Number(i);else if(typeof i=="object"){const r=_g(e,["widthConstraint","maximum"]);typeof r=="number"&&(t.maxWdt=Number(r));const A=_g(e,["widthConstraint","minimum"]);typeof A=="number"&&(t.minWdt=Number(A))}const o=_g(e,"heightConstraint");if(typeof o=="number")t.minHgt=Number(o);else if(typeof o=="object"){const r=_g(e,["heightConstraint","minimum"]);typeof r=="number"&&(t.minHgt=Number(r));const A=_g(e,["heightConstraint","valign"]);typeof A=="string"&&(A==="top"||A==="bottom")&&(t.valign=A)}return t}update(e,t){this.setOptions(e,!0),this.propagateFonts(t),vt(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=Ou("label",t)}adjustSizes(e){const t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);const i=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=i)}addFontOptionsToPile(e,t){for(let i=0;i{A!==void 0&&(Object.prototype.hasOwnProperty.call(t,I)||(It(Pa).call(Pa,I)!==-1?t[I]={}:t[I]=A))})}return t}getFontOption(e,t,i){let o;for(let r=0;r{r[l]=I}),r.size=Number(r.size),r.vadjust=Number(r.vadjust)}}draw(e,t,i,o,r){let A=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";if(this.elementOptions.label===void 0)return;let I=this.fontOptions.size*this.body.view.scale;this.elementOptions.label&&I=this.elementOptions.scaling.label.maxVisible&&(I=Number(this.elementOptions.scaling.label.maxVisible)/this.body.view.scale),this.calculateLabelSize(e,o,r,t,i,A),this._drawBackground(e),this._drawText(e,t,this.size.yLine,A,I))}_drawBackground(e){if(this.fontOptions.background!==void 0&&this.fontOptions.background!=="none"){e.fillStyle=this.fontOptions.background;const t=this.getSize();e.fillRect(t.left,t.top,t.width,t.height)}}_drawText(e,t,i){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"middle",r=arguments.length>4?arguments[4]:void 0;[t,i]=this._setAlignment(e,t,i,o),e.textAlign="left",t=t-this.size.width/2,this.fontOptions.valign&&this.size.height>this.size.labelHeight&&(this.fontOptions.valign==="top"&&(i-=(this.size.height-this.size.labelHeight)/2),this.fontOptions.valign==="bottom"&&(i+=(this.size.height-this.size.labelHeight)/2));for(let A=0;A0&&(e.lineWidth=h.strokeWidth,e.strokeStyle=m,e.lineJoin="round"),e.fillStyle=p,h.strokeWidth>0&&e.strokeText(h.text,t+l,i+h.vadjust),e.fillText(h.text,t+l,i+h.vadjust),l+=h.width}i+=I.height}}}_setAlignment(e,t,i,o){if(this.isEdgeLabel&&this.fontOptions.align!=="horizontal"&&this.pointToSelf===!1){t=0,i=0;const r=2;this.fontOptions.align==="top"?(e.textBaseline="alphabetic",i-=2*r):this.fontOptions.align==="bottom"?(e.textBaseline="hanging",i+=2*r):e.textBaseline="middle"}else e.textBaseline=o;return[t,i]}_getColor(e,t,i){let o=e||"#000000",r=i||"#ffffff";if(t<=this.elementOptions.scaling.label.drawThreshold){const A=Math.max(0,Math.min(1,1-(this.elementOptions.scaling.label.drawThreshold-t)));o=si(o,A),r=si(r,A)}return[o,r]}getTextSize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return this._processLabel(e,t,i),{width:this.size.width,height:this.size.height,lineCount:this.lineCount}}getSize(){let t=this.size.left,i=this.size.top-.5*2;if(this.isEdgeLabel){const r=-this.size.width*.5;switch(this.fontOptions.align){case"middle":t=r,i=-this.size.height*.5;break;case"top":t=r,i=-(this.size.height+2);break;case"bottom":t=r,i=2;break}}return{left:t,top:i,width:this.size.width,height:this.size.height}}calculateLabelSize(e,t,i){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,A=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"middle";this._processLabel(e,t,i),this.size.left=o-this.size.width*.5,this.size.top=r-this.size.height*.5,this.size.yLine=r+(1-this.lineCount)*.5*this.fontOptions.size,A==="hanging"&&(this.size.top+=.5*this.fontOptions.size,this.size.top+=4,this.size.yLine+=4)}getFormattingValues(e,t,i,o){const r=function(l,c,h){return c==="normal"?h==="mod"?"":l[h]:l[c][h]!==void 0?l[c][h]:l[h]},A={color:r(this.fontOptions,o,"color"),size:r(this.fontOptions,o,"size"),face:r(this.fontOptions,o,"face"),mod:r(this.fontOptions,o,"mod"),vadjust:r(this.fontOptions,o,"vadjust"),strokeWidth:this.fontOptions.strokeWidth,strokeColor:this.fontOptions.strokeColor};(t||i)&&(o==="normal"&&this.fontOptions.chooser===!0&&this.elementOptions.labelHighlightBold?A.mod="bold":typeof this.fontOptions.chooser=="function"&&this.fontOptions.chooser(A,this.elementOptions.id,t,i));let I="";return A.mod!==void 0&&A.mod!==""&&(I+=A.mod+" "),I+=A.size+"px "+A.face,e.font=I.replace(/"/g,""),A.font=e.font,A.height=A.size,A}differentState(e,t){return e!==this.selectedState||t!==this.hoverState}_processLabelText(e,t,i,o){return new p$(e,this,t,i).process(o)}_processLabel(e,t,i){if(this.labelDirty===!1&&!this.differentState(t,i))return;const o=this._processLabelText(e,t,i,this.elementOptions.label);this.fontOptions.minWdt>0&&o.width0&&o.height0&&(this.enableBorderDashes(e,t),e.stroke(),this.disableBorderDashes(e,t)),e.restore()}performFill(e,t){e.save(),e.fillStyle=t.color,this.enableShadow(e,t),fa(e).call(e),this.disableShadow(e,t),e.restore(),this.performStroke(e,t)}_addBoundingBoxMargin(e){this.boundingBox.left-=e,this.boundingBox.top-=e,this.boundingBox.bottom+=e,this.boundingBox.right+=e}_updateBoundingBox(e,t,i,o,r){i!==void 0&&this.resize(i,o,r),this.left=e-this.width/2,this.top=t-this.height/2,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}updateBoundingBox(e,t,i,o,r){this._updateBoundingBox(e,t,i,o,r)}getDimensionsFromLabel(e,t,i){this.textSize=this.labelModule.getTextSize(e,t,i);let o=this.textSize.width,r=this.textSize.height;const A=14;return o===0&&(o=A,r=A),{width:o,height:r}}}let m$=class extends Po{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,i)){const o=this.getDimensionsFromLabel(e,t,i);this.width=o.width+this.margin.right+this.margin.left,this.height=o.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}draw(e,t,i,o,r,A){this.resize(e,o,r),this.left=t-this.width/2,this.top=i-this.height/2,this.initContextForDraw(e,A),Sb(e,this.left,this.top,this.width,this.height,A.borderRadius),this.performFill(e,A),this.updateBoundingBox(t,i,e,o,r),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,o,r)}updateBoundingBox(e,t,i,o,r){this._updateBoundingBox(e,t,i,o,r);const A=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(A)}distanceToBorder(e,t){e&&this.resize(e);const i=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(t)),Math.abs(this.height/2/Math.sin(t)))+i}};class Du extends Po{constructor(e,t,i){super(e,t,i),this.labelOffset=0,this.selected=!1}setOptions(e,t,i){this.options=e,t===void 0&&i===void 0||this.setImages(t,i)}setImages(e,t){t&&this.selected?(this.imageObj=t,this.imageObjAlt=e):(this.imageObj=e,this.imageObjAlt=t)}switchImages(e){const t=e&&!this.selected||!e&&this.selected;if(this.selected=e,this.imageObjAlt!==void 0&&t){const i=this.imageObj;this.imageObj=this.imageObjAlt,this.imageObjAlt=i}}_getImagePadding(){const e={top:0,right:0,bottom:0,left:0};if(this.options.imagePadding){const t=this.options.imagePadding;typeof t=="object"?(e.top=t.top,e.right=t.right,e.bottom=t.bottom,e.left=t.left):(e.top=t,e.right=t,e.bottom=t,e.left=t)}return e}_resizeImage(){let e,t;if(this.options.shapeProperties.useImageSize===!1){let i=1,o=1;this.imageObj.width&&this.imageObj.height&&(this.imageObj.width>this.imageObj.height?i=this.imageObj.width/this.imageObj.height:o=this.imageObj.height/this.imageObj.width),e=this.options.size*2*i,t=this.options.size*2*o}else{const i=this._getImagePadding();e=this.imageObj.width+i.left+i.right,t=this.imageObj.height+i.top+i.bottom}this.width=e,this.height=t,this.radius=.5*this.width}_drawRawCircle(e,t,i,o){this.initContextForDraw(e,o),Vc(e,t,i,o.size),this.performFill(e,o)}_drawImageAtPosition(e,t){if(this.imageObj.width!=0){e.globalAlpha=t.opacity!==void 0?t.opacity:1,this.enableShadow(e,t);let i=1;this.options.shapeProperties.interpolation===!0&&(i=this.imageObj.width/this.width/this.body.view.scale);const o=this._getImagePadding(),r=this.left+o.left,A=this.top+o.top,I=this.width-o.left-o.right,l=this.height-o.top-o.bottom;this.imageObj.drawImageAtPosition(e,i,r,A,I,l),this.disableShadow(e,t)}}_drawImageLabel(e,t,i,o,r){let A=0;if(this.height!==void 0){A=this.height*.5;const l=this.labelModule.getTextSize(e,o,r);l.lineCount>=1&&(A+=l.height/2)}const I=i+A;this.options.label&&(this.labelOffset=A),this.labelModule.draw(e,t,I,o,r,"hanging")}}let v$=class extends Du{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,i)){const o=this.getDimensionsFromLabel(e,t,i),r=Math.max(o.width+this.margin.right+this.margin.left,o.height+this.margin.top+this.margin.bottom);this.options.size=r/2,this.width=r,this.height=r,this.radius=this.width/2}}draw(e,t,i,o,r,A){this.resize(e,o,r),this.left=t-this.width/2,this.top=i-this.height/2,this._drawRawCircle(e,t,i,A),this.updateBoundingBox(t,i),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,i,o,r)}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size}distanceToBorder(e){return e&&this.resize(e),this.width*.5}};class b$ extends Du{constructor(e,t,i,o,r){super(e,t,i),this.setImages(o,r)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){const r=this.options.size*2;this.width=r,this.height=r,this.radius=.5*this.width;return}this.needsRefresh(t,i)&&this._resizeImage()}draw(e,t,i,o,r,A){this.switchImages(o),this.resize();let I=t,l=i;this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=t,this.top=i,I+=this.width/2,l+=this.height/2):(this.left=t-this.width/2,this.top=i-this.height/2),this._drawRawCircle(e,I,l,A),e.save(),e.clip(),this._drawImageAtPosition(e,A),e.restore(),this._drawImageLabel(e,I,l,o,r),this.updateBoundingBox(t,i)}updateBoundingBox(e,t){this.options.shapeProperties.coordinateOrigin==="top-left"?(this.boundingBox.top=t,this.boundingBox.left=e,this.boundingBox.right=e+this.options.size*2,this.boundingBox.bottom=t+this.options.size*2):(this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size),this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}distanceToBorder(e){return e&&this.resize(e),this.width*.5}}class Bg extends Po{constructor(e,t,i){super(e,t,i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{size:this.options.size};if(this.needsRefresh(t,i)){var r,A;this.labelModule.getTextSize(e,t,i);const I=2*o.size;this.width=(r=this.customSizeWidth)!==null&&r!==void 0?r:I,this.height=(A=this.customSizeHeight)!==null&&A!==void 0?A:I,this.radius=.5*this.width}}_drawShape(e,t,i,o,r,A,I,l){return this.resize(e,A,I,l),this.left=o-this.width/2,this.top=r-this.height/2,this.initContextForDraw(e,l),iZ(t)(e,o,r,l.size),this.performFill(e,l),this.options.icon!==void 0&&this.options.icon.code!==void 0&&(e.font=(A?"bold ":"")+this.height/2+"px "+(this.options.icon.face||"FontAwesome"),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",e.fillText(this.options.icon.code,o,r)),{drawExternalLabel:()=>{if(this.options.label!==void 0){this.labelModule.calculateLabelSize(e,A,I,o,r,"hanging");const c=r+.5*this.height+.5*this.labelModule.size.height;this.labelModule.draw(e,o,c,A,I,"hanging")}this.updateBoundingBox(o,r)}}}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height))}}function sx(n,e){var t=xt(n);if(Bi){var i=Bi(n);e&&(i=$t(i).call(i,function(o){return Li(n,o).enumerable})),t.push.apply(t,i)}return t}function y$(n){for(var e=1;e{e.save(),l(),e.restore()}}return I.nodeDimensions&&(this.customSizeWidth=I.nodeDimensions.width,this.customSizeHeight=I.nodeDimensions.height),I}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class x$ extends Po{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e,t,i){if(this.needsRefresh(t,i)){const r=this.getDimensionsFromLabel(e,t,i).width+this.margin.right+this.margin.left;this.width=r,this.height=r,this.radius=this.width/2}}draw(e,t,i,o,r,A){this.resize(e,o,r),this.left=t-this.width/2,this.top=i-this.height/2,this.initContextForDraw(e,A),Tb(e,t-this.width/2,i-this.height/2,this.width,this.height),this.performFill(e,A),this.updateBoundingBox(t,i,e,o,r),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,o,r)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let E$=class extends Bg{constructor(e,t,i){super(e,t,i)}draw(e,t,i,o,r,A){return this._drawShape(e,"diamond",4,t,i,o,r,A)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};class S$ extends Bg{constructor(e,t,i){super(e,t,i)}draw(e,t,i,o,r,A){return this._drawShape(e,"circle",2,t,i,o,r,A)}distanceToBorder(e){return e&&this.resize(e),this.options.size}}class rx extends Po{constructor(e,t,i){super(e,t,i)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.needsRefresh(t,i)){const o=this.getDimensionsFromLabel(e,t,i);this.height=o.height*2,this.width=o.width+o.height,this.radius=.5*this.width}}draw(e,t,i,o,r,A){this.resize(e,o,r),this.left=t-this.width*.5,this.top=i-this.height*.5,this.initContextForDraw(e,A),Uc(e,this.left,this.top,this.width,this.height),this.performFill(e,A),this.updateBoundingBox(t,i,e,o,r),this.labelModule.draw(e,t,i,o,r)}distanceToBorder(e,t){e&&this.resize(e);const i=this.width*.5,o=this.height*.5,r=Math.sin(t)*i,A=Math.cos(t)*o;return i*o/Math.sqrt(r*r+A*A)}}class T$ extends Po{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e,t,i){this.needsRefresh(t,i)&&(this.iconSize={width:Number(this.options.icon.size),height:Number(this.options.icon.size)},this.width=this.iconSize.width+this.margin.right+this.margin.left,this.height=this.iconSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(e,t,i,o,r,A){return this.resize(e,o,r),this.options.icon.size=this.options.icon.size||50,this.left=t-this.width/2,this.top=i-this.height/2,this._icon(e,t,i,o,r,A),{drawExternalLabel:()=>{this.options.label!==void 0&&this.labelModule.draw(e,this.left+this.iconSize.width/2+this.margin.left,i+this.height/2+5,o),this.updateBoundingBox(t,i)}}}updateBoundingBox(e,t){this.boundingBox.top=t-this.options.icon.size*.5,this.boundingBox.left=e-this.options.icon.size*.5,this.boundingBox.right=e+this.options.icon.size*.5,this.boundingBox.bottom=t+this.options.icon.size*.5,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+5))}_icon(e,t,i,o,r,A){const I=Number(this.options.icon.size);this.options.icon.code!==void 0?(e.font=[this.options.icon.weight!=null?this.options.icon.weight:o?"bold":"",(this.options.icon.weight!=null&&o?5:0)+I+"px",this.options.icon.face].join(" "),e.fillStyle=this.options.icon.color||"black",e.textAlign="center",e.textBaseline="middle",this.enableShadow(e,A),e.fillText(this.options.icon.code,t,i),this.disableShadow(e,A)):console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.")}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let O$=class extends Du{constructor(e,t,i,o,r){super(e,t,i),this.setImages(o,r)}resize(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.selected,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hover;if(this.imageObj.src===void 0||this.imageObj.width===void 0||this.imageObj.height===void 0){const r=this.options.size*2;this.width=r,this.height=r;return}this.needsRefresh(t,i)&&this._resizeImage()}draw(e,t,i,o,r,A){e.save(),this.switchImages(o),this.resize();let I=t,l=i;if(this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=t,this.top=i,I+=this.width/2,l+=this.height/2):(this.left=t-this.width/2,this.top=i-this.height/2),this.options.shapeProperties.useBorderWithImage===!0){const c=this.options.borderWidth,h=this.options.borderWidthSelected||2*this.options.borderWidth,p=(o?h:c)/this.body.view.scale;e.lineWidth=Math.min(this.width,p),e.beginPath();let m=o?this.options.color.highlight.border:r?this.options.color.hover.border:this.options.color.border,b=o?this.options.color.highlight.background:r?this.options.color.hover.background:this.options.color.background;A.opacity!==void 0&&(m=si(m,A.opacity),b=si(b,A.opacity)),e.strokeStyle=m,e.fillStyle=b,e.rect(this.left-.5*e.lineWidth,this.top-.5*e.lineWidth,this.width+e.lineWidth,this.height+e.lineWidth),fa(e).call(e),this.performStroke(e,A),e.closePath()}this._drawImageAtPosition(e,A),this._drawImageLabel(e,I,l,o,r),this.updateBoundingBox(t,i),e.restore()}updateBoundingBox(e,t){this.resize(),this.options.shapeProperties.coordinateOrigin==="top-left"?(this.left=e,this.top=t):(this.left=e-this.width/2,this.top=t-this.height/2),this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width,this.options.label!==void 0&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};class N$ extends Bg{constructor(e,t,i){super(e,t,i)}draw(e,t,i,o,r,A){return this._drawShape(e,"square",2,t,i,o,r,A)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class D$ extends Bg{constructor(e,t,i){super(e,t,i)}draw(e,t,i,o,r,A){return this._drawShape(e,"hexagon",4,t,i,o,r,A)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class M$ extends Bg{constructor(e,t,i){super(e,t,i)}draw(e,t,i,o,r,A){return this._drawShape(e,"star",4,t,i,o,r,A)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}class R$ extends Po{constructor(e,t,i){super(e,t,i),this._setMargins(i)}resize(e,t,i){this.needsRefresh(t,i)&&(this.textSize=this.labelModule.getTextSize(e,t,i),this.width=this.textSize.width+this.margin.right+this.margin.left,this.height=this.textSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}draw(e,t,i,o,r,A){this.resize(e,o,r),this.left=t-this.width/2,this.top=i-this.height/2,this.enableShadow(e,A),this.labelModule.draw(e,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,o,r),this.disableShadow(e,A),this.updateBoundingBox(t,i,e,o,r)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}let z$=class extends Bg{constructor(e,t,i){super(e,t,i)}draw(e,t,i,o,r,A){return this._drawShape(e,"triangle",3,t,i,o,r,A)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}};class k$ extends Bg{constructor(e,t,i){super(e,t,i)}draw(e,t,i,o,r,A){return this._drawShape(e,"triangleDown",3,t,i,o,r,A)}distanceToBorder(e,t){return this._distanceToBorder(e,t)}}function ax(n,e){var t=xt(n);if(Bi){var i=Bi(n);e&&(i=$t(i).call(i,function(o){return Li(n,o).enumerable})),t.push.apply(t,i)}return t}function Ax(n){for(var e=1;et[c]!=null);l.push("font"),YC(l,e,I),e.color=Jd(e.color)}static parseOptions(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},r=arguments.length>4?arguments[4]:void 0;if(YC(["color","fixed","shadow"],e,t,i),Nt.checkMass(t),e.opacity!==void 0&&(Nt.checkOpacity(e.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity),e.opacity=void 0)),t.opacity!==void 0&&(Nt.checkOpacity(t.opacity)||(console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+t.opacity),t.opacity=void 0)),t.shapeProperties&&!Nt.checkCoordinateOrigin(t.shapeProperties.coordinateOrigin)&&console.error("Invalid option for node coordinateOrigin, found: "+t.shapeProperties.coordinateOrigin),ri(e,t,"shadow",o),t.color!==void 0&&t.color!==null){const I=Jd(t.color);T1(e.color,I)}else i===!0&&t.color===null&&(e.color=kg(o.color));t.fixed!==void 0&&t.fixed!==null&&(typeof t.fixed=="boolean"?(e.fixed.x=t.fixed,e.fixed.y=t.fixed):(t.fixed.x!==void 0&&typeof t.fixed.x=="boolean"&&(e.fixed.x=t.fixed.x),t.fixed.y!==void 0&&typeof t.fixed.y=="boolean"&&(e.fixed.y=t.fixed.y))),i===!0&&t.font===null&&(e.font=kg(o.font)),Nt.updateGroupOptions(e,t,r),t.scaling!==void 0&&ri(e.scaling,t.scaling,"label",o.scaling)}getFormattingValues(){const e={color:this.options.color.background,opacity:this.options.opacity,borderWidth:this.options.borderWidth,borderColor:this.options.color.border,size:this.options.size,borderDashes:this.options.shapeProperties.borderDashes,borderRadius:this.options.shapeProperties.borderRadius,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y};if(this.selected||this.hover?this.chooser===!0?this.selected?(this.options.borderWidthSelected!=null?e.borderWidth=this.options.borderWidthSelected:e.borderWidth*=2,e.color=this.options.color.highlight.background,e.borderColor=this.options.color.highlight.border,e.shadow=this.options.shadow.enabled):this.hover&&(e.color=this.options.color.hover.background,e.borderColor=this.options.color.hover.border,e.shadow=this.options.shadow.enabled):typeof this.chooser=="function"&&(this.chooser(e,this.options.id,this.selected,this.hover),e.shadow===!1&&(e.shadowColor!==this.options.shadow.color||e.shadowSize!==this.options.shadow.size||e.shadowX!==this.options.shadow.x||e.shadowY!==this.options.shadow.y)&&(e.shadow=!0)):e.shadow=this.options.shadow.enabled,this.options.opacity!==void 0){const t=this.options.opacity;e.borderColor=si(e.borderColor,t),e.color=si(e.color,t),e.shadowColor=si(e.shadowColor,t)}return e}updateLabelModule(e){(this.options.label===void 0||this.options.label===null)&&(this.options.label=""),Nt.updateGroupOptions(this.options,Ax(Ax({},e),{},{color:e&&e.color||this._localColor||void 0}),this.grouplist);const t=this.grouplist.get(this.options.group,!1),i=[e,this.options,t,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,i),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateShape(e){if(e===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj,this.imageObjAlt);else switch(this.options.shape){case"box":this.shape=new m$(this.options,this.body,this.labelModule);break;case"circle":this.shape=new v$(this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new b$(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"custom":this.shape=new w$(this.options,this.body,this.labelModule,this.options.ctxRenderer);break;case"database":this.shape=new x$(this.options,this.body,this.labelModule);break;case"diamond":this.shape=new E$(this.options,this.body,this.labelModule);break;case"dot":this.shape=new S$(this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new rx(this.options,this.body,this.labelModule);break;case"icon":this.shape=new T$(this.options,this.body,this.labelModule);break;case"image":this.shape=new O$(this.options,this.body,this.labelModule,this.imageObj,this.imageObjAlt);break;case"square":this.shape=new N$(this.options,this.body,this.labelModule);break;case"hexagon":this.shape=new D$(this.options,this.body,this.labelModule);break;case"star":this.shape=new M$(this.options,this.body,this.labelModule);break;case"text":this.shape=new R$(this.options,this.body,this.labelModule);break;case"triangle":this.shape=new z$(this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new k$(this.options,this.body,this.labelModule);break;default:this.shape=new rx(this.options,this.body,this.labelModule);break}this.needsRefresh()}select(){this.selected=!0,this.needsRefresh()}unselect(){this.selected=!1,this.needsRefresh()}needsRefresh(){this.shape.refreshNeeded=!0}getTitle(){return this.options.title}distanceToBorder(e,t){return this.shape.distanceToBorder(e,t)}isFixed(){return this.options.fixed.x&&this.options.fixed.y}isSelected(){return this.selected}getValue(){return this.options.value}getLabelSize(){return this.labelModule.size()}setValueRange(e,t,i){if(this.options.value!==void 0){const o=this.options.scaling.customScalingFunction(e,t,i,this.options.value),r=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){const A=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+o*A}this.options.size=this.options.scaling.min+o*r}else this.options.size=this.baseSize,this.options.font.size=this.baseFontSize;this.updateLabelModule()}draw(e){const t=this.getFormattingValues();return this.shape.draw(e,this.x,this.y,this.selected,this.hover,t)||{}}updateBoundingBox(e){this.shape.updateBoundingBox(this.x,this.y,e)}resize(e){const t=this.getFormattingValues();this.shape.resize(e,this.selected,this.hover,t)}getItemsOnPoint(e){const t=[];return this.labelModule.visible()&&Nu(this.labelModule.getSize(),e)&&t.push({nodeId:this.id,labelId:0}),Nu(this.shape.boundingBox,e)&&t.push({nodeId:this.id}),t}isOverlappingWith(e){return this.shape.lefte.left&&this.shape.tope.top}isBoundingBoxOverlappingWith(e){return this.shape.boundingBox.lefte.left&&this.shape.boundingBox.tope.top}static checkMass(e,t){if(e.mass!==void 0&&e.mass<=0){let i="";t!==void 0&&(i=" in node id: "+t),console.error("%cNegative or zero mass disallowed"+i+", setting mass to 1.",R1),e.mass=1}}}class _${constructor(e,t,i,o){var r;if(this.body=e,this.images=t,this.groups=i,this.layoutEngine=o,this.body.functions.createNode=oe(r=this.create).call(r,this),this.nodesListeners={add:(A,I)=>{this.add(I.items)},update:(A,I)=>{this.update(I.items,I.data,I.oldData)},remove:(A,I)=>{this.remove(I.items)}},this.defaultOptions={borderWidth:1,borderWidthSelected:void 0,brokenImage:void 0,color:{border:"#2B7CE9",background:"#97C2FC",highlight:{border:"#2B7CE9",background:"#D2E5FF"},hover:{border:"#2B7CE9",background:"#D2E5FF"}},opacity:void 0,fixed:{x:!1,y:!1},font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:0,strokeColor:"#ffffff",align:"center",vadjust:0,multi:!1,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"monospace",vadjust:2}},group:void 0,hidden:!1,icon:{face:"FontAwesome",code:void 0,size:50,color:"#2B7CE9"},image:void 0,imagePadding:{top:0,right:0,bottom:0,left:0},label:void 0,labelHighlightBold:!0,level:void 0,margin:{top:5,right:5,bottom:5,left:5},mass:1,physics:!0,scaling:{min:10,max:30,label:{enabled:!1,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(A,I,l,c){if(I===A)return .5;{const h=1/(I-A);return Math.max(0,(c-A)*h)}}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},shape:"ellipse",shapeProperties:{borderDashes:!1,borderRadius:6,interpolation:!0,useImageSize:!1,useBorderWithImage:!1,coordinateOrigin:"center"},size:25,title:void 0,value:void 0,x:void 0,y:void 0},this.defaultOptions.mass<=0)throw"Internal error: mass in defaultOptions of NodesHandler may not be zero or negative";this.options=kg(this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e,t;this.body.emitter.on("refreshNodes",oe(e=this.refresh).call(e,this)),this.body.emitter.on("refresh",oe(t=this.refresh).call(t,this)),this.body.emitter.on("destroy",()=>{Ke(this.nodesListeners,(i,o)=>{this.body.data.nodes&&this.body.data.nodes.off(o,i)}),delete this.body.functions.createNode,delete this.nodesListeners.add,delete this.nodesListeners.update,delete this.nodesListeners.remove,delete this.nodesListeners})}setOptions(e){if(e!==void 0){if(Nt.parseOptions(this.options,e),e.opacity!==void 0&&(du(e.opacity)||!jo(e.opacity)||e.opacity<0||e.opacity>1?console.error("Invalid option for node opacity. Value must be between 0 and 1, found: "+e.opacity):this.options.opacity=e.opacity),e.shape!==void 0)for(const t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].updateShape();if(typeof e.font<"u"||typeof e.widthConstraint<"u"||typeof e.heightConstraint<"u")for(const t of xt(this.body.nodes))this.body.nodes[t].updateLabelModule(),this.body.nodes[t].needsRefresh();if(e.size!==void 0)for(const t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&this.body.nodes[t].needsRefresh();(e.hidden!==void 0||e.physics!==void 0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.body.data.nodes;if(qw("id",e))this.body.data.nodes=e;else if(nt(e))this.body.data.nodes=new Vs,this.body.data.nodes.add(e);else if(!e)this.body.data.nodes=new Vs;else throw new TypeError("Array or DataSet expected");if(i&&Ke(this.nodesListeners,function(o,r){i.off(r,o)}),this.body.nodes={},this.body.data.nodes){const o=this;Ke(this.nodesListeners,function(A,I){o.body.data.nodes.on(I,A)});const r=this.body.data.nodes.getIds();this.add(r,!0)}t===!1&&this.body.emitter.emit("_dataChanged")}add(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i;const o=[];for(let r=0;r1&&arguments[1]!==void 0?arguments[1]:Nt;return new t(e,this.body,this.images,this.groups,this.options,this.defaultOptions)}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Ke(this.body.nodes,(t,i)=>{const o=this.body.data.nodes.get(i);o!==void 0&&(e===!0&&t.setOptions({x:null,y:null}),t.setOptions({fixed:!1}),t.setOptions(o))})}getPositions(e){const t={};if(e!==void 0){if(nt(e)===!0){for(let i=0;i{this.body.emitter.emit("startSimulation")},0)):console.error("Node id supplied to moveNode does not exist. Provided: ",e)}}var j$=ze,Cx=Math.hypot,Z$=Math.abs,P$=Math.sqrt,B$=!!Cx&&Cx(1/0,NaN)!==1/0;j$({target:"Math",stat:!0,forced:B$},{hypot:function(e,t){for(var i=0,o=0,r=arguments.length,A=0,I,l;o0?(l=I/A,i+=l*l):i+=I;return A===1/0?1/0:A*P$(i)}});var L$=At,G$=L$.Math.hypot,F$=G$,V$=F$,U$=V$,Y$=Ne(U$);class Ht{static transform(e,t){nt(e)||(e=[e]);const i=t.point.x,o=t.point.y,r=t.angle,A=t.length;for(let I=0;I4&&arguments[4]!==void 0?arguments[4]:this.getViaNode();e.strokeStyle=this.getColor(e,t),e.lineWidth=t.width,t.dashes!==!1?this._drawDashedLine(e,t,r):this._drawLine(e,t,r)}_drawLine(e,t,i,o,r){if(this.from!=this.to)this._line(e,t,i,o,r);else{const[A,I,l]=this._getCircleData(e);this._circle(e,t,A,I,l)}}_drawDashedLine(e,t,i,o,r){e.lineCap="round";const A=nt(t.dashes)?t.dashes:[5,5];if(e.setLineDash!==void 0){if(e.save(),e.setLineDash(A),e.lineDashOffset=0,this.from!=this.to)this._line(e,t,i);else{const[I,l,c]=this._getCircleData(e);this._circle(e,t,I,l,c)}e.setLineDash([0]),e.lineDashOffset=0,e.restore()}else{if(this.from!=this.to)Ob(e,this.from.x,this.from.y,this.to.x,this.to.y,A);else{const[I,l,c]=this._getCircleData(e);this._circle(e,t,I,l,c)}this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}}findBorderPosition(e,t,i){return this.from!=this.to?this._findBorderPosition(e,t,i):this._findBorderPositionCircle(e,t,i)}findBorderPositions(e){if(this.from!=this.to)return{from:this._findBorderPosition(this.from,e),to:this._findBorderPosition(this.to,e)};{var t;const[i,o]=xi(t=this._getCircleData(e)).call(t,0,2);return{from:this._findBorderPositionCircle(this.from,e,{x:i,y:o,low:.25,high:.6,direction:-1}),to:this._findBorderPositionCircle(this.from,e,{x:i,y:o,low:.6,high:.8,direction:1})}}}_getCircleData(e){const t=this.options.selfReference.size;e!==void 0&&this.from.shape.width===void 0&&this.from.shape.resize(e);const i=gx(e,this.options.selfReference.angle,t,this.from);return[i.x,i.y,t]}_pointOnCircle(e,t,i,o){const r=o*2*Math.PI;return{x:e+i*Math.cos(r),y:t-i*Math.sin(r)}}_findBorderPositionCircle(e,t,i){const o=i.x,r=i.y;let A=i.low,I=i.high;const l=i.direction,c=10,h=this.options.selfReference.size,p=.05;let m,b=(A+I)*.5,w=0;this.options.arrowStrikethrough===!0&&(l===-1?w=this.options.endPointOffset.from:l===1&&(w=this.options.endPointOffset.to));let O=0;do{b=(A+I)*.5,m=this._pointOnCircle(o,r,h,b);const x=Math.atan2(e.y-m.y,e.x-m.x),S=e.distanceToBorder(t,x)+w,E=Math.sqrt(Math.pow(m.x-e.x,2)+Math.pow(m.y-e.y,2)),_=S-E;if(Math.abs(_)0?l>0?A=b:I=b:l>0?I=b:A=b,++O}while(A<=I&&O1?h=1:h<0&&(h=0);const p=e+h*I,m=t+h*l,b=p-r,w=m-A;return Math.sqrt(b*b+w*w)}getArrowData(e,t,i,o,r,A){let I,l,c,h,p,m,b;const w=A.width;t==="from"?(c=this.from,h=this.to,p=A.fromArrowScale<0,m=Math.abs(A.fromArrowScale),b=A.fromArrowType):t==="to"?(c=this.to,h=this.from,p=A.toArrowScale<0,m=Math.abs(A.toArrowScale),b=A.toArrowType):(c=this.to,h=this.from,p=A.middleArrowScale<0,m=Math.abs(A.middleArrowScale),b=A.middleArrowType);const O=15*m+3*w;if(c!=h){const _=Y$(c.x-h.x,c.y-h.y),j=O/_;if(t!=="middle")if(this.options.smooth.enabled===!0){const X=this._findBorderPosition(c,e,{via:i}),ne=this.getPoint(X.t+j*(t==="from"?1:-1),i);I=Math.atan2(X.y-ne.y,X.x-ne.x),l=X}else I=Math.atan2(c.y-h.y,c.x-h.x),l=this._findBorderPosition(c,e);else{const X=(p?-j:j)/2,ne=this.getPoint(.5+X,i),F=this.getPoint(.5-X,i);I=Math.atan2(ne.y-F.y,ne.x-F.x),l=this.getPoint(.5,i)}}else{const[_,j,X]=this._getCircleData(e);if(t==="from"){const ne=this.options.selfReference.angle,F=this.options.selfReference.angle+Math.PI,V=this._findBorderPositionCircle(this.from,e,{x:_,y:j,low:ne,high:F,direction:-1});I=V.t*-2*Math.PI+1.5*Math.PI+.1*Math.PI,l=V}else if(t==="to"){const ne=this.options.selfReference.angle,F=this.options.selfReference.angle+Math.PI,V=this._findBorderPositionCircle(this.from,e,{x:_,y:j,low:ne,high:F,direction:1});I=V.t*-2*Math.PI+1.5*Math.PI-1.1*Math.PI,l=V}else{const ne=this.options.selfReference.angle/(2*Math.PI);l=this._pointOnCircle(_,j,X,ne),I=ne*-2*Math.PI+1.5*Math.PI+.1*Math.PI}}const x=l.x-O*.9*Math.cos(I),S=l.y-O*.9*Math.sin(I);return{point:l,core:{x,y:S},angle:I,length:O,type:b}}drawArrowHead(e,t,i,o,r){e.strokeStyle=this.getColor(e,t),e.fillStyle=e.strokeStyle,e.lineWidth=t.width,Ix.draw(e,r)&&(this.enableShadow(e,t),fa(e).call(e),this.disableShadow(e,t))}enableShadow(e,t){t.shadow===!0&&(e.shadowColor=t.shadowColor,e.shadowBlur=t.shadowSize,e.shadowOffsetX=t.shadowX,e.shadowOffsetY=t.shadowY)}disableShadow(e,t){t.shadow===!0&&(e.shadowColor="rgba(0,0,0,0)",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}drawBackground(e,t){if(t.background!==!1){const i={strokeStyle:e.strokeStyle,lineWidth:e.lineWidth,dashes:e.dashes};e.strokeStyle=t.backgroundColor,e.lineWidth=t.backgroundSize,this.setStrokeDashed(e,t.backgroundDashes),e.stroke(),e.strokeStyle=i.strokeStyle,e.lineWidth=i.lineWidth,e.dashes=i.dashes,this.setStrokeDashed(e,t.dashes)}}setStrokeDashed(e,t){if(t!==!1)if(e.setLineDash!==void 0){const i=nt(t)?t:[5,5];e.setLineDash(i)}else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");else e.setLineDash!==void 0?e.setLineDash([]):console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.")}}function ux(n,e){var t=xt(n);if(Bi){var i=Bi(n);e&&(i=$t(i).call(i,function(o){return Li(n,o).enumerable})),t.push.apply(t,i)}return t}function hx(n){for(var e=1;e2&&arguments[2]!==void 0?arguments[2]:this._getViaCoordinates();const o=10,r=.2;let A=!1,I=1,l=0,c=this.to,h,p,m=this.options.endPointOffset?this.options.endPointOffset.to:0;e.id===this.from.id&&(c=this.from,A=!0,m=this.options.endPointOffset?this.options.endPointOffset.from:0),this.options.arrowStrikethrough===!1&&(m=0);let b=0;do{p=(l+I)*.5,h=this.getPoint(p,i);const w=Math.atan2(c.y-h.y,c.x-h.x),O=c.distanceToBorder(t,w)+m,x=Math.sqrt(Math.pow(h.x-c.x,2)+Math.pow(h.y-c.y,2)),S=O-x;if(Math.abs(S)0&&(c=this._getDistanceToLine(w,O,m,b,r,A),l=c{this.positionBezierNode()},this._body.emitter.on("_repositionBezierNodes",this._boundFunction)}setOptions(e){super.setOptions(e);let t=!1;this.options.physics!==e.physics&&(t=!0),this.options=e,this.id=this.options.id,this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.setupSupportNode(),this.connect(),t===!0&&(this.via.setOptions({physics:this.options.physics}),this.positionBezierNode())}connect(){this.from=this._body.nodes[this.options.from],this.to=this._body.nodes[this.options.to],this.from===void 0||this.to===void 0||this.options.physics===!1?this.via.setOptions({physics:!1}):this.from.id===this.to.id?this.via.setOptions({physics:!1}):this.via.setOptions({physics:!0})}cleanup(){return this._body.emitter.off("_repositionBezierNodes",this._boundFunction),this.via!==void 0?(delete this._body.nodes[this.via.id],this.via=void 0,!0):!1}setupSupportNode(){if(this.via===void 0){const e="edgeId:"+this.id,t=this._body.functions.createNode({id:e,shape:"circle",physics:!0,hidden:!0});this._body.nodes[e]=t,this.via=t,this.via.parentEdgeId=this.id,this.positionBezierNode()}}positionBezierNode(){this.via!==void 0&&this.from!==void 0&&this.to!==void 0?(this.via.x=.5*(this.from.x+this.to.x),this.via.y=.5*(this.from.y+this.to.y)):this.via!==void 0&&(this.via.x=0,this.via.y=0)}_line(e,t,i){this._bezierCurve(e,t,i)}_getViaCoordinates(){return this.via}getViaNode(){return this.via}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.via;if(this.from===this.to){const[i,o,r]=this._getCircleData(),A=2*Math.PI*(1-e);return{x:i+r*Math.sin(A),y:o+r-r*(1-Math.cos(A))}}else return{x:Math.pow(1-e,2)*this.fromPoint.x+2*e*(1-e)*t.x+Math.pow(e,2)*this.toPoint.x,y:Math.pow(1-e,2)*this.fromPoint.y+2*e*(1-e)*t.y+Math.pow(e,2)*this.toPoint.y}}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t,this.via)}_getDistanceToEdge(e,t,i,o,r,A){return this._getDistanceToBezierEdge(e,t,i,o,r,A,this.via)}}class px extends Mu{constructor(e,t,i){super(e,t,i)}_line(e,t,i){this._bezierCurve(e,t,i)}getViaNode(){return this._getViaCoordinates()}_getViaCoordinates(){const e=this.options.smooth.roundness,t=this.options.smooth.type;let i=Math.abs(this.from.x-this.to.x),o=Math.abs(this.from.y-this.to.y);if(t==="discrete"||t==="diagonalCross"){let r,A;i<=o?r=A=e*o:r=A=e*i,this.from.x>this.to.x&&(r=-r),this.from.y>=this.to.y&&(A=-A);let I=this.from.x+r,l=this.from.y+A;return t==="discrete"&&(i<=o?I=ithis.to.x&&(r=-r),this.from.y>=this.to.y&&(A=-A);let I=this.from.x+r,l=this.from.y+A;return i<=o?this.from.x<=this.to.x?I=this.to.xI?this.to.x:I:this.from.y>=this.to.y?l=this.to.y>l?this.to.y:l:l=this.to.y2&&arguments[2]!==void 0?arguments[2]:{};return this._findBorderPositionBezier(e,t,i.via)}_getDistanceToEdge(e,t,i,o,r,A){let I=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(e,t,i,o,r,A,I)}getPoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates();const i=e,o=Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*t.x+Math.pow(i,2)*this.toPoint.x,r=Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*t.y+Math.pow(i,2)*this.toPoint.y;return{x:o,y:r}}}class gq extends Mu{constructor(e,t,i){super(e,t,i)}_getDistanceToBezierEdge2(e,t,i,o,r,A,I,l){let c=1e9,h=e,p=t;const m=[0,0,0,0];for(let b=1;b<10;b++){const w=.1*b;m[0]=Math.pow(1-w,3),m[1]=3*w*Math.pow(1-w,2),m[2]=3*Math.pow(w,2)*(1-w),m[3]=Math.pow(w,3);const O=m[0]*e+m[1]*I.x+m[2]*l.x+m[3]*i,x=m[0]*t+m[1]*I.y+m[2]*l.y+m[3]*o;if(b>0){const S=this._getDistanceToLine(h,p,O,x,r,A);c=SMath.abs(t)||this.options.smooth.forceDirection===!0||this.options.smooth.forceDirection==="horizontal")&&this.options.smooth.forceDirection!=="vertical"?(o=this.from.y,A=this.to.y,i=this.from.x-I*e,r=this.to.x+I*e):(o=this.from.y-I*t,A=this.to.y+I*t,i=this.from.x,r=this.to.x),[{x:i,y:o},{x:r,y:A}]}getViaNode(){return this._getViaCoordinates()}_findBorderPosition(e,t){return this._findBorderPositionBezier(e,t)}_getDistanceToEdge(e,t,i,o,r,A){let[I,l]=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge2(e,t,i,o,r,A,I,l)}getPoint(e){let[t,i]=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._getViaCoordinates();const o=e,r=[Math.pow(1-o,3),3*o*Math.pow(1-o,2),3*Math.pow(o,2)*(1-o),Math.pow(o,3)],A=r[0]*this.fromPoint.x+r[1]*t.x+r[2]*i.x+r[3]*this.toPoint.x,I=r[0]*this.fromPoint.y+r[1]*t.y+r[2]*i.y+r[3]*this.toPoint.y;return{x:A,y:I}}}class vx extends dx{constructor(e,t,i){super(e,t,i)}_line(e,t){e.beginPath(),e.moveTo(this.fromPoint.x,this.fromPoint.y),e.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(e,t),e.stroke(),this.disableShadow(e,t)}getViaNode(){}getPoint(e){return{x:(1-e)*this.fromPoint.x+e*this.toPoint.x,y:(1-e)*this.fromPoint.y+e*this.toPoint.y}}_findBorderPosition(e,t){let i=this.to,o=this.from;e.id===this.from.id&&(i=this.from,o=this.to);const r=Math.atan2(i.y-o.y,i.x-o.x),A=i.x-o.x,I=i.y-o.y,l=Math.sqrt(A*A+I*I),c=e.distanceToBorder(t,r),h=(l-c)/l;return{x:(1-h)*o.x+h*i.x,y:(1-h)*o.y+h*i.y,t:0}}_getDistanceToEdge(e,t,i,o,r,A){return this._getDistanceToLine(e,t,i,o,r,A)}}class Lg{constructor(e,t,i,o,r){if(t===void 0)throw new Error("No body provided");this.options=kg(o),this.globalOptions=o,this.defaultOptions=r,this.body=t,this.imagelist=i,this.id=void 0,this.fromId=void 0,this.toId=void 0,this.selected=!1,this.hover=!1,this.labelDirty=!0,this.baseWidth=this.options.width,this.baseFontSize=this.options.font.size,this.from=void 0,this.to=void 0,this.edgeType=void 0,this.connected=!1,this.labelModule=new Us(this.body,this.options,!0),this.setOptions(e)}setOptions(e){if(!e)return;let t=typeof e.physics<"u"&&this.options.physics!==e.physics||typeof e.hidden<"u"&&(this.options.hidden||!1)!==(e.hidden||!1)||typeof e.from<"u"&&this.options.from!==e.from||typeof e.to<"u"&&this.options.to!==e.to;Lg.parseOptions(this.options,e,!0,this.globalOptions),e.id!==void 0&&(this.id=e.id),e.from!==void 0&&(this.fromId=e.from),e.to!==void 0&&(this.toId=e.to),e.title!==void 0&&(this.title=e.title),e.value!==void 0&&(e.value=ix(e.value));const i=[e,this.options,this.defaultOptions];return this.chooser=Ou("edge",i),this.updateLabelModule(e),t=this.updateEdgeType()||t,this._setInteractionWidths(),this.connect(),t}static parseOptions(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(js(["endPointOffset","arrowStrikethrough","id","from","hidden","hoverWidth","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","selfReference","to","title","value","width","font","chosen","widthConstraint"],e,t,i),t.endPointOffset!==void 0&&t.endPointOffset.from!==void 0&&(jo(t.endPointOffset.from)?e.endPointOffset.from=t.endPointOffset.from:(e.endPointOffset.from=o.endPointOffset.from!==void 0?o.endPointOffset.from:0,console.error("endPointOffset.from is not a valid number"))),t.endPointOffset!==void 0&&t.endPointOffset.to!==void 0&&(jo(t.endPointOffset.to)?e.endPointOffset.to=t.endPointOffset.to:(e.endPointOffset.to=o.endPointOffset.to!==void 0?o.endPointOffset.to:0,console.error("endPointOffset.to is not a valid number"))),gI(t.label)?e.label=t.label:gI(e.label)||(e.label=void 0),ri(e,t,"smooth",o),ri(e,t,"shadow",o),ri(e,t,"background",o),t.dashes!==void 0&&t.dashes!==null?e.dashes=t.dashes:i===!0&&t.dashes===null&&(e.dashes=Mg(o.dashes)),t.scaling!==void 0&&t.scaling!==null?(t.scaling.min!==void 0&&(e.scaling.min=t.scaling.min),t.scaling.max!==void 0&&(e.scaling.max=t.scaling.max),ri(e.scaling,t.scaling,"label",o.scaling)):i===!0&&t.scaling===null&&(e.scaling=Mg(o.scaling)),t.arrows!==void 0&&t.arrows!==null)if(typeof t.arrows=="string"){const I=t.arrows.toLowerCase();e.arrows.to.enabled=It(I).call(I,"to")!=-1,e.arrows.middle.enabled=It(I).call(I,"middle")!=-1,e.arrows.from.enabled=It(I).call(I,"from")!=-1}else if(typeof t.arrows=="object")ri(e.arrows,t.arrows,"to",o.arrows),ri(e.arrows,t.arrows,"middle",o.arrows),ri(e.arrows,t.arrows,"from",o.arrows);else throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+Os(t.arrows));else i===!0&&t.arrows===null&&(e.arrows=Mg(o.arrows));if(t.color!==void 0&&t.color!==null){const I=_s(t.color)?{color:t.color,highlight:t.color,hover:t.color,inherit:!1,opacity:1}:t.color,l=e.color;if(r)vt(l,o.color,!1,i);else for(const c in l)Object.prototype.hasOwnProperty.call(l,c)&&delete l[c];if(_s(l))l.color=l,l.highlight=l,l.hover=l,l.inherit=!1,I.opacity===void 0&&(l.opacity=1);else{let c=!1;I.color!==void 0&&(l.color=I.color,c=!0),I.highlight!==void 0&&(l.highlight=I.highlight,c=!0),I.hover!==void 0&&(l.hover=I.hover,c=!0),I.inherit!==void 0&&(l.inherit=I.inherit),I.opacity!==void 0&&(l.opacity=Math.min(1,Math.max(0,I.opacity))),c===!0?l.inherit=!1:l.inherit===void 0&&(l.inherit="from")}}else i===!0&&t.color===null&&(e.color=kg(o.color));i===!0&&t.font===null&&(e.font=kg(o.font)),Object.prototype.hasOwnProperty.call(t,"selfReferenceSize")&&(console.warn("The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}"),e.selfReference.size=t.selfReferenceSize)}getFormattingValues(){const e=this.options.arrows.to===!0||this.options.arrows.to.enabled===!0,t=this.options.arrows.from===!0||this.options.arrows.from.enabled===!0,i=this.options.arrows.middle===!0||this.options.arrows.middle.enabled===!0,o=this.options.color.inherit,r={toArrow:e,toArrowScale:this.options.arrows.to.scaleFactor,toArrowType:this.options.arrows.to.type,toArrowSrc:this.options.arrows.to.src,toArrowImageWidth:this.options.arrows.to.imageWidth,toArrowImageHeight:this.options.arrows.to.imageHeight,middleArrow:i,middleArrowScale:this.options.arrows.middle.scaleFactor,middleArrowType:this.options.arrows.middle.type,middleArrowSrc:this.options.arrows.middle.src,middleArrowImageWidth:this.options.arrows.middle.imageWidth,middleArrowImageHeight:this.options.arrows.middle.imageHeight,fromArrow:t,fromArrowScale:this.options.arrows.from.scaleFactor,fromArrowType:this.options.arrows.from.type,fromArrowSrc:this.options.arrows.from.src,fromArrowImageWidth:this.options.arrows.from.imageWidth,fromArrowImageHeight:this.options.arrows.from.imageHeight,arrowStrikethrough:this.options.arrowStrikethrough,color:o?void 0:this.options.color.color,inheritsColor:o,opacity:this.options.color.opacity,hidden:this.options.hidden,length:this.options.length,shadow:this.options.shadow.enabled,shadowColor:this.options.shadow.color,shadowSize:this.options.shadow.size,shadowX:this.options.shadow.x,shadowY:this.options.shadow.y,dashes:this.options.dashes,width:this.options.width,background:this.options.background.enabled,backgroundColor:this.options.background.color,backgroundSize:this.options.background.size,backgroundDashes:this.options.background.dashes};if(this.selected||this.hover)if(this.chooser===!0){if(this.selected){const A=this.options.selectionWidth;typeof A=="function"?r.width=A(r.width):typeof A=="number"&&(r.width+=A),r.width=Math.max(r.width,.3/this.body.view.scale),r.color=this.options.color.highlight,r.shadow=this.options.shadow.enabled}else if(this.hover){const A=this.options.hoverWidth;typeof A=="function"?r.width=A(r.width):typeof A=="number"&&(r.width+=A),r.width=Math.max(r.width,.3/this.body.view.scale),r.color=this.options.color.hover,r.shadow=this.options.shadow.enabled}}else typeof this.chooser=="function"&&(this.chooser(r,this.options.id,this.selected,this.hover),r.color!==void 0&&(r.inheritsColor=!1),r.shadow===!1&&(r.shadowColor!==this.options.shadow.color||r.shadowSize!==this.options.shadow.size||r.shadowX!==this.options.shadow.x||r.shadowY!==this.options.shadow.y)&&(r.shadow=!0));else r.shadow=this.options.shadow.enabled,r.width=Math.max(r.width,.3/this.body.view.scale);return r}updateLabelModule(e){const t=[e,this.options,this.globalOptions,this.defaultOptions];this.labelModule.update(this.options,t),this.labelModule.baseSize!==void 0&&(this.baseFontSize=this.labelModule.baseSize)}updateEdgeType(){const e=this.options.smooth;let t=!1,i=!0;return this.edgeType!==void 0&&((this.edgeType instanceof fx&&e.enabled===!0&&e.type==="dynamic"||this.edgeType instanceof mx&&e.enabled===!0&&e.type==="cubicBezier"||this.edgeType instanceof px&&e.enabled===!0&&e.type!=="dynamic"&&e.type!=="cubicBezier"||this.edgeType instanceof vx&&e.type.enabled===!1)&&(i=!1),i===!0&&(t=this.cleanup())),i===!0?e.enabled===!0?e.type==="dynamic"?(t=!0,this.edgeType=new fx(this.options,this.body,this.labelModule)):e.type==="cubicBezier"?this.edgeType=new mx(this.options,this.body,this.labelModule):this.edgeType=new px(this.options,this.body,this.labelModule):this.edgeType=new vx(this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),t}connect(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=this.from!==void 0&&this.to!==void 0,this.connected===!0?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}disconnect(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}getTitle(){return this.title}isSelected(){return this.selected}getValue(){return this.options.value}setValueRange(e,t,i){if(this.options.value!==void 0){const o=this.options.scaling.customScalingFunction(e,t,i,this.options.value),r=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){const A=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+o*A}this.options.width=this.options.scaling.min+o*r}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}_setInteractionWidths(){typeof this.options.hoverWidth=="function"?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,typeof this.options.selectionWidth=="function"?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}draw(e){const t=this.getFormattingValues();if(t.hidden)return;const i=this.edgeType.getViaNode();this.edgeType.drawLine(e,t,this.selected,this.hover,i),this.drawLabel(e,i)}drawArrows(e){const t=this.getFormattingValues();if(t.hidden)return;const i=this.edgeType.getViaNode(),o={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,t.fromArrow&&(o.from=this.edgeType.getArrowData(e,"from",i,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.fromPoint=o.from.core),t.fromArrowSrc&&(o.from.image=this.imagelist.load(t.fromArrowSrc)),t.fromArrowImageWidth&&(o.from.imageWidth=t.fromArrowImageWidth),t.fromArrowImageHeight&&(o.from.imageHeight=t.fromArrowImageHeight)),t.toArrow&&(o.to=this.edgeType.getArrowData(e,"to",i,this.selected,this.hover,t),t.arrowStrikethrough===!1&&(this.edgeType.toPoint=o.to.core),t.toArrowSrc&&(o.to.image=this.imagelist.load(t.toArrowSrc)),t.toArrowImageWidth&&(o.to.imageWidth=t.toArrowImageWidth),t.toArrowImageHeight&&(o.to.imageHeight=t.toArrowImageHeight)),t.middleArrow&&(o.middle=this.edgeType.getArrowData(e,"middle",i,this.selected,this.hover,t),t.middleArrowSrc&&(o.middle.image=this.imagelist.load(t.middleArrowSrc)),t.middleArrowImageWidth&&(o.middle.imageWidth=t.middleArrowImageWidth),t.middleArrowImageHeight&&(o.middle.imageHeight=t.middleArrowImageHeight)),t.fromArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,o.from),t.middleArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,o.middle),t.toArrow&&this.edgeType.drawArrowHead(e,t,this.selected,this.hover,o.to)}drawLabel(e,t){if(this.options.label!==void 0){const i=this.from,o=this.to;this.labelModule.differentState(this.selected,this.hover)&&this.labelModule.getTextSize(e,this.selected,this.hover);let r;if(i.id!=o.id){this.labelModule.pointToSelf=!1,r=this.edgeType.getPoint(.5,t),e.save();const A=this._getRotation(e);A.angle!=0&&(e.translate(A.x,A.y),e.rotate(A.angle)),this.labelModule.draw(e,r.x,r.y,this.selected,this.hover),e.restore()}else{this.labelModule.pointToSelf=!0;const A=gx(e,this.options.selfReference.angle,this.options.selfReference.size,i);r=this._pointOnCircle(A.x,A.y,this.options.selfReference.size,this.options.selfReference.angle),this.labelModule.draw(e,r.x,r.y,this.selected,this.hover)}}}getItemsOnPoint(e){const t=[];if(this.labelModule.visible()){const o=this._getRotation();Nu(this.labelModule.getSize(),e,o)&&t.push({edgeId:this.id,labelId:0})}const i={left:e.x,top:e.y};return this.isOverlappingWith(i)&&t.push({edgeId:this.id}),t}isOverlappingWith(e){if(this.connected){const i=this.from.x,o=this.from.y,r=this.to.x,A=this.to.y,I=e.left,l=e.top;return this.edgeType.getDistanceToEdge(i,o,r,A,I,l)<10}else return!1}_getRotation(e){const t=this.edgeType.getViaNode(),i=this.edgeType.getPoint(.5,t);e!==void 0&&this.labelModule.calculateLabelSize(e,this.selected,this.hover,i.x,i.y);const o={x:i.x,y:this.labelModule.size.yLine,angle:0};if(!this.labelModule.visible()||this.options.font.align==="horizontal")return o;const r=this.from.y-this.to.y,A=this.from.x-this.to.x;let I=Math.atan2(r,A);return(I<-1&&A<0||I>0&&A<0)&&(I+=Math.PI),o.angle=I,o}_pointOnCircle(e,t,i,o){return{x:e+i*Math.cos(o),y:t-i*Math.sin(o)}}select(){this.selected=!0}unselect(){this.selected=!1}cleanup(){return this.edgeType.cleanup()}remove(){this.cleanup(),this.disconnect(),delete this.body.edges[this.id]}endPointsValid(){return this.body.nodes[this.fromId]!==void 0&&this.body.nodes[this.toId]!==void 0}}class oq{constructor(e,t,i){var o;this.body=e,this.images=t,this.groups=i,this.body.functions.createEdge=oe(o=this.create).call(o,this),this.edgesListeners={add:(r,A)=>{this.add(A.items)},update:(r,A)=>{this.update(A.items)},remove:(r,A)=>{this.remove(A.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1,type:"arrow"},middle:{enabled:!1,scaleFactor:1,type:"arrow"},from:{enabled:!1,scaleFactor:1,type:"arrow"}},endPointOffset:{from:0,to:0},arrowStrikethrough:!0,color:{color:"#848484",highlight:"#848484",hover:"#848484",inherit:"from",opacity:1},dashes:!1,font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:2,strokeColor:"#ffffff",align:"horizontal",multi:!1,vadjust:0,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"courier new",vadjust:2}},hidden:!1,hoverWidth:1.5,label:void 0,labelHighlightBold:!0,length:void 0,physics:!0,scaling:{min:1,max:15,label:{enabled:!0,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(r,A,I,l){if(A===r)return .5;{const c=1/(A-r);return Math.max(0,(l-r)*c)}}},selectionWidth:1.5,selfReference:{size:20,angle:Math.PI/4,renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},background:{enabled:!1,color:"rgba(111,111,111,1)",size:10,dashes:!1},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},vt(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e=this,t,i;this.body.emitter.on("_forceDisableDynamicCurves",function(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;o==="dynamic"&&(o="continuous");let A=!1;for(const I in e.body.edges)if(Object.prototype.hasOwnProperty.call(e.body.edges,I)){const l=e.body.edges[I],c=e.body.data.edges.get(I);if(c!=null){const h=c.smooth;h!==void 0&&h.enabled===!0&&h.type==="dynamic"&&(o===void 0?l.setOptions({smooth:!1}):l.setOptions({smooth:{type:o}}),A=!0)}}r===!0&&A===!0&&e.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",()=>{this.reconnectEdges()}),this.body.emitter.on("refreshEdges",oe(t=this.refresh).call(t,this)),this.body.emitter.on("refresh",oe(i=this.refresh).call(i,this)),this.body.emitter.on("destroy",()=>{Ke(this.edgesListeners,(o,r)=>{this.body.data.edges&&this.body.data.edges.off(r,o)}),delete this.body.functions.createEdge,delete this.edgesListeners.add,delete this.edgesListeners.update,delete this.edgesListeners.remove,delete this.edgesListeners})}setOptions(e){if(e!==void 0){Lg.parseOptions(this.options,e,!0,this.defaultOptions,!0);let t=!1;if(e.smooth!==void 0)for(const i in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,i)&&(t=this.body.edges[i].updateEdgeType()||t);if(e.font!==void 0)for(const i in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,i)&&this.body.edges[i].updateLabelModule();(e.hidden!==void 0||e.physics!==void 0||t===!0)&&this.body.emitter.emit("_dataChanged")}}setData(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.body.data.edges;if(qw("id",e))this.body.data.edges=e;else if(nt(e))this.body.data.edges=new Vs,this.body.data.edges.add(e);else if(!e)this.body.data.edges=new Vs;else throw new TypeError("Array or DataSet expected");if(i&&Ke(this.edgesListeners,(o,r)=>{i.off(r,o)}),this.body.edges={},this.body.data.edges){Ke(this.edgesListeners,(r,A)=>{this.body.data.edges.on(A,r)});const o=this.body.data.edges.getIds();this.add(o,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),t===!1&&this.body.emitter.emit("_dataChanged")}add(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.body.edges,o=this.body.data.edges;for(let r=0;r1&&arguments[1]!==void 0?arguments[1]:!0;if(e.length===0)return;const i=this.body.edges;Ke(e,o=>{const r=i[o];r!==void 0&&r.remove()}),t&&this.body.emitter.emit("_dataChanged")}refresh(){Ke(this.body.edges,(e,t)=>{const i=this.body.data.edges.get(t);i!==void 0&&e.setOptions(i)})}create(e){return new Lg(e,this.body,this.images,this.options,this.defaultOptions)}reconnectEdges(){let e;const t=this.body.nodes,i=this.body.edges;for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(t[e].edges=[]);for(e in i)if(Object.prototype.hasOwnProperty.call(i,e)){const o=i[e];o.from=null,o.to=null,o.connect()}}getConnectedNodes(e){const t=[];if(this.body.edges[e]!==void 0){const i=this.body.edges[e];i.fromId!==void 0&&t.push(i.fromId),i.toId!==void 0&&t.push(i.toId)}return t}_updateState(){this._addMissingEdges(),this._removeInvalidEdges()}_removeInvalidEdges(){const e=[];Ke(this.body.edges,(t,i)=>{const o=this.body.nodes[t.toId],r=this.body.nodes[t.fromId];o!==void 0&&o.isCluster===!0||r!==void 0&&r.isCluster===!0||(o===void 0||r===void 0)&&e.push(i)}),this.remove(e,!1)}_addMissingEdges(){const e=this.body.data.edges;if(e==null)return;const t=this.body.edges,i=[];tt(e).call(e,(o,r)=>{t[r]===void 0&&i.push(r)}),this.add(i,!0)}}class bx{constructor(e,t,i){this.body=e,this.physicsBody=t,this.barnesHutTree,this.setOptions(i),this._rng=UC("BARNES HUT SOLVER")}setOptions(e){this.options=e,this.thetaInversed=1/this.options.theta,this.overlapAvoidanceFactor=1-Math.max(0,Math.min(1,this.options.avoidOverlap))}solve(){if(this.options.gravitationalConstant!==0&&this.physicsBody.physicsNodeIndices.length>0){let e;const t=this.body.nodes,i=this.physicsBody.physicsNodeIndices,o=i.length,r=this._formBarnesHutTree(t,i);this.barnesHutTree=r;for(let A=0;A0&&this._getForceContributions(r.root,e)}}_getForceContributions(e,t){this._getForceContribution(e.children.NW,t),this._getForceContribution(e.children.NE,t),this._getForceContribution(e.children.SW,t),this._getForceContribution(e.children.SE,t)}_getForceContribution(e,t){if(e.childrenCount>0){const i=e.centerOfMass.x-t.x,o=e.centerOfMass.y-t.y,r=Math.sqrt(i*i+o*o);r*e.calcSize>this.thetaInversed?this._calculateForces(r,i,o,t,e):e.childrenCount===4?this._getForceContributions(e,t):e.children.data.id!=t.id&&this._calculateForces(r,i,o,t,e)}}_calculateForces(e,t,i,o,r){e===0&&(e=.1,t=e),this.overlapAvoidanceFactor<1&&o.shape.radius&&(e=Math.max(.1+this.overlapAvoidanceFactor*o.shape.radius,e-o.shape.radius));const A=this.options.gravitationalConstant*r.mass*o.options.mass/Math.pow(e,3),I=t*A,l=i*A;this.physicsBody.forces[o.id].x+=I,this.physicsBody.forces[o.id].y+=l}_formBarnesHutTree(e,t){let i;const o=t.length;let r=e[t[0]].x,A=e[t[0]].y,I=e[t[0]].x,l=e[t[0]].y;for(let x=1;x0&&(EI&&(I=E),_l&&(l=_))}const c=Math.abs(I-r)-Math.abs(l-A);c>0?(A-=.5*c,l+=.5*c):(r+=.5*c,I-=.5*c);const p=Math.max(1e-5,Math.abs(I-r)),m=.5*p,b=.5*(r+I),w=.5*(A+l),O={root:{centerOfMass:{x:0,y:0},mass:0,range:{minX:b-m,maxX:b+m,minY:w-m,maxY:w+m},size:p,calcSize:1/p,children:{data:null},maxWidth:0,level:0,childrenCount:4}};this._splitBranch(O.root);for(let x=0;x0&&this._placeInTree(O.root,i);return O}_updateBranchMass(e,t){const i=e.centerOfMass,o=e.mass+t.options.mass,r=1/o;i.x=i.x*e.mass+t.x*t.options.mass,i.x*=r,i.y=i.y*e.mass+t.y*t.options.mass,i.y*=r,e.mass=o;const A=Math.max(Math.max(t.height,t.radius),t.width);e.maxWidth=e.maxWidtht.x?o.maxY>t.y?r="NW":r="SW":o.maxY>t.y?r="NE":r="SE",this._placeInRegion(e,t,r)}_placeInRegion(e,t,i){const o=e.children[i];switch(o.childrenCount){case 0:o.children.data=t,o.childrenCount=1,this._updateBranchMass(o,t);break;case 1:o.children.data.x===t.x&&o.children.data.y===t.y?(t.x+=this._rng(),t.y+=this._rng()):(this._splitBranch(o),this._placeInTree(o,t));break;case 4:this._placeInTree(o,t);break}}_splitBranch(e){let t=null;e.childrenCount===1&&(t=e.children.data,e.mass=0,e.centerOfMass.x=0,e.centerOfMass.y=0),e.childrenCount=4,e.children.data=null,this._insertRegion(e,"NW"),this._insertRegion(e,"NE"),this._insertRegion(e,"SW"),this._insertRegion(e,"SE"),t!=null&&this._placeInTree(e,t)}_insertRegion(e,t){let i,o,r,A;const I=.5*e.size;switch(t){case"NW":i=e.range.minX,o=e.range.minX+I,r=e.range.minY,A=e.range.minY+I;break;case"NE":i=e.range.minX+I,o=e.range.maxX,r=e.range.minY,A=e.range.minY+I;break;case"SW":i=e.range.minX,o=e.range.minX+I,r=e.range.minY+I,A=e.range.maxY;break;case"SE":i=e.range.minX+I,o=e.range.maxX,r=e.range.minY+I,A=e.range.maxY;break}e.children[t]={centerOfMass:{x:0,y:0},mass:0,range:{minX:i,maxX:o,minY:r,maxY:A},size:.5*e.size,calcSize:2*e.calcSize,children:{data:null},maxWidth:0,level:e.level+1,childrenCount:0}}_debug(e,t){this.barnesHutTree!==void 0&&(e.lineWidth=1,this._drawBranch(this.barnesHutTree.root,e,t))}_drawBranch(e,t,i){i===void 0&&(i="#FF0000"),e.childrenCount===4&&(this._drawBranch(e.children.NW,t),this._drawBranch(e.children.NE,t),this._drawBranch(e.children.SE,t),this._drawBranch(e.children.SW,t)),t.strokeStyle=i,t.beginPath(),t.moveTo(e.range.minX,e.range.minY),t.lineTo(e.range.maxX,e.range.minY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.minY),t.lineTo(e.range.maxX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.maxX,e.range.maxY),t.lineTo(e.range.minX,e.range.maxY),t.stroke(),t.beginPath(),t.moveTo(e.range.minX,e.range.maxY),t.lineTo(e.range.minX,e.range.minY),t.stroke()}}class sq{constructor(e,t,i){this._rng=UC("REPULSION SOLVER"),this.body=e,this.physicsBody=t,this.setOptions(i)}setOptions(e){this.options=e}solve(){let e,t,i,o,r,A,I,l;const c=this.body.nodes,h=this.physicsBody.physicsNodeIndices,p=this.physicsBody.forces,m=this.options.nodeDistance,b=-2/3/m,w=4/3;for(let O=0;O0){const A=r.edges.length+1,I=this.options.centralGravity*A*r.options.mass;o[r.id].x=t*I,o[r.id].y=i*I}}}class Iq{constructor(e){this.body=e,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:"barnesHut",stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0,wind:{x:0,y:0}},Yt(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("initPhysics",()=>{this.initPhysics()}),this.body.emitter.on("_layoutFailed",()=>{this.layoutFailed=!0}),this.body.emitter.on("resetPhysics",()=>{this.stopSimulation(),this.ready=!1}),this.body.emitter.on("disablePhysics",()=>{this.physicsEnabled=!1,this.stopSimulation()}),this.body.emitter.on("restorePhysics",()=>{this.setOptions(this.options),this.ready===!0&&this.startSimulation()}),this.body.emitter.on("startSimulation",()=>{this.ready===!0&&this.startSimulation()}),this.body.emitter.on("stopSimulation",()=>{this.stopSimulation()}),this.body.emitter.on("destroy",()=>{this.stopSimulation(!1),this.body.emitter.off()}),this.body.emitter.on("_dataChanged",()=>{this.updatePhysicsData()})}setOptions(e){if(e!==void 0)if(e===!1)this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation();else if(e===!0)this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation();else{this.physicsEnabled=!0,YC(["stabilization"],this.options,e),ri(this.options,e,"stabilization"),e.enabled===void 0&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation());const t=this.options.wind;t&&((typeof t.x!="number"||du(t.x))&&(t.x=0),(typeof t.y!="number"||du(t.y))&&(t.y=0)),this.timestep=this.options.timestep}this.init()}init(){let e;this.options.solver==="forceAtlas2Based"?(e=this.options.forceAtlas2Based,this.nodesSolver=new Aq(this.body,this.physicsBody,e),this.edgesSolver=new Ru(this.body,this.physicsBody,e),this.gravitySolver=new Cq(this.body,this.physicsBody,e)):this.options.solver==="repulsion"?(e=this.options.repulsion,this.nodesSolver=new sq(this.body,this.physicsBody,e),this.edgesSolver=new Ru(this.body,this.physicsBody,e),this.gravitySolver=new oI(this.body,this.physicsBody,e)):this.options.solver==="hierarchicalRepulsion"?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new rq(this.body,this.physicsBody,e),this.edgesSolver=new aq(this.body,this.physicsBody,e),this.gravitySolver=new oI(this.body,this.physicsBody,e)):(e=this.options.barnesHut,this.nodesSolver=new bx(this.body,this.physicsBody,e),this.edgesSolver=new Ru(this.body,this.physicsBody,e),this.gravitySolver=new oI(this.body,this.physicsBody,e)),this.modelOptions=e}initPhysics(){this.physicsEnabled===!0&&this.options.enabled===!0?this.options.stabilization.enabled===!0?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}startSimulation(){if(this.physicsEnabled===!0&&this.options.enabled===!0){if(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),this.viewFunction===void 0){var e;this.viewFunction=oe(e=this.simulationStep).call(e,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}else this.body.emitter.emit("_redraw")}stopSimulation(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.stabilized=!0,e===!0&&this._emitStabilized(),this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,e===!0&&this.body.emitter.emit("_stopRendering"))}simulationStep(){const e=zC();this.physicsTick(),(zC()-e<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}_emitStabilized(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||this.startedStabilization===!0)&&_i(()=>{this.body.emitter.emit("stabilized",{iterations:e}),this.startedStabilization=!1,this.stabilizationIterations=0},0)}physicsStep(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}adjustTimeStep(){this._evaluateStepQuality()===!0?this.timestep=1.2*this.timestep:this.timestep/1.2A))return!1;return!0}moveNodes(){const e=this.physicsBody.physicsNodeIndices;let t=0,i=0;const o=5;for(let r=0;rA&&(e=e>0?A:-A),e}_performStep(e){const t=this.body.nodes[e],i=this.physicsBody.forces[e];this.options.wind&&(i.x+=this.options.wind.x,i.y+=this.options.wind.y);const o=this.physicsBody.velocities[e];return this.previousStates[e]={x:t.x,y:t.y,vx:o.x,vy:o.y},t.options.fixed.x===!1?(o.x=this.calculateComponentVelocity(o.x,i.x,t.options.mass),t.x+=o.x*this.timestep):(i.x=0,o.x=0),t.options.fixed.y===!1?(o.y=this.calculateComponentVelocity(o.y,i.y,t.options.mass),t.y+=o.y*this.timestep):(i.y=0,o.y=0),Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2))}_freezeNodes(){const e=this.body.nodes;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t].x&&e[t].y){const i=e[t].options.fixed;this.freezeCache[t]={x:i.x,y:i.y},i.x=!0,i.y=!0}}_restoreFrozenNodes(){const e=this.body.nodes;for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.freezeCache[t]!==void 0&&(e[t].options.fixed.x=this.freezeCache[t].x,e[t].options.fixed.y=this.freezeCache[t].y);this.freezeCache={}}stabilize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.stabilization.iterations;if(typeof e!="number"&&(e=this.options.stabilization.iterations,console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ",e)),this.physicsBody.physicsNodeIndices.length===0){this.ready=!0;return}this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=e,this.options.stabilization.onlyDynamicEdges===!0&&this._freezeNodes(),this.stabilizationIterations=0,_i(()=>this._stabilizationBatch(),0)}_startStabilizing(){return this.startedStabilization===!0?!1:(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}_stabilizationBatch(){const e=()=>this.stabilized===!1&&this.stabilizationIterations{this.body.emitter.emit("stabilizationProgress",{iterations:this.stabilizationIterations,total:this.targetIterations})};this._startStabilizing()&&t();let i=0;for(;e()&&i1&&arguments[1]!==void 0?arguments[1]:[],i=1e9,o=-1e9,r=1e9,A=-1e9,I;if(t.length>0)for(let l=0;lI.shape.boundingBox.left&&(r=I.shape.boundingBox.left),AI.shape.boundingBox.top&&(i=I.shape.boundingBox.top),o1&&arguments[1]!==void 0?arguments[1]:[],i=1e9,o=-1e9,r=1e9,A=-1e9,I;if(t.length>0)for(let l=0;lI.x&&(r=I.x),AI.y&&(i=I.y),o{delete this.containedEdges[i.id]}),Ke(t.containedNodes,(i,o)=>{this.containedNodes[o]=i}),t.containedNodes={},Ke(t.containedEdges,(i,o)=>{this.containedEdges[o]=i}),t.containedEdges={},Ke(t.edges,i=>{Ke(this.edges,o=>{var r,A;const I=It(r=o.clusteringEdgeReplacingIds).call(r,i.id);I!==-1&&(Ke(i.clusteringEdgeReplacingIds,l=>{o.clusteringEdgeReplacingIds.push(l),this.body.edges[l].edgeReplacedById=o.id}),ki(A=o.clusteringEdgeReplacingIds).call(A,I,1))})}),t.edges=[]}}class cq{constructor(e){this.body=e,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},Yt(this.options,this.defaultOptions),this.body.emitter.on("_resetData",()=>{this.clusteredNodes={},this.clusteredEdges={}})}clusterByHubsize(e,t){e===void 0?e=this._getHubSize():typeof e=="object"&&(t=this._checkOptions(e),e=this._getHubSize());const i=[];for(let o=0;o=e&&i.push(r.id)}for(let o=0;o0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.joinCondition===void 0)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");e=this._checkOptions(e);const i={},o={};Ke(this.body.nodes,(r,A)=>{r.options&&e.joinCondition(r.options)===!0&&(i[A]=r,Ke(r.edges,I=>{this.clusteredEdges[I.id]===void 0&&(o[I.id]=I)}))}),this._cluster(i,o,e,t)}clusterByEdgeCount(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;t=this._checkOptions(t);const o=[],r={};let A,I,l;for(let c=0;c0&&xt(p).length>0&&O===!0){const S=function(){for(let E=0;E1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(1,e,t)}clusterBridges(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.clusterByEdgeCount(2,e,t)}clusterByConnection(e,t){var i;let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No nodeId supplied to clusterByConnection!");if(this.body.nodes[e]===void 0)throw new Error("The nodeId given to clusterByConnection does not exist!");const r=this.body.nodes[e];t=this._checkOptions(t,r),t.clusterNodeProperties.x===void 0&&(t.clusterNodeProperties.x=r.x),t.clusterNodeProperties.y===void 0&&(t.clusterNodeProperties.y=r.y),t.clusterNodeProperties.fixed===void 0&&(t.clusterNodeProperties.fixed={},t.clusterNodeProperties.fixed.x=r.options.fixed.x,t.clusterNodeProperties.fixed.y=r.options.fixed.y);const A={},I={},l=r.id,c=Dn.cloneOptions(r);A[l]=r;for(let p=0;p-1&&(I[w.id]=w)}}this._cluster(A,I,t,o)}_createClusterEdges(e,t,i,o){let r,A,I,l,c,h;const p=xt(e),m=[];for(let O=0;O0&&arguments[0]!==void 0?arguments[0]:{};return e.clusterEdgeProperties===void 0&&(e.clusterEdgeProperties={}),e.clusterNodeProperties===void 0&&(e.clusterNodeProperties={}),e}_cluster(e,t,i){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;const r=[];for(const h in e)Object.prototype.hasOwnProperty.call(e,h)&&this.clusteredNodes[h]!==void 0&&r.push(h);for(let h=0;ho?I.x:o,r=I.yA?I.y:A;return{x:.5*(i+o),y:.5*(r+A)}}openCluster(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0)throw new Error("No clusterNodeId supplied to openCluster.");const o=this.body.nodes[e];if(o===void 0)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(o.isCluster!==!0||o.containedNodes===void 0||o.containedEdges===void 0)throw new Error("The node:"+e+" is not a valid cluster.");const r=this.findNode(e),A=It(r).call(r,e)-1;if(A>=0){const h=r[A];this.body.nodes[h]._openChildCluster(e),delete this.body.nodes[e],i===!0&&this.body.emitter.emit("_dataChanged");return}const I=o.containedNodes,l=o.containedEdges;if(t!==void 0&&t.releaseFunction!==void 0&&typeof t.releaseFunction=="function"){const h={},p={x:o.x,y:o.y};for(const b in I)if(Object.prototype.hasOwnProperty.call(I,b)){const w=this.body.nodes[b];h[b]={x:w.x,y:w.y}}const m=t.releaseFunction(p,h);for(const b in I)if(Object.prototype.hasOwnProperty.call(I,b)){const w=this.body.nodes[b];m[b]!==void 0&&(w.x=m[b].x===void 0?o.x:m[b].x,w.y=m[b].y===void 0?o.y:m[b].y)}}else Ke(I,function(h){h.options.fixed.x===!1&&(h.x=o.x),h.options.fixed.y===!1&&(h.y=o.y)});for(const h in I)if(Object.prototype.hasOwnProperty.call(I,h)){const p=this.body.nodes[h];p.vx=o.vx,p.vy=o.vy,p.setOptions({physics:!0}),delete this.clusteredNodes[h]}const c=[];for(let h=0;h0&&Ao&&(o=c.edges.length),e+=c.edges.length,t+=Math.pow(c.edges.length,2),i+=1}e=e/i,t=t/i;const r=t-Math.pow(e,2),A=Math.sqrt(r);let I=Math.floor(e+2*A);return I>o&&(I=o),I}_createClusteredEdge(e,t,i,o,r){const A=Dn.cloneOptions(i,"edge");vt(A,o),A.from=e,A.to=t,A.id="clusterEdge:"+Fs(),r!==void 0&&vt(A,r);const I=this.body.functions.createEdge(A);return I.clusteringEdgeReplacingIds=[i.id],I.connect(),this.body.edges[I.id]=I,I}_clusterEdges(e,t,i,o){if(t instanceof Lg){const r=t,A={};A[r.id]=r,t=A}if(e instanceof Nt){const r=e,A={};A[r.id]=r,e=A}if(i==null)throw new Error("_clusterEdges: parameter clusterNode required");o===void 0&&(o=i.clusterEdgeProperties),this._createClusterEdges(e,t,i,o);for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&this.body.edges[r]!==void 0){const A=this.body.edges[r];this._backupEdgeOptions(A),A.setOptions({physics:!1})}for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(this.clusteredNodes[r]={clusterId:i.id,node:this.body.nodes[r]},this.body.nodes[r].setOptions({physics:!1}))}_getClusterNodeForNode(e){if(e===void 0)return;const t=this.clusteredNodes[e];if(t===void 0)return;const i=t.clusterId;if(i!==void 0)return this.body.nodes[i]}_filter(e,t){const i=[];return Ke(e,o=>{t(o)&&i.push(o)}),i}_updateState(){let e;const t=[],i={},o=l=>{Ke(this.body.nodes,c=>{c.isCluster===!0&&l(c)})};for(e in this.clusteredNodes){if(!Object.prototype.hasOwnProperty.call(this.clusteredNodes,e))continue;this.body.nodes[e]===void 0&&t.push(e)}o(function(l){for(let c=0;c{const c=this.body.edges[l];(c===void 0||!c.endPointsValid())&&(i[l]=l)}),o(function(l){Ke(l.containedEdges,(c,h)=>{!c.endPointsValid()&&!i[h]&&(i[h]=h)})}),Ke(this.body.edges,(l,c)=>{let h=!0;const p=l.clusteringEdgeReplacingIds;if(p!==void 0){let m=0;Ke(p,b=>{const w=this.body.edges[b];w!==void 0&&w.endPointsValid()&&(m+=1)}),h=m>0}(!l.endPointsValid()||!h)&&(i[c]=c)}),o(l=>{Ke(i,c=>{delete l.containedEdges[c],Ke(l.edges,(h,p)=>{if(h.id===c){l.edges[p]=null;return}h.clusteringEdgeReplacingIds=this._filter(h.clusteringEdgeReplacingIds,function(m){return!i[m]})}),l.edges=this._filter(l.edges,function(h){return h!==null})})}),Ke(i,l=>{delete this.clusteredEdges[l]}),Ke(i,l=>{delete this.body.edges[l]});const r=xt(this.body.edges);Ke(r,l=>{const c=this.body.edges[l],h=this._isClusteredNode(c.fromId)||this._isClusteredNode(c.toId);if(h!==this._isClusteredEdge(c.id))if(h){const p=this._getClusterNodeForNode(c.fromId);p!==void 0&&this._clusterEdges(this.body.nodes[c.fromId],c,p);const m=this._getClusterNodeForNode(c.toId);m!==void 0&&this._clusterEdges(this.body.nodes[c.toId],c,m)}else delete this._clusterEdges[l],this._restoreEdge(c)});let A=!1,I=!0;for(;I;){const l=[];o(function(c){const h=xt(c.containedNodes).length,p=c.options.allowSingleNodeCluster===!0;(p&&h<1||!p&&h<2)&&l.push(c.id)});for(let c=0;c0,A=A||I}A&&this._updateState()}_isClusteredNode(e){return this.clusteredNodes[e]!==void 0}_isClusteredEdge(e){return this.clusteredEdges[e]!==void 0}}class dq{constructor(e,t){this.body=e,this.canvas=t,this.redrawRequested=!1,this.requestAnimationFrameRequestId=void 0,this.renderingActive=!1,this.renderRequests=0,this.allowRedraw=!0,this.dragging=!1,this.zooming=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1},Yt(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){var e;this.body.emitter.on("dragStart",()=>{this.dragging=!0}),this.body.emitter.on("dragEnd",()=>{this.dragging=!1}),this.body.emitter.on("zoom",()=>{this.zooming=!0,window.clearTimeout(this.zoomTimeoutId),this.zoomTimeoutId=_i(()=>{var t;this.zooming=!1,oe(t=this._requestRedraw).call(t,this)()},250)}),this.body.emitter.on("_resizeNodes",()=>{this._resizeNodes()}),this.body.emitter.on("_redraw",()=>{this.renderingActive===!1&&this._redraw()}),this.body.emitter.on("_blockRedraw",()=>{this.allowRedraw=!1}),this.body.emitter.on("_allowRedraw",()=>{this.allowRedraw=!0,this.redrawRequested=!1}),this.body.emitter.on("_requestRedraw",oe(e=this._requestRedraw).call(e,this)),this.body.emitter.on("_startRendering",()=>{this.renderRequests+=1,this.renderingActive=!0,this._startRendering()}),this.body.emitter.on("_stopRendering",()=>{this.renderRequests-=1,this.renderingActive=this.renderRequests>0,this.requestAnimationFrameRequestId=void 0}),this.body.emitter.on("destroy",()=>{this.renderRequests=0,this.allowRedraw=!1,this.renderingActive=!1,window.cancelAnimationFrame(this.requestAnimationFrameRequestId),this.body.emitter.off()})}setOptions(e){e!==void 0&&js(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag"],this.options,e)}_startRendering(){if(this.renderingActive===!0&&this.requestAnimationFrameRequestId===void 0){var e;this.requestAnimationFrameRequestId=window.requestAnimationFrame(oe(e=this._renderStep).call(e,this),this.simulationInterval)}}_renderStep(){this.renderingActive===!0&&(this.requestAnimationFrameRequestId=void 0,this._startRendering(),this._redraw())}redraw(){this.body.emitter.emit("setSize"),this._redraw()}_requestRedraw(){this.redrawRequested!==!0&&this.renderingActive===!1&&this.allowRedraw===!0&&(this.redrawRequested=!0,window.requestAnimationFrame(()=>{this._redraw(!1)}))}_redraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.allowRedraw===!0){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1;const t={drawExternalLabels:null};(this.canvas.frame.canvas.width===0||this.canvas.frame.canvas.height===0)&&this.canvas.setSize(),this.canvas.setTransform();const i=this.canvas.getContext(),o=this.canvas.frame.canvas.clientWidth,r=this.canvas.frame.canvas.clientHeight;if(i.clearRect(0,0,o,r),this.canvas.frame.clientWidth===0)return;if(i.save(),i.translate(this.body.view.translation.x,this.body.view.translation.y),i.scale(this.body.view.scale,this.body.view.scale),i.beginPath(),this.body.emitter.emit("beforeDrawing",i),i.closePath(),e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawEdges(i),this.dragging===!1||this.dragging===!0&&this.options.hideNodesOnDrag===!1){const{drawExternalLabels:A}=this._drawNodes(i,e);t.drawExternalLabels=A}e===!1&&(this.dragging===!1||this.dragging===!0&&this.options.hideEdgesOnDrag===!1)&&(this.zooming===!1||this.zooming===!0&&this.options.hideEdgesOnZoom===!1)&&this._drawArrows(i),t.drawExternalLabels!=null&&t.drawExternalLabels(),e===!1&&this._drawSelectionBox(i),i.beginPath(),this.body.emitter.emit("afterDrawing",i),i.closePath(),i.restore(),e===!0&&i.clearRect(0,0,o,r)}}_resizeNodes(){this.canvas.setTransform();const e=this.canvas.getContext();e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale);const t=this.body.nodes;let i;for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(i=t[o],i.resize(e),i.updateBoundingBox(e,i.selected));e.restore()}_drawNodes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.body.nodes,o=this.body.nodeIndices;let r;const A=[],I=[],l=20,c=this.canvas.DOMtoCanvas({x:-l,y:-l}),h=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+l,y:this.canvas.frame.canvas.clientHeight+l}),p={top:c.y,left:c.x,bottom:h.y,right:h.x},m=[];for(let x=0;x{for(const x of m)x()}}}_drawEdges(e){const t=this.body.edges,i=this.body.edgeIndices;for(let o=0;o{t.width!==0&&(this.body.view.translation.x=t.width*.5),t.height!==0&&(this.body.view.translation.y=t.height*.5)}),this.body.emitter.on("setSize",oe(e=this.setSize).call(e,this)),this.body.emitter.on("destroy",()=>{this.hammerFrame.destroy(),this.hammer.destroy(),this._cleanUp()})}setOptions(e){if(e!==void 0&&js(["width","height","autoResize"],this.options,e),this._cleanUp(),this.options.autoResize===!0){var t;if(window.ResizeObserver){const o=new ResizeObserver(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")}),{frame:r}=this;o.observe(r),this._cleanupCallbacks.push(()=>{o.unobserve(r)})}else{const o=pq(()=>{this.setSize()===!0&&this.body.emitter.emit("_requestRedraw")},1e3);this._cleanupCallbacks.push(()=>{clearInterval(o)})}const i=oe(t=this._onResize).call(t,this);window.addEventListener("resize",i),this._cleanupCallbacks.push(()=>{window.removeEventListener("resize",i)})}}_cleanUp(){var e,t,i;tt(e=To(t=ki(i=this._cleanupCallbacks).call(i,0)).call(t)).call(e,o=>{try{o()}catch(r){console.error(r)}})}_onResize(){this.setSize(),this.body.emitter.emit("_redraw")}_getCameraState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.pixelRatio;this.initialized===!0&&(this.cameraState.previousWidth=this.frame.canvas.width/e,this.cameraState.previousHeight=this.frame.canvas.height/e,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/e,y:.5*this.frame.canvas.height/e}))}_setCameraState(){if(this.cameraState.scale!==void 0&&this.frame.canvas.clientWidth!==0&&this.frame.canvas.clientHeight!==0&&this.pixelRatio!==0&&this.cameraState.previousWidth>0&&this.cameraState.previousHeight>0){const e=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,t=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight;let i=this.cameraState.scale;e!=1&&t!=1?i=this.cameraState.scale*.5*(e+t):e!=1?i=this.cameraState.scale*e:t!=1&&(i=this.cameraState.scale*t),this.body.view.scale=i;const o=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),r={x:o.x-this.cameraState.position.x,y:o.y-this.cameraState.position.y};this.body.view.translation.x+=r.x*this.body.view.scale,this.body.view.translation.y+=r.y*this.body.view.scale}}_prepareValue(e){if(typeof e=="number")return e+"px";if(typeof e=="string"){if(It(e).call(e,"%")!==-1||It(e).call(e,"px")!==-1)return e;if(It(e).call(e,"%")===-1)return e+"px"}throw new Error("Could not use the value supplied for width or height:"+e)}_create(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=0,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext)this._setPixelRatio(),this.setTransform();else{const e=document.createElement("DIV");e.style.color="red",e.style.fontWeight="bold",e.style.padding="10px",e.innerText="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(e)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}_bindHammer(){this.hammer!==void 0&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new Zs(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:Zs.DIRECTION_ALL}),sI(this.hammer,e=>{this.body.eventListeners.onTouch(e)}),this.hammer.on("tap",e=>{this.body.eventListeners.onTap(e)}),this.hammer.on("doubletap",e=>{this.body.eventListeners.onDoubleTap(e)}),this.hammer.on("press",e=>{this.body.eventListeners.onHold(e)}),this.hammer.on("panstart",e=>{this.body.eventListeners.onDragStart(e)}),this.hammer.on("panmove",e=>{this.body.eventListeners.onDrag(e)}),this.hammer.on("panend",e=>{this.body.eventListeners.onDragEnd(e)}),this.hammer.on("pinch",e=>{this.body.eventListeners.onPinch(e)}),this.frame.canvas.addEventListener("wheel",e=>{this.body.eventListeners.onMouseWheel(e)}),this.frame.canvas.addEventListener("mousemove",e=>{this.body.eventListeners.onMouseMove(e)}),this.frame.canvas.addEventListener("contextmenu",e=>{this.body.eventListeners.onContext(e)}),this.hammerFrame=new Zs(this.frame),yx(this.hammerFrame,e=>{this.body.eventListeners.onRelease(e)})}setSize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.width,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.height;e=this._prepareValue(e),t=this._prepareValue(t);let i=!1;const o=this.frame.canvas.width,r=this.frame.canvas.height,A=this.pixelRatio;if(this._setPixelRatio(),e!=this.options.width||t!=this.options.height||this.frame.style.width!=e||this.frame.style.height!=t)this._getCameraState(A),this.frame.style.width=e,this.frame.style.height=t,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=e,this.options.height=t,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},i=!0;else{const I=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),l=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);(this.frame.canvas.width!==I||this.frame.canvas.height!==l)&&this._getCameraState(A),this.frame.canvas.width!==I&&(this.frame.canvas.width=I,i=!0),this.frame.canvas.height!==l&&(this.frame.canvas.height=l,i=!0)}return i===!0&&(this.body.emitter.emit("resize",{width:Math.round(this.frame.canvas.width/this.pixelRatio),height:Math.round(this.frame.canvas.height/this.pixelRatio),oldWidth:Math.round(o/this.pixelRatio),oldHeight:Math.round(r/this.pixelRatio)}),this._setCameraState()),this.initialized=!0,i}getContext(){return this.frame.canvas.getContext("2d")}_determinePixelRatio(){const e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");let t=1;typeof window<"u"&&(t=window.devicePixelRatio||1);const i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/i}_setPixelRatio(){this.pixelRatio=this._determinePixelRatio()}setTransform(){const e=this.getContext();if(e===void 0)throw new Error("Could not get canvax context");e.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}_XconvertDOMtoCanvas(e){return(e-this.body.view.translation.x)/this.body.view.scale}_XconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.x}_YconvertDOMtoCanvas(e){return(e-this.body.view.translation.y)/this.body.view.scale}_YconvertCanvasToDOM(e){return e*this.body.view.scale+this.body.view.translation.y}canvasToDOM(e){return{x:this._XconvertCanvasToDOM(e.x),y:this._YconvertCanvasToDOM(e.y)}}DOMtoCanvas(e){return{x:this._XconvertDOMtoCanvas(e.x),y:this._YconvertDOMtoCanvas(e.y)}}}function vq(n,e){const t=Yt({nodes:e,minZoomLevel:Number.MIN_VALUE,maxZoomLevel:1},n??{});if(!nt(t.nodes))throw new TypeError("Nodes has to be an array of ids.");if(t.nodes.length===0&&(t.nodes=e),!(typeof t.minZoomLevel=="number"&&t.minZoomLevel>0))throw new TypeError("Min zoom level has to be a number higher than zero.");if(!(typeof t.maxZoomLevel=="number"&&t.minZoomLevel<=t.maxZoomLevel))throw new TypeError("Max zoom level has to be a number higher than min zoom level.");return t}class bq{constructor(e,t){var i,o;this.body=e,this.canvas=t,this.animationSpeed=1/this.renderRefreshRate,this.animationEasingFunction="easeInOutQuint",this.easingTime=0,this.sourceScale=0,this.targetScale=0,this.sourceTranslation=0,this.targetTranslation=0,this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0,this.touchTime=0,this.viewFunction=void 0,this.body.emitter.on("fit",oe(i=this.fit).call(i,this)),this.body.emitter.on("animationFinished",()=>{this.body.emitter.emit("_stopRendering")}),this.body.emitter.on("unlockNode",oe(o=this.releaseNode).call(o,this))}setOptions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.options=e}fit(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;e=vq(e,this.body.nodeIndices);const i=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;let r,A;if(i===0||o===0)A=1,r=Dn.getRange(this.body.nodes,e.nodes);else if(t===!0){let c=0;for(const m in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,m)&&this.body.nodes[m].predefinedPosition===!0&&(c+=1);if(c>.5*this.body.nodeIndices.length){this.fit(e,!1);return}r=Dn.getRange(this.body.nodes,e.nodes),A=12.662/(this.body.nodeIndices.length+7.4147)+.0964822;const p=Math.min(i/600,o/600);A*=p}else{this.body.emitter.emit("_resizeNodes"),r=Dn.getRange(this.body.nodes,e.nodes);const c=Math.abs(r.maxX-r.minX)*1.1,h=Math.abs(r.maxY-r.minY)*1.1,p=i/c,m=o/h;A=p<=m?p:m}A>e.maxZoomLevel?A=e.maxZoomLevel:A1&&arguments[1]!==void 0?arguments[1]:{};if(this.body.nodes[e]!==void 0){const i={x:this.body.nodes[e].x,y:this.body.nodes[e].y};t.position=i,t.lockedOnNode=e,this.moveTo(t)}else console.error("Node: "+e+" cannot be found.")}moveTo(e){if(e===void 0){e={};return}if(e.offset!=null){if(e.offset.x!=null){if(e.offset.x=+e.offset.x,!jo(e.offset.x))throw new TypeError('The option "offset.x" has to be a finite number.')}else e.offset.x=0;if(e.offset.y!=null){if(e.offset.y=+e.offset.y,!jo(e.offset.y))throw new TypeError('The option "offset.y" has to be a finite number.')}else e.offset.x=0}else e.offset={x:0,y:0};if(e.position!=null){if(e.position.x!=null){if(e.position.x=+e.position.x,!jo(e.position.x))throw new TypeError('The option "position.x" has to be a finite number.')}else e.position.x=0;if(e.position.y!=null){if(e.position.y=+e.position.y,!jo(e.position.y))throw new TypeError('The option "position.y" has to be a finite number.')}else e.position.x=0}else e.position=this.getViewPosition();if(e.scale!=null){if(e.scale=+e.scale,!(e.scale>0))throw new TypeError('The option "scale" has to be a number greater than zero.')}else e.scale=this.body.view.scale;e.animation===void 0&&(e.animation={duration:0}),e.animation===!1&&(e.animation={duration:0}),e.animation===!0&&(e.animation={}),e.animation.duration===void 0&&(e.animation.duration=1e3),e.animation.easingFunction===void 0&&(e.animation.easingFunction="easeInOutQuad"),this.animateView(e)}animateView(e){if(e===void 0)return;this.animationEasingFunction=e.animation.easingFunction,this.releaseNode(),e.locked===!0&&(this.lockedOnNodeId=e.lockedOnNode,this.lockedOnNodeOffset=e.offset),this.easingTime!=0&&this._transitionRedraw(!0),this.sourceScale=this.body.view.scale,this.sourceTranslation=this.body.view.translation,this.targetScale=e.scale,this.body.view.scale=this.targetScale;const t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:t.x-e.position.x,y:t.y-e.position.y};if(this.targetTranslation={x:this.sourceTranslation.x+i.x*this.targetScale+e.offset.x,y:this.sourceTranslation.y+i.y*this.targetScale+e.offset.y},e.animation.duration===0)if(this.lockedOnNodeId!=null){var o;this.viewFunction=oe(o=this._lockedRedraw).call(o,this),this.body.emitter.on("initRedraw",this.viewFunction)}else this.body.view.scale=this.targetScale,this.body.view.translation=this.targetTranslation,this.body.emitter.emit("_requestRedraw");else{var r;this.animationSpeed=1/(60*e.animation.duration*.001)||1/60,this.animationEasingFunction=e.animation.easingFunction,this.viewFunction=oe(r=this._transitionRedraw).call(r,this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering")}}_lockedRedraw(){const e={x:this.body.nodes[this.lockedOnNodeId].x,y:this.body.nodes[this.lockedOnNodeId].y},t=this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight}),i={x:t.x-e.x,y:t.y-e.y},o=this.body.view.translation,r={x:o.x+i.x*this.body.view.scale+this.lockedOnNodeOffset.x,y:o.y+i.y*this.body.view.scale+this.lockedOnNodeOffset.y};this.body.view.translation=r}releaseNode(){this.lockedOnNodeId!==void 0&&this.viewFunction!==void 0&&(this.body.emitter.off("initRedraw",this.viewFunction),this.lockedOnNodeId=void 0,this.lockedOnNodeOffset=void 0)}_transitionRedraw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.easingTime+=this.animationSpeed,this.easingTime=e===!0?1:this.easingTime;const t=VU[this.animationEasingFunction](this.easingTime);if(this.body.view.scale=this.sourceScale+(this.targetScale-this.sourceScale)*t,this.body.view.translation={x:this.sourceTranslation.x+(this.targetTranslation.x-this.sourceTranslation.x)*t,y:this.sourceTranslation.y+(this.targetTranslation.y-this.sourceTranslation.y)*t},this.easingTime>=1){if(this.body.emitter.off("initRedraw",this.viewFunction),this.easingTime=0,this.lockedOnNodeId!=null){var i;this.viewFunction=oe(i=this._lockedRedraw).call(i,this),this.body.emitter.on("initRedraw",this.viewFunction)}this.body.emitter.emit("animationFinished")}}getScale(){return this.body.view.scale}getViewPosition(){return this.canvas.DOMtoCanvas({x:.5*this.canvas.frame.canvas.clientWidth,y:.5*this.canvas.frame.canvas.clientHeight})}}var yq=`div.vis-network div.vis-navigation div.vis-button { width: 34px; height: 34px; -moz-border-radius: 17px; @@ -782,7 +782,7 @@ div.vis-network div.vis-navigation div.vis-button.vis-zoomExtends { bottom: 50px; right: 15px; } -`;yo(F$);function hx(n){var e=n&&n.preventDefault||!1,t=n&&n.container||window,i={},o={keydown:{},keyup:{}},r={},A;for(A=97;A<=122;A++)r[String.fromCharCode(A)]={code:65+(A-97),shift:!1};for(A=65;A<=90;A++)r[String.fromCharCode(A)]={code:A,shift:!0};for(A=0;A<=9;A++)r[""+A]={code:48+A,shift:!1};for(A=1;A<=12;A++)r["F"+A]={code:111+A,shift:!1};for(A=0;A<=9;A++)r["num"+A]={code:96+A,shift:!1};r["num*"]={code:106,shift:!1},r["num+"]={code:107,shift:!1},r["num-"]={code:109,shift:!1},r["num/"]={code:111,shift:!1},r["num."]={code:110,shift:!1},r.left={code:37,shift:!1},r.up={code:38,shift:!1},r.right={code:39,shift:!1},r.down={code:40,shift:!1},r.space={code:32,shift:!1},r.enter={code:13,shift:!1},r.shift={code:16,shift:void 0},r.esc={code:27,shift:!1},r.backspace={code:8,shift:!1},r.tab={code:9,shift:!1},r.ctrl={code:17,shift:!1},r.alt={code:18,shift:!1},r.delete={code:46,shift:!1},r.pageup={code:33,shift:!1},r.pagedown={code:34,shift:!1},r["="]={code:187,shift:!1},r["-"]={code:189,shift:!1},r["]"]={code:221,shift:!1},r["["]={code:219,shift:!1};var I=function(h){c(h,"keydown")},l=function(h){c(h,"keyup")},c=function(h,p){if(o[p][h.keyCode]!==void 0){for(var m=o[p][h.keyCode],b=0;b{this.activated=!0,this.configureKeyboardBindings()}),this.body.emitter.on("deactivate",()=>{this.activated=!1,this.configureKeyboardBindings()}),this.body.emitter.on("destroy",()=>{this.keycharm!==void 0&&this.keycharm.destroy()}),this.options={}}setOptions(e){e!==void 0&&(this.options=e,this.create())}create(){this.options.navigationButtons===!0?this.iconsCreated===!1&&this.loadNavigationElements():this.iconsCreated===!0&&this.cleanNavigation(),this.configureKeyboardBindings()}cleanNavigation(){if(this.navigationHammers.length!=0){for(let e=0;e{this._stopMovement()}),this.navigationHammers.push(r),this.iconsCreated=!0}bindToRedraw(e){if(this.boundFunctions[e]===void 0){var t;this.boundFunctions[e]=ge(t=this[e]).call(t,this),this.body.emitter.on("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_startRendering")}}unbindFromRedraw(e){this.boundFunctions[e]!==void 0&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[e])}_fit(){new Date().valueOf()-this.touchTime>700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=new Date().valueOf())}_stopMovement(){for(const e in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,e)&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}_moveUp(){this.body.view.translation.y+=this.options.keyboard.speed.y}_moveDown(){this.body.view.translation.y-=this.options.keyboard.speed.y}_moveLeft(){this.body.view.translation.x+=this.options.keyboard.speed.x}_moveRight(){this.body.view.translation.x-=this.options.keyboard.speed.x}_zoomIn(){const e=this.body.view.scale,t=this.body.view.scale*(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,o=t/e,r=(1-o)*this.canvas.canvasViewCenter.x+i.x*o,A=(1-o)*this.canvas.canvasViewCenter.y+i.y*o;this.body.view.scale=t,this.body.view.translation={x:r,y:A},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}_zoomOut(){const e=this.body.view.scale,t=this.body.view.scale/(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,o=t/e,r=(1-o)*this.canvas.canvasViewCenter.x+i.x*o,A=(1-o)*this.canvas.canvasViewCenter.y+i.y*o;this.body.view.scale=t,this.body.view.translation={x:r,y:A},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}configureKeyboardBindings(){if(this.keycharm!==void 0&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=hx({container:window,preventDefault:!0}):this.keycharm=hx({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0)){var e,t,i,o,r,A,I,l,c,h,p,m,b,w,S,x,O,E,R,B,W,ne,L,G;ge(e=this.keycharm).call(e,"up",()=>{this.bindToRedraw("_moveUp")},"keydown"),ge(t=this.keycharm).call(t,"down",()=>{this.bindToRedraw("_moveDown")},"keydown"),ge(i=this.keycharm).call(i,"left",()=>{this.bindToRedraw("_moveLeft")},"keydown"),ge(o=this.keycharm).call(o,"right",()=>{this.bindToRedraw("_moveRight")},"keydown"),ge(r=this.keycharm).call(r,"=",()=>{this.bindToRedraw("_zoomIn")},"keydown"),ge(A=this.keycharm).call(A,"num+",()=>{this.bindToRedraw("_zoomIn")},"keydown"),ge(I=this.keycharm).call(I,"num-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),ge(l=this.keycharm).call(l,"-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),ge(c=this.keycharm).call(c,"[",()=>{this.bindToRedraw("_zoomOut")},"keydown"),ge(h=this.keycharm).call(h,"]",()=>{this.bindToRedraw("_zoomIn")},"keydown"),ge(p=this.keycharm).call(p,"pageup",()=>{this.bindToRedraw("_zoomIn")},"keydown"),ge(m=this.keycharm).call(m,"pagedown",()=>{this.bindToRedraw("_zoomOut")},"keydown"),ge(b=this.keycharm).call(b,"up",()=>{this.unbindFromRedraw("_moveUp")},"keyup"),ge(w=this.keycharm).call(w,"down",()=>{this.unbindFromRedraw("_moveDown")},"keyup"),ge(S=this.keycharm).call(S,"left",()=>{this.unbindFromRedraw("_moveLeft")},"keyup"),ge(x=this.keycharm).call(x,"right",()=>{this.unbindFromRedraw("_moveRight")},"keyup"),ge(O=this.keycharm).call(O,"=",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),ge(E=this.keycharm).call(E,"num+",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),ge(R=this.keycharm).call(R,"num-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),ge(B=this.keycharm).call(B,"-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),ge(W=this.keycharm).call(W,"[",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),ge(ne=this.keycharm).call(ne,"]",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),ge(L=this.keycharm).call(L,"pageup",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),ge(G=this.keycharm).call(G,"pagedown",()=>{this.unbindFromRedraw("_zoomOut")},"keyup")}}}class U${constructor(e,t,i){var o,r,A,I,l,c,h,p,m,b,w,S,x;this.body=e,this.canvas=t,this.selectionHandler=i,this.navigationHandler=new V$(e,t),this.body.eventListeners.onTap=ge(o=this.onTap).call(o,this),this.body.eventListeners.onTouch=ge(r=this.onTouch).call(r,this),this.body.eventListeners.onDoubleTap=ge(A=this.onDoubleTap).call(A,this),this.body.eventListeners.onHold=ge(I=this.onHold).call(I,this),this.body.eventListeners.onDragStart=ge(l=this.onDragStart).call(l,this),this.body.eventListeners.onDrag=ge(c=this.onDrag).call(c,this),this.body.eventListeners.onDragEnd=ge(h=this.onDragEnd).call(h,this),this.body.eventListeners.onMouseWheel=ge(p=this.onMouseWheel).call(p,this),this.body.eventListeners.onPinch=ge(m=this.onPinch).call(m,this),this.body.eventListeners.onMouseMove=ge(b=this.onMouseMove).call(b,this),this.body.eventListeners.onRelease=ge(w=this.onRelease).call(w,this),this.body.eventListeners.onContext=ge(S=this.onContext).call(S,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=ge(x=this.getPointer).call(x,this),this.options={},this.defaultOptions={dragNodes:!0,dragView:!0,hover:!1,keyboard:{enabled:!1,speed:{x:10,y:10,zoom:.02},bindToWindow:!0,autoFocus:!0},navigationButtons:!1,tooltipDelay:300,zoomView:!0,zoomSpeed:1},Ut(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("destroy",()=>{clearTimeout(this.popupTimer),delete this.body.functions.getPointer})}setOptions(e){e!==void 0&&(VC(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,e),ri(this.options,e,"keyboard"),e.tooltip&&(Ut(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=qd(e.tooltip.color)))),this.navigationHandler.setOptions(this.options)}getPointer(e){return{x:e.x-oU(this.canvas.frame.canvas),y:e.y-sU(this.canvas.frame.canvas)}}onTouch(e){new Date().valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=new Date().valueOf())}onTap(e){const t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,i),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t)}onDoubleTap(e){const t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("doubleClick",e,t)}onHold(e){const t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,i),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t),this.selectionHandler.generateClickEvent("hold",e,t)}onRelease(e){if(new Date().valueOf()-this.touchTime>10){const t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("release",e,t),this.touchTime=new Date().valueOf()}}onContext(e){const t=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler.generateClickEvent("oncontext",e,t)}checkSelectionChanges(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e)}_determineDifference(e,t){const i=function(o,r){const A=[];for(let I=0;I{const I=A.node;A.xFixed===!1&&(I.x=this.canvas._XconvertDOMtoCanvas(this.canvas._XconvertCanvasToDOM(A.x)+o)),A.yFixed===!1&&(I.y=this.canvas._YconvertDOMtoCanvas(this.canvas._YconvertCanvasToDOM(A.y)+r))}),this.body.emitter.emit("startSimulation")}else{if(e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,t,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)},this.body.emitter.emit("_requestRedraw")}if(this.options.dragView===!0&&!e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,t,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}const o=t.x-this.drag.pointer.x,r=t.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+o,y:this.drag.translation.y+r},this.body.emitter.emit("_requestRedraw")}}}onDragEnd(e){if(this.drag.dragging=!1,this.body.selectionBox.show){var t;this.body.selectionBox.show=!1;const i=this.body.selectionBox.position,o={minX:Math.min(i.start.x,i.end.x),minY:Math.min(i.start.y,i.end.y),maxX:Math.max(i.start.x,i.end.x),maxY:Math.max(i.start.y,i.end.y)},r=$t(t=this.body.nodeIndices).call(t,I=>{const l=this.body.nodes[I];return l.x>=o.minX&&l.x<=o.maxX&&l.y>=o.minY&&l.y<=o.maxY});et(r).call(r,I=>this.selectionHandler.selectObject(this.body.nodes[I]));const A=this.getPointer(e.center);this.selectionHandler.commitAndEmit(A,e),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{const i=this.drag.selection;i&&i.length?(et(i).call(i,function(o){o.node.options.fixed.x=o.xFixed,o.node.options.fixed.y=o.yFixed}),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}}onPinch(e){const t=this.getPointer(e.center);this.drag.pinched=!0,this.pinch.scale===void 0&&(this.pinch.scale=1);const i=this.pinch.scale*e.scale;this.zoom(i,t)}zoom(e,t){if(this.options.zoomView===!0){const i=this.body.view.scale;e<1e-5&&(e=1e-5),e>10&&(e=10);let o;this.drag!==void 0&&this.drag.dragging===!0&&(o=this.canvas.DOMtoCanvas(this.drag.pointer));const r=this.body.view.translation,A=e/i,I=(1-A)*t.x+r.x*A,l=(1-A)*t.y+r.y*A;if(this.body.view.scale=e,this.body.view.translation={x:I,y:l},o!=null){const c=this.canvas.canvasToDOM(o);this.drag.pointer.x=c.x,this.drag.pointer.y=c.y}this.body.emitter.emit("_requestRedraw"),ithis._checkShowPopup(t),this.options.tooltipDelay))),this.options.hover===!0&&this.selectionHandler.hoverObject(e,t)}_checkShowPopup(e){const t=this.canvas._XconvertDOMtoCanvas(e.x),i=this.canvas._YconvertDOMtoCanvas(e.y),o={left:t,top:i,right:t,bottom:i},r=this.popupObj===void 0?void 0:this.popupObj.id;let A=!1,I="node";if(this.popupObj===void 0){const l=this.body.nodeIndices,c=this.body.nodes;let h;const p=[];for(let m=0;m0&&(this.popupObj=c[p[p.length-1]],A=!0)}if(this.popupObj===void 0&&A===!1){const l=this.body.edgeIndices,c=this.body.edges;let h;const p=[];for(let m=0;m0&&(this.popupObj=c[p[p.length-1]],I="edge")}this.popupObj!==void 0?this.popupObj.id!==r&&(this.popup===void 0&&(this.popup=new fU(this.canvas.frame)),this.popup.popupTargetType=I,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):this.popup!==void 0&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}_checkHidePopup(e){const t=this.selectionHandler._pointerToPositionObject(e);let i=!1;if(this.popup.popupTargetType==="node"){if(this.body.nodes[this.popup.popupTargetId]!==void 0&&(i=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t),i===!0)){const o=this.selectionHandler.getNodeAt(e);i=o===void 0?!1:o.id===this.popup.popupTargetId}}else this.selectionHandler.getNodeAt(e)===void 0&&this.body.edges[this.popup.popupTargetId]!==void 0&&(i=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));i===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}var Y$=ot,fx=Cu,oI=KC.getWeakData,H$=au,K$=Xi,W$=cs,zu=xn,Q$=ru,px=Og,mx=rn,vx=wo,X$=vx.set,$$=vx.getterFor,q$=px.find,J$=px.findIndex,eq=Y$([].splice),tq=0,sI=function(n){return n.frozen||(n.frozen=new bx)},bx=function(){this.entries=[]},ku=function(n,e){return q$(n.entries,function(t){return t[0]===e})};bx.prototype={get:function(n){var e=ku(this,n);if(e)return e[1]},has:function(n){return!!ku(this,n)},set:function(n,e){var t=ku(this,n);t?t[1]=e:this.entries.push([n,e])},delete:function(n){var e=J$(this.entries,function(t){return t[0]===n});return~e&&eq(this.entries,e,1),!!~e}};var nq={getConstructor:function(n,e,t,i){var o=n(function(l,c){H$(l,r),X$(l,{type:e,id:tq++,frozen:void 0}),W$(c)||Q$(c,l[i],{that:l,AS_ENTRIES:t})}),r=o.prototype,A=$$(e),I=function(l,c,h){var p=A(l),m=oI(K$(c),!0);return m===!0?sI(p).set(c,h):m[p.id]=h,l};return fx(r,{delete:function(l){var c=A(this);if(!zu(l))return!1;var h=oI(l);return h===!0?sI(c).delete(l):h&&mx(h,c.id)&&delete h[c.id]},has:function(c){var h=A(this);if(!zu(c))return!1;var p=oI(c);return p===!0?sI(h).has(c):p&&mx(p,h.id)}}),fx(r,t?{get:function(c){var h=A(this);if(zu(c)){var p=oI(c);return p===!0?sI(h).get(c):p?p[h.id]:void 0}},set:function(c,h){return I(this,c,h)}}:{add:function(c){return I(this,c,!0)}}),o}},iq=B1,yx=_t,rI=ot,wx=Cu,gq=KC,oq=Au,xx=nq,aI=xn,AI=wo.enforce,sq=gt,rq=$b,Pa=Object,aq=Array.isArray,CI=Pa.isExtensible,Sx=Pa.isFrozen,Aq=Pa.isSealed,Ex=Pa.freeze,Cq=Pa.seal,Tx={},Ox={},Iq=!yx.ActiveXObject&&"ActiveXObject"in yx,La,Nx=function(n){return function(){return n(this,arguments.length?arguments[0]:void 0)}},Dx=oq("WeakMap",Nx,xx),Us=Dx.prototype,II=rI(Us.set),lq=function(){return iq&&sq(function(){var n=Ex([]);return II(new Dx,n,1),!Sx(n)})};if(rq)if(Iq){La=xx.getConstructor(Nx,"WeakMap",!0),gq.enable();var Mx=rI(Us.delete),lI=rI(Us.has),zx=rI(Us.get);wx(Us,{delete:function(n){if(aI(n)&&!CI(n)){var e=AI(this);return e.frozen||(e.frozen=new La),Mx(this,n)||e.frozen.delete(n)}return Mx(this,n)},has:function(e){if(aI(e)&&!CI(e)){var t=AI(this);return t.frozen||(t.frozen=new La),lI(this,e)||t.frozen.has(e)}return lI(this,e)},get:function(e){if(aI(e)&&!CI(e)){var t=AI(this);return t.frozen||(t.frozen=new La),lI(this,e)?zx(this,e):t.frozen.get(e)}return zx(this,e)},set:function(e,t){if(aI(e)&&!CI(e)){var i=AI(this);i.frozen||(i.frozen=new La),lI(this,e)?II(this,e,t):i.frozen.set(e,t)}else II(this,e,t);return this}})}else lq()&&wx(Us,{set:function(e,t){var i;return aq(e)&&(Sx(e)?i=Tx:Aq(e)&&(i=Ox)),II(this,e,t),i===Tx&&Ex(e),i===Ox&&Cq(e),this}});var cq=rt,dq=cq.WeakMap,uq=dq,hq=uq,fq=hq,Ga=Oe(fq);function yt(n,e,t,i){if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)}function Ru(n,e,t,i,o){if(typeof e=="function"?n!==e||!0:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(n,t),t}typeof SuppressedError=="function"&&SuppressedError;var Po,ai,Gg,Fg,cI;function kx(n,e){const t=new Ti;for(const i of e)n.has(i)||t.add(i);return t}class Rx{constructor(){Po.set(this,new Ti),ai.set(this,new Ti)}get size(){return yt(this,ai,"f").size}add(){for(var e=arguments.length,t=new Array(e),i=0;i0&&arguments[0]!==void 0?arguments[0]:()=>{};Gg.set(this,new Rx),Fg.set(this,new Rx),cI.set(this,void 0),Ru(this,cI,e)}get sizeNodes(){return yt(this,Gg,"f").size}get sizeEdges(){return yt(this,Fg,"f").size}getNodes(){return yt(this,Gg,"f").getSelection()}getEdges(){return yt(this,Fg,"f").getSelection()}addNodes(){yt(this,Gg,"f").add(...arguments)}addEdges(){yt(this,Fg,"f").add(...arguments)}deleteNodes(e){yt(this,Gg,"f").delete(e)}deleteEdges(e){yt(this,Fg,"f").delete(e)}clear(){yt(this,Gg,"f").clear(),yt(this,Fg,"f").clear()}commit(){const e={nodes:yt(this,Gg,"f").commit(),edges:yt(this,Fg,"f").commit()};for(var t=arguments.length,i=new Array(t),o=0;o{this.updateSelection()})}setOptions(e){e!==void 0&&_s(["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"],this.options,e)}selectOnPoint(e){let t=!1;if(this.options.selectable===!0){const i=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),i!==void 0&&(t=this.selectObject(i)),this.body.emitter.emit("_requestRedraw")}return t}selectAdditionalOnPoint(e){let t=!1;if(this.options.selectable===!0){const i=this.getNodeAt(e)||this.getEdgeAt(e);i!==void 0&&(t=!0,i.isSelected()===!0?this.deselectObject(i):this.selectObject(i),this.body.emitter.emit("_requestRedraw"))}return t}_initBaseEvent(e,t){const i={};return i.pointer={DOM:{x:t.x,y:t.y},canvas:this.canvas.DOMtoCanvas(t)},i.event=e,i}generateClickEvent(e,t,i,o){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;const A=this._initBaseEvent(t,i);if(r===!0)A.nodes=[],A.edges=[];else{const I=this.getSelection();A.nodes=I.nodes,A.edges=I.edges}o!==void 0&&(A.previousSelection=o),e=="click"&&(A.items=this.getClickedItems(i)),t.controlEdge!==void 0&&(A.controlEdge=t.controlEdge),this.body.emitter.emit(e,A)}selectObject(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.selectConnectedEdges;return e!==void 0?(e instanceof Nt?(t===!0&&this._selectionAccumulator.addEdges(...e.edges),this._selectionAccumulator.addNodes(e)):this._selectionAccumulator.addEdges(e),!0):!1}deselectObject(e){e.isSelected()===!0&&(e.selected=!1,this._removeFromSelection(e))}_getAllNodesOverlappingWith(e){const t=[],i=this.body.nodes;for(let o=0;o1&&arguments[1]!==void 0?arguments[1]:!0;const i=this._pointerToPositionObject(e),o=this._getAllNodesOverlappingWith(i);if(o.length>0)return t===!0?this.body.nodes[o[o.length-1]]:o[o.length-1]}_getEdgesOverlappingWith(e,t){const i=this.body.edges;for(let o=0;o1&&arguments[1]!==void 0?arguments[1]:!0;const i=this.canvas.DOMtoCanvas(e);let o=10,r=null;const A=this.body.edges;for(let I=0;I0&&(this.generateClickEvent("deselectEdge",t,e,r),i=!0),o.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",t,e,r),i=!0),o.nodes.added.length>0&&(this.generateClickEvent("selectNode",t,e),i=!0),o.edges.added.length>0&&(this.generateClickEvent("selectEdge",t,e),i=!0),i===!0&&this.generateClickEvent("select",t,e)}getSelection(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}getSelectedNodes(){return this._selectionAccumulator.getNodes()}getSelectedEdges(){return this._selectionAccumulator.getEdges()}getSelectedNodeIds(){var e;return un(e=this._selectionAccumulator.getNodes()).call(e,t=>t.id)}getSelectedEdgeIds(){var e;return un(e=this._selectionAccumulator.getEdges()).call(e,t=>t.id)}setSelection(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e||!e.nodes&&!e.edges)throw new TypeError("Selection must be an object with nodes and/or edges properties");if((t.unselectAll||t.unselectAll===void 0)&&this.unselectAll(),e.nodes)for(const i of e.nodes){const o=this.body.nodes[i];if(!o)throw new RangeError('Node with id "'+i+'" not found');this.selectObject(o,t.highlightEdges)}if(e.edges)for(const i of e.edges){const o=this.body.edges[i];if(!o)throw new RangeError('Edge with id "'+i+'" not found');this.selectObject(o)}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}selectNodes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({nodes:e},{highlightEdges:t})}selectEdges(e){if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({edges:e})}updateSelection(){for(const e in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,e.id)||this._selectionAccumulator.deleteNodes(e);for(const e in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,e.id)||this._selectionAccumulator.deleteEdges(e)}getClickedItems(e){const t=this.canvas.DOMtoCanvas(e),i=[],o=this.body.nodeIndices,r=this.body.nodes;for(let l=o.length-1;l>=0;l--){const h=r[o[l]].getItemsOnPoint(t);i.push.apply(i,h)}const A=this.body.edgeIndices,I=this.body.edges;for(let l=A.length-1;l>=0;l--){const h=I[A[l]].getItemsOnPoint(t);i.push.apply(i,h)}return i}}class _x{abstract(){throw new Error("Can't instantiate abstract class!")}fake_use(){}curveType(){return this.abstract()}getPosition(e){return this.fake_use(e),this.abstract()}setPosition(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;this.fake_use(e,t,i),this.abstract()}getTreeSize(e){return this.fake_use(e),this.abstract()}sort(e){this.fake_use(e),this.abstract()}fix(e,t){this.fake_use(e,t),this.abstract()}shift(e,t){this.fake_use(e,t),this.abstract()}}class vq extends _x{constructor(e){super(),this.layout=e}curveType(){return"horizontal"}getPosition(e){return e.x}setPosition(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;i!==void 0&&this.layout.hierarchical.addToOrdering(e,i),e.x=t}getTreeSize(e){const t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_x,max:t.max_x}}sort(e){gg(e).call(e,function(t,i){return t.x-i.x})}fix(e,t){e.y=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.y=!0}shift(e,t){this.layout.body.nodes[e].x+=t}}class bq extends _x{constructor(e){super(),this.layout=e}curveType(){return"vertical"}getPosition(e){return e.y}setPosition(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;i!==void 0&&this.layout.hierarchical.addToOrdering(e,i),e.y=t}getTreeSize(e){const t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_y,max:t.max_y}}sort(e){gg(e).call(e,function(t,i){return t.y-i.y})}fix(e,t){e.x=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.x=!0}shift(e,t){this.layout.body.nodes[e].y+=t}}var yq=Me,wq=Og.every,xq=Es,Sq=xq("every");yq({target:"Array",proto:!0,forced:!Sq},{every:function(e){return wq(this,e,arguments.length>1?arguments[1]:void 0)}});var Eq=Xt,Tq=Eq("Array").every,Oq=jt,Nq=Tq,_u=Array.prototype,Dq=function(n){var e=n.every;return n===_u||Oq(_u,n)&&e===_u.every?Nq:e},Mq=Dq,zq=Mq,kq=zq,jx=Oe(kq);function Rq(n,e){const t=new Ti;return et(n).call(n,i=>{var o;et(o=i.edges).call(o,r=>{r.connected&&t.add(r)})}),et(t).call(t,i=>{const o=i.from.id,r=i.to.id;e[o]==null&&(e[o]=0),(e[r]==null||e[o]>=e[r])&&(e[r]=e[o]+1)}),e}function _q(n){return Zx(e=>{var t,i;return jx(t=$t(i=e.edges).call(i,o=>n.has(o.toId))).call(t,o=>o.to===e)},(e,t)=>t>e,"from",n)}function jq(n){return Zx(e=>{var t,i;return jx(t=$t(i=e.edges).call(i,o=>n.has(o.toId))).call(t,o=>o.from===e)},(e,t)=>tp+1+m.edges.length,0),I=t+"Id",l=t==="to"?1:-1;for(const[p,m]of i){if(!i.has(p)||!n(m))continue;r[p]=0;const b=[m];let w=0,S;for(;S=b.pop();){var c,h;if(!i.has(p))continue;const x=r[S.id]+l;if(et(c=$t(h=S.edges).call(h,O=>O.connected&&O.to!==O.from&&O[t]!==S&&i.has(O.toId)&&i.has(O.fromId))).call(c,O=>{const E=O[I],R=r[E];(R==null||e(x,R))&&(r[E]=x,b.push(O[t]))}),w>A)return Rq(i,r);++w}}return r}class Zq{constructor(){this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}addRelation(e,t){this.childrenReference[e]===void 0&&(this.childrenReference[e]=[]),this.childrenReference[e].push(t),this.parentReference[t]===void 0&&(this.parentReference[t]=[]),this.parentReference[t].push(e)}checkIfTree(){for(const e in this.parentReference)if(this.parentReference[e].length>1){this.isTree=!1;return}this.isTree=!0}numTrees(){return this.treeIndex+1}setTreeIndex(e,t){t!==void 0&&this.trees[e.id]===void 0&&(this.trees[e.id]=t,this.treeIndex=Math.max(t,this.treeIndex))}ensureLevel(e){this.levels[e]===void 0&&(this.levels[e]=0)}getMaxLevel(e){const t={},i=o=>{if(t[o]!==void 0)return t[o];let r=this.levels[o];if(this.childrenReference[o]){const A=this.childrenReference[o];if(A.length>0)for(let I=0;Ir-A);for(const r of o)t.set(r,i++);for(const r in this.levels)Object.prototype.hasOwnProperty.call(this.levels,r)&&(this.levels[r]=t.get(this.levels[r]))}getTreeSize(e,t){let i=1e9,o=-1e9,r=1e9,A=-1e9;for(const I in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,I)&&this.trees[I]===t){const l=e[I];i=Math.min(l.x,i),o=Math.max(l.x,o),r=Math.min(l.y,r),A=Math.max(l.y,A)}return{min_x:i,max_x:o,min_y:r,max_y:A}}hasSameParent(e,t){const i=this.parentReference[e.id],o=this.parentReference[t.id];if(i===void 0||o===void 0)return!1;for(let r=0;r{this.setupHierarchicalLayout()}),this.body.emitter.on("_dataLoaded",()=>{this.layoutNetwork()}),this.body.emitter.on("_resetHierarchicalLayout",()=>{this.setupHierarchicalLayout()}),this.body.emitter.on("_adjustEdgesForHierarchicalLayout",()=>{if(this.options.hierarchical.enabled!==!0)return;const e=this.direction.curveType();this.body.emitter.emit("_forceDisableDynamicCurves",e,!1)})}setOptions(e,t){if(e!==void 0){const i=this.options.hierarchical,o=i.enabled;if(_s(["randomSeed","improvedLayout","clusterThreshold"],this.options,e),ri(this.options,e,"hierarchical"),e.randomSeed!==void 0&&this._resetRNG(e.randomSeed),i.enabled===!0)return o===!0&&this.body.emitter.emit("refresh",!0),i.direction==="RL"||i.direction==="DU"?i.levelSeparation>0&&(i.levelSeparation*=-1):i.levelSeparation<0&&(i.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(o===!0)return this.body.emitter.emit("refresh"),vt(t,this.optionsBackup)}return t}_resetRNG(e){this.initialRandomSeed=e,this._rng=FC(this.initialRandomSeed)}adaptAllOptionsForHierarchicalLayout(e){if(this.options.hierarchical.enabled===!0){const t=this.optionsBackup.physics;e.physics===void 0||e.physics===!0?(e.physics={enabled:t.enabled===void 0?!0:t.enabled,solver:"hierarchicalRepulsion"},t.enabled=t.enabled===void 0?!0:t.enabled,t.solver=t.solver||"barnesHut"):typeof e.physics=="object"?(t.enabled=e.physics.enabled===void 0?!0:e.physics.enabled,t.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):e.physics!==!1&&(t.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});let i=this.direction.curveType();if(e.edges===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges={smooth:!1};else if(e.edges.smooth===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges.smooth=!1;else if(typeof e.edges.smooth=="boolean")this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:i};else{const o=e.edges.smooth;o.type!==void 0&&o.type!=="dynamic"&&(i=o.type),this.optionsBackup.edges={smooth:{enabled:o.enabled===void 0?!0:o.enabled,type:o.type===void 0?"dynamic":o.type,roundness:o.roundness===void 0?.5:o.roundness,forceDirection:o.forceDirection===void 0?!1:o.forceDirection}},e.edges.smooth={enabled:o.enabled===void 0?!0:o.enabled,type:i,roundness:o.roundness===void 0?.5:o.roundness,forceDirection:o.forceDirection===void 0?!1:o.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",i)}return e}positionInitially(e){if(this.options.hierarchical.enabled!==!0){this._resetRNG(this.initialRandomSeed);const t=e.length+50;for(let i=0;ir){const l=e.length;for(;e.length>r&&o<=10;){o+=1;const c=e.length;o%3===0?this.body.modules.clustering.clusterBridges(A):this.body.modules.clustering.clusterOutliers(A);const h=e.length;if(c==h&&o%3!==0){this._declusterAll(),this.body.emitter.emit("_layoutFailed"),console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.");return}}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*l)})}o>10&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(e,this.body.edgeIndices,!0),this._shiftToCenter();const I=70;for(let l=0;l0){let e,t,i=!1,o=!1;this.lastNodeOnLevel={},this.hierarchical=new Zq;for(t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&(e=this.body.nodes[t],e.options.level!==void 0?(i=!0,this.hierarchical.levels[t]=e.options.level):o=!0);if(o===!0&&i===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");{if(o===!0){const A=this.options.hierarchical.sortMethod;A==="hubsize"?this._determineLevelsByHubsize():A==="directed"?this._determineLevelsDirected():A==="custom"&&this._determineLevelsCustomCallback()}for(const A in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,A)&&this.hierarchical.ensureLevel(A);const r=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(r),this._condenseHierarchy(),this._shiftToCenter()}}}_condenseHierarchy(){var e=this;let t=!1;const i={},o=()=>{const O=A();let E=0;for(let R=0;R{const R=this.hierarchical.trees;for(const B in R)Object.prototype.hasOwnProperty.call(R,B)&&R[B]===O&&this.direction.shift(B,E)},A=()=>{const O=[];for(let E=0;E{if(!E[O.id]&&(E[O.id]=!0,this.hierarchical.childrenReference[O.id])){const R=this.hierarchical.childrenReference[O.id];if(R.length>0)for(let B=0;B1&&arguments[1]!==void 0?arguments[1]:1e9,R=1e9,B=1e9,W=1e9,ne=-1e9;for(const L in O)if(Object.prototype.hasOwnProperty.call(O,L)){const G=e.body.nodes[L],Ie=e.hierarchical.levels[G.id],fe=e.direction.getPosition(G),[Be,Te]=e._getSpaceAroundNode(G,O);R=Math.min(Be,R),B=Math.min(Te,B),Ie<=E&&(W=Math.min(fe,W),ne=Math.max(fe,ne))}return[W,ne,R,B]},c=(O,E)=>{const R=this.hierarchical.getMaxLevel(O.id),B=this.hierarchical.getMaxLevel(E.id);return Math.min(R,B)},h=(O,E,R)=>{const B=this.hierarchical;for(let W=0;W1)for(let G=0;G2&&arguments[2]!==void 0?arguments[2]:!1;const B=e.direction.getPosition(O),W=e.direction.getPosition(E),ne=Math.abs(W-B),L=e.options.hierarchical.nodeSpacing;if(ne>L){const G={},Ie={};I(O,G),I(E,Ie);const fe=c(O,E),Be=l(G,fe),Te=l(Ie,fe),He=Be[1],Ve=Te[0],Ce=Te[2];if(Math.abs(He-Ve)>L){let Q=He-Ve+L;Q<-Ce+L&&(Q=-Ce+L),Q<0&&(e._shiftBlock(E.id,Q),t=!0,R===!0&&e._centerParent(E))}}},m=(O,E)=>{const R=E.id,B=E.edges,W=this.hierarchical.levels[E.id],ne=this.options.hierarchical.levelSeparation*this.options.hierarchical.levelSeparation,L={},G=[];for(let Ce=0;Ce{let Q=0;for(let K=0;K{let Q=0;for(let K=0;K{let Q=this.direction.getPosition(E);const K={};for(let ie=0;ie{const M=this.direction.getPosition(E);if(i[E.id]===void 0){const F={};I(E,F),i[E.id]=F}const Q=l(i[E.id]),K=Q[2],ie=Q[3],ee=Ce-M;let T=0;ee>0?T=Math.min(ee,ie-this.options.hierarchical.nodeSpacing):ee<0&&(T=-Math.min(-ee,K-this.options.hierarchical.nodeSpacing)),T!=0&&(this._shiftBlock(E.id,T),t=!0)},He=Ce=>{const M=this.direction.getPosition(E),[Q,K]=this._getSpaceAroundNode(E),ie=Ce-M;let ee=M;ie>0?ee=Math.min(M+(K-this.options.hierarchical.nodeSpacing),Ce):ie<0&&(ee=Math.max(M-(Q-this.options.hierarchical.nodeSpacing),Ce)),ee!==M&&(this.direction.setPosition(E,ee),t=!0)};let Ve=Be(O,G);Te(Ve),Ve=Be(O,B),He(Ve)},b=O=>{let E=this.hierarchical.getLevels();E=To(E).call(E);for(let R=0;R{let E=this.hierarchical.getLevels();E=To(E).call(E);for(let R=0;R{for(const O in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,O)&&this._centerParent(this.body.nodes[O])},x=()=>{let O=this.hierarchical.getLevels();O=To(O).call(O);for(let E=0;E0&&Math.abs(p)0&&(c=this.direction.getPosition(o[A-1])+l),this.direction.setPosition(I,c,i),this._validatePositionAndContinue(I,i,c),r++}}}}_placeBranchNodes(e,t){var i;const o=this.hierarchical.childrenReference[e];if(o===void 0)return;const r=[];for(let I=0;It&&this.positionedNodes[l.id]===void 0){const h=this.options.hierarchical.nodeSpacing;let p;I===0?p=this.direction.getPosition(this.body.nodes[e]):p=this.direction.getPosition(r[I-1])+h,this.direction.setPosition(l,p,c),this._validatePositionAndContinue(l,c,p)}else return}const A=this._getCenterPosition(r);this.direction.setPosition(this.body.nodes[e],A,t)}_validatePositionAndContinue(e,t,i){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[t]!==void 0){const o=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(i-o{var o;At(o=this.body.edgeIndices).call(o,i.id)!==-1&&t.push(i)}),t}_getHubSizes(){const e={},t=this.body.nodeIndices;Ke(t,o=>{const r=this.body.nodes[o],A=this._getActiveEdges(r).length;e[A]=!0});const i=[];return Ke(e,o=>{i.push(Number(o))}),gg(i).call(i,function(o,r){return r-o}),i}_determineLevelsByHubsize(){const e=(i,o)=>{this.hierarchical.levelDownstream(i,o)},t=this._getHubSizes();for(let i=0;i{const A=this.body.nodes[r];o===this._getActiveEdges(A).length&&this._crawlNetwork(e,r)})}}_determineLevelsCustomCallback(){const t=function(o,r,A){},i=(o,r,A)=>{let I=this.hierarchical.levels[o.id];I===void 0&&(I=this.hierarchical.levels[o.id]=1e5);const l=t(Dn.cloneOptions(o,"node"),Dn.cloneOptions(r,"node"),Dn.cloneOptions(A,"edge"));this.hierarchical.levels[r.id]=I+l};this._crawlNetwork(i),this.hierarchical.setMinLevelToZero()}_determineLevelsDirected(){var e;const t=pu(e=this.body.nodeIndices).call(e,(i,o)=>(i.set(o,this.body.nodes[o]),i),new Ra);this.options.hierarchical.shakeTowards==="roots"?this.hierarchical.levels=jq(t):this.hierarchical.levels=_q(t),this.hierarchical.setMinLevelToZero()}_generateMap(){const e=(t,i)=>{this.hierarchical.levels[i.id]>this.hierarchical.levels[t.id]&&this.hierarchical.addRelation(t.id,i.id)};this._crawlNetwork(e),this.hierarchical.checkIfTree()}_crawlNetwork(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},t=arguments.length>1?arguments[1]:void 0;const i={},o=(r,A)=>{if(i[r.id]===void 0){this.hierarchical.setTreeIndex(r,A),i[r.id]=!0;let I;const l=this._getActiveEdges(r);for(let c=0;c{if(i[r])return;i[r]=!0,this.direction.shift(r,t);const A=this.hierarchical.childrenReference[r];if(A!==void 0)for(let I=0;I{const l=this.hierarchical.parentReference[I];if(l!==void 0)for(let c=0;c{const l=this.hierarchical.parentReference[I];if(l!==void 0)for(let c=0;c{this.activated=!0,this.configureKeyboardBindings()}),this.body.emitter.on("deactivate",()=>{this.activated=!1,this.configureKeyboardBindings()}),this.body.emitter.on("destroy",()=>{this.keycharm!==void 0&&this.keycharm.destroy()}),this.options={}}setOptions(e){e!==void 0&&(this.options=e,this.create())}create(){this.options.navigationButtons===!0?this.iconsCreated===!1&&this.loadNavigationElements():this.iconsCreated===!0&&this.cleanNavigation(),this.configureKeyboardBindings()}cleanNavigation(){if(this.navigationHammers.length!=0){for(let e=0;e{this._stopMovement()}),this.navigationHammers.push(r),this.iconsCreated=!0}bindToRedraw(e){if(this.boundFunctions[e]===void 0){var t;this.boundFunctions[e]=oe(t=this[e]).call(t,this),this.body.emitter.on("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_startRendering")}}unbindFromRedraw(e){this.boundFunctions[e]!==void 0&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"),delete this.boundFunctions[e])}_fit(){new Date().valueOf()-this.touchTime>700&&(this.body.emitter.emit("fit",{duration:700}),this.touchTime=new Date().valueOf())}_stopMovement(){for(const e in this.boundFunctions)Object.prototype.hasOwnProperty.call(this.boundFunctions,e)&&(this.body.emitter.off("initRedraw",this.boundFunctions[e]),this.body.emitter.emit("_stopRendering"));this.boundFunctions={}}_moveUp(){this.body.view.translation.y+=this.options.keyboard.speed.y}_moveDown(){this.body.view.translation.y-=this.options.keyboard.speed.y}_moveLeft(){this.body.view.translation.x+=this.options.keyboard.speed.x}_moveRight(){this.body.view.translation.x-=this.options.keyboard.speed.x}_zoomIn(){const e=this.body.view.scale,t=this.body.view.scale*(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,o=t/e,r=(1-o)*this.canvas.canvasViewCenter.x+i.x*o,A=(1-o)*this.canvas.canvasViewCenter.y+i.y*o;this.body.view.scale=t,this.body.view.translation={x:r,y:A},this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale,pointer:null})}_zoomOut(){const e=this.body.view.scale,t=this.body.view.scale/(1+this.options.keyboard.speed.zoom),i=this.body.view.translation,o=t/e,r=(1-o)*this.canvas.canvasViewCenter.x+i.x*o,A=(1-o)*this.canvas.canvasViewCenter.y+i.y*o;this.body.view.scale=t,this.body.view.translation={x:r,y:A},this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale,pointer:null})}configureKeyboardBindings(){if(this.keycharm!==void 0&&this.keycharm.destroy(),this.options.keyboard.enabled===!0&&(this.options.keyboard.bindToWindow===!0?this.keycharm=wx({container:window,preventDefault:!0}):this.keycharm=wx({container:this.canvas.frame,preventDefault:!0}),this.keycharm.reset(),this.activated===!0)){var e,t,i,o,r,A,I,l,c,h,p,m,b,w,O,x,S,E,_,j,X,ne,F,V;oe(e=this.keycharm).call(e,"up",()=>{this.bindToRedraw("_moveUp")},"keydown"),oe(t=this.keycharm).call(t,"down",()=>{this.bindToRedraw("_moveDown")},"keydown"),oe(i=this.keycharm).call(i,"left",()=>{this.bindToRedraw("_moveLeft")},"keydown"),oe(o=this.keycharm).call(o,"right",()=>{this.bindToRedraw("_moveRight")},"keydown"),oe(r=this.keycharm).call(r,"=",()=>{this.bindToRedraw("_zoomIn")},"keydown"),oe(A=this.keycharm).call(A,"num+",()=>{this.bindToRedraw("_zoomIn")},"keydown"),oe(I=this.keycharm).call(I,"num-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),oe(l=this.keycharm).call(l,"-",()=>{this.bindToRedraw("_zoomOut")},"keydown"),oe(c=this.keycharm).call(c,"[",()=>{this.bindToRedraw("_zoomOut")},"keydown"),oe(h=this.keycharm).call(h,"]",()=>{this.bindToRedraw("_zoomIn")},"keydown"),oe(p=this.keycharm).call(p,"pageup",()=>{this.bindToRedraw("_zoomIn")},"keydown"),oe(m=this.keycharm).call(m,"pagedown",()=>{this.bindToRedraw("_zoomOut")},"keydown"),oe(b=this.keycharm).call(b,"up",()=>{this.unbindFromRedraw("_moveUp")},"keyup"),oe(w=this.keycharm).call(w,"down",()=>{this.unbindFromRedraw("_moveDown")},"keyup"),oe(O=this.keycharm).call(O,"left",()=>{this.unbindFromRedraw("_moveLeft")},"keyup"),oe(x=this.keycharm).call(x,"right",()=>{this.unbindFromRedraw("_moveRight")},"keyup"),oe(S=this.keycharm).call(S,"=",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),oe(E=this.keycharm).call(E,"num+",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),oe(_=this.keycharm).call(_,"num-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),oe(j=this.keycharm).call(j,"-",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),oe(X=this.keycharm).call(X,"[",()=>{this.unbindFromRedraw("_zoomOut")},"keyup"),oe(ne=this.keycharm).call(ne,"]",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),oe(F=this.keycharm).call(F,"pageup",()=>{this.unbindFromRedraw("_zoomIn")},"keyup"),oe(V=this.keycharm).call(V,"pagedown",()=>{this.unbindFromRedraw("_zoomOut")},"keyup")}}}class xq{constructor(e,t,i){var o,r,A,I,l,c,h,p,m,b,w,O,x;this.body=e,this.canvas=t,this.selectionHandler=i,this.navigationHandler=new wq(e,t),this.body.eventListeners.onTap=oe(o=this.onTap).call(o,this),this.body.eventListeners.onTouch=oe(r=this.onTouch).call(r,this),this.body.eventListeners.onDoubleTap=oe(A=this.onDoubleTap).call(A,this),this.body.eventListeners.onHold=oe(I=this.onHold).call(I,this),this.body.eventListeners.onDragStart=oe(l=this.onDragStart).call(l,this),this.body.eventListeners.onDrag=oe(c=this.onDrag).call(c,this),this.body.eventListeners.onDragEnd=oe(h=this.onDragEnd).call(h,this),this.body.eventListeners.onMouseWheel=oe(p=this.onMouseWheel).call(p,this),this.body.eventListeners.onPinch=oe(m=this.onPinch).call(m,this),this.body.eventListeners.onMouseMove=oe(b=this.onMouseMove).call(b,this),this.body.eventListeners.onRelease=oe(w=this.onRelease).call(w,this),this.body.eventListeners.onContext=oe(O=this.onContext).call(O,this),this.touchTime=0,this.drag={},this.pinch={},this.popup=void 0,this.popupObj=void 0,this.popupTimer=void 0,this.body.functions.getPointer=oe(x=this.getPointer).call(x,this),this.options={},this.defaultOptions={dragNodes:!0,dragView:!0,hover:!1,keyboard:{enabled:!1,speed:{x:10,y:10,zoom:.02},bindToWindow:!0,autoFocus:!0},navigationButtons:!1,tooltipDelay:300,zoomView:!0,zoomSpeed:1},Yt(this.options,this.defaultOptions),this.bindEventListeners()}bindEventListeners(){this.body.emitter.on("destroy",()=>{clearTimeout(this.popupTimer),delete this.body.functions.getPointer})}setOptions(e){e!==void 0&&(YC(["hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","keyboard","multiselect","selectable","selectConnectedEdges"],this.options,e),ri(this.options,e,"keyboard"),e.tooltip&&(Yt(this.options.tooltip,e.tooltip),e.tooltip.color&&(this.options.tooltip.color=Jd(e.tooltip.color)))),this.navigationHandler.setOptions(this.options)}getPointer(e){return{x:e.x-BU(this.canvas.frame.canvas),y:e.y-LU(this.canvas.frame.canvas)}}onTouch(e){new Date().valueOf()-this.touchTime>50&&(this.drag.pointer=this.getPointer(e.center),this.drag.pinched=!1,this.pinch.scale=this.body.view.scale,this.touchTime=new Date().valueOf())}onTap(e){const t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect&&(e.changedPointers[0].ctrlKey||e.changedPointers[0].metaKey);this.checkSelectionChanges(t,i),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t)}onDoubleTap(e){const t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("doubleClick",e,t)}onHold(e){const t=this.getPointer(e.center),i=this.selectionHandler.options.multiselect;this.checkSelectionChanges(t,i),this.selectionHandler.commitAndEmit(t,e),this.selectionHandler.generateClickEvent("click",e,t),this.selectionHandler.generateClickEvent("hold",e,t)}onRelease(e){if(new Date().valueOf()-this.touchTime>10){const t=this.getPointer(e.center);this.selectionHandler.generateClickEvent("release",e,t),this.touchTime=new Date().valueOf()}}onContext(e){const t=this.getPointer({x:e.clientX,y:e.clientY});this.selectionHandler.generateClickEvent("oncontext",e,t)}checkSelectionChanges(e){(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)===!0?this.selectionHandler.selectAdditionalOnPoint(e):this.selectionHandler.selectOnPoint(e)}_determineDifference(e,t){const i=function(o,r){const A=[];for(let I=0;I{const I=A.node;A.xFixed===!1&&(I.x=this.canvas._XconvertDOMtoCanvas(this.canvas._XconvertCanvasToDOM(A.x)+o)),A.yFixed===!1&&(I.y=this.canvas._YconvertDOMtoCanvas(this.canvas._YconvertCanvasToDOM(A.y)+r))}),this.body.emitter.emit("startSimulation")}else{if(e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,t,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}this.body.selectionBox.position.end={x:this.canvas._XconvertDOMtoCanvas(t.x),y:this.canvas._YconvertDOMtoCanvas(t.y)},this.body.emitter.emit("_requestRedraw")}if(this.options.dragView===!0&&!e.srcEvent.shiftKey){if(this.selectionHandler.generateClickEvent("dragging",e,t,void 0,!0),this.drag.pointer===void 0){this.onDragStart(e);return}const o=t.x-this.drag.pointer.x,r=t.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+o,y:this.drag.translation.y+r},this.body.emitter.emit("_requestRedraw")}}}onDragEnd(e){if(this.drag.dragging=!1,this.body.selectionBox.show){var t;this.body.selectionBox.show=!1;const i=this.body.selectionBox.position,o={minX:Math.min(i.start.x,i.end.x),minY:Math.min(i.start.y,i.end.y),maxX:Math.max(i.start.x,i.end.x),maxY:Math.max(i.start.y,i.end.y)},r=$t(t=this.body.nodeIndices).call(t,I=>{const l=this.body.nodes[I];return l.x>=o.minX&&l.x<=o.maxX&&l.y>=o.minY&&l.y<=o.maxY});tt(r).call(r,I=>this.selectionHandler.selectObject(this.body.nodes[I]));const A=this.getPointer(e.center);this.selectionHandler.commitAndEmit(A,e),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw")}else{const i=this.drag.selection;i&&i.length?(tt(i).call(i,function(o){o.node.options.fixed.x=o.xFixed,o.node.options.fixed.y=o.yFixed}),this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler.generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}}onPinch(e){const t=this.getPointer(e.center);this.drag.pinched=!0,this.pinch.scale===void 0&&(this.pinch.scale=1);const i=this.pinch.scale*e.scale;this.zoom(i,t)}zoom(e,t){if(this.options.zoomView===!0){const i=this.body.view.scale;e<1e-5&&(e=1e-5),e>10&&(e=10);let o;this.drag!==void 0&&this.drag.dragging===!0&&(o=this.canvas.DOMtoCanvas(this.drag.pointer));const r=this.body.view.translation,A=e/i,I=(1-A)*t.x+r.x*A,l=(1-A)*t.y+r.y*A;if(this.body.view.scale=e,this.body.view.translation={x:I,y:l},o!=null){const c=this.canvas.canvasToDOM(o);this.drag.pointer.x=c.x,this.drag.pointer.y=c.y}this.body.emitter.emit("_requestRedraw"),ithis._checkShowPopup(t),this.options.tooltipDelay))),this.options.hover===!0&&this.selectionHandler.hoverObject(e,t)}_checkShowPopup(e){const t=this.canvas._XconvertDOMtoCanvas(e.x),i=this.canvas._YconvertDOMtoCanvas(e.y),o={left:t,top:i,right:t,bottom:i},r=this.popupObj===void 0?void 0:this.popupObj.id;let A=!1,I="node";if(this.popupObj===void 0){const l=this.body.nodeIndices,c=this.body.nodes;let h;const p=[];for(let m=0;m0&&(this.popupObj=c[p[p.length-1]],A=!0)}if(this.popupObj===void 0&&A===!1){const l=this.body.edgeIndices,c=this.body.edges;let h;const p=[];for(let m=0;m0&&(this.popupObj=c[p[p.length-1]],I="edge")}this.popupObj!==void 0?this.popupObj.id!==r&&(this.popup===void 0&&(this.popup=new $U(this.canvas.frame)),this.popup.popupTargetType=I,this.popup.popupTargetId=this.popupObj.id,this.popup.setPosition(e.x+3,e.y-5),this.popup.setText(this.popupObj.getTitle()),this.popup.show(),this.body.emitter.emit("showPopup",this.popupObj.id)):this.popup!==void 0&&(this.popup.hide(),this.body.emitter.emit("hidePopup"))}_checkHidePopup(e){const t=this.selectionHandler._pointerToPositionObject(e);let i=!1;if(this.popup.popupTargetType==="node"){if(this.body.nodes[this.popup.popupTargetId]!==void 0&&(i=this.body.nodes[this.popup.popupTargetId].isOverlappingWith(t),i===!0)){const o=this.selectionHandler.getNodeAt(e);i=o===void 0?!1:o.id===this.popup.popupTargetId}}else this.selectionHandler.getNodeAt(e)===void 0&&this.body.edges[this.popup.popupTargetId]!==void 0&&(i=this.body.edges[this.popup.popupTargetId].isOverlappingWith(t));i===!1&&(this.popupObj=void 0,this.popup.hide(),this.body.emitter.emit("hidePopup"))}}var Eq=st,xx=Iu,rI=QC.getWeakData,Sq=Au,Tq=Xi,Oq=ds,zu=xn,Nq=au,Ex=Og,Sx=rn,Tx=wo,Dq=Tx.set,Mq=Tx.getterFor,Rq=Ex.find,zq=Ex.findIndex,kq=Eq([].splice),_q=0,aI=function(n){return n.frozen||(n.frozen=new Ox)},Ox=function(){this.entries=[]},ku=function(n,e){return Rq(n.entries,function(t){return t[0]===e})};Ox.prototype={get:function(n){var e=ku(this,n);if(e)return e[1]},has:function(n){return!!ku(this,n)},set:function(n,e){var t=ku(this,n);t?t[1]=e:this.entries.push([n,e])},delete:function(n){var e=zq(this.entries,function(t){return t[0]===n});return~e&&kq(this.entries,e,1),!!~e}};var jq={getConstructor:function(n,e,t,i){var o=n(function(l,c){Sq(l,r),Dq(l,{type:e,id:_q++,frozen:void 0}),Oq(c)||Nq(c,l[i],{that:l,AS_ENTRIES:t})}),r=o.prototype,A=Mq(e),I=function(l,c,h){var p=A(l),m=rI(Tq(c),!0);return m===!0?aI(p).set(c,h):m[p.id]=h,l};return xx(r,{delete:function(l){var c=A(this);if(!zu(l))return!1;var h=rI(l);return h===!0?aI(c).delete(l):h&&Sx(h,c.id)&&delete h[c.id]},has:function(c){var h=A(this);if(!zu(c))return!1;var p=rI(c);return p===!0?aI(h).has(c):p&&Sx(p,h.id)}}),xx(r,t?{get:function(c){var h=A(this);if(zu(c)){var p=rI(c);return p===!0?aI(h).get(c):p?p[h.id]:void 0}},set:function(c,h){return I(this,c,h)}}:{add:function(c){return I(this,c,!0)}}),o}},Zq=Y1,Nx=jt,AI=st,Dx=Iu,Pq=QC,Bq=Cu,Mx=jq,CI=xn,II=wo.enforce,Lq=ot,Gq=gy,Ba=Object,Fq=Array.isArray,lI=Ba.isExtensible,Rx=Ba.isFrozen,Vq=Ba.isSealed,zx=Ba.freeze,Uq=Ba.seal,kx={},_x={},Yq=!Nx.ActiveXObject&&"ActiveXObject"in Nx,La,jx=function(n){return function(){return n(this,arguments.length?arguments[0]:void 0)}},Zx=Bq("WeakMap",jx,Mx),Ys=Zx.prototype,cI=AI(Ys.set),Hq=function(){return Zq&&Lq(function(){var n=zx([]);return cI(new Zx,n,1),!Rx(n)})};if(Gq)if(Yq){La=Mx.getConstructor(jx,"WeakMap",!0),Pq.enable();var Px=AI(Ys.delete),dI=AI(Ys.has),Bx=AI(Ys.get);Dx(Ys,{delete:function(n){if(CI(n)&&!lI(n)){var e=II(this);return e.frozen||(e.frozen=new La),Px(this,n)||e.frozen.delete(n)}return Px(this,n)},has:function(e){if(CI(e)&&!lI(e)){var t=II(this);return t.frozen||(t.frozen=new La),dI(this,e)||t.frozen.has(e)}return dI(this,e)},get:function(e){if(CI(e)&&!lI(e)){var t=II(this);return t.frozen||(t.frozen=new La),dI(this,e)?Bx(this,e):t.frozen.get(e)}return Bx(this,e)},set:function(e,t){if(CI(e)&&!lI(e)){var i=II(this);i.frozen||(i.frozen=new La),dI(this,e)?cI(this,e,t):i.frozen.set(e,t)}else cI(this,e,t);return this}})}else Hq()&&Dx(Ys,{set:function(e,t){var i;return Fq(e)&&(Rx(e)?i=kx:Vq(e)&&(i=_x)),cI(this,e,t),i===kx&&zx(e),i===_x&&Uq(e),this}});var Kq=At,Wq=Kq.WeakMap,Qq=Wq,Xq=Qq,$q=Xq,Ga=Ne($q);function yt(n,e,t,i){if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)}function _u(n,e,t,i,o){if(typeof e=="function"?n!==e||!0:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(n,t),t}typeof SuppressedError=="function"&&SuppressedError;var Bo,ai,Gg,Fg,uI;function Lx(n,e){const t=new Ti;for(const i of e)n.has(i)||t.add(i);return t}class Gx{constructor(){Bo.set(this,new Ti),ai.set(this,new Ti)}get size(){return yt(this,ai,"f").size}add(){for(var e=arguments.length,t=new Array(e),i=0;i0&&arguments[0]!==void 0?arguments[0]:()=>{};Gg.set(this,new Gx),Fg.set(this,new Gx),uI.set(this,void 0),_u(this,uI,e)}get sizeNodes(){return yt(this,Gg,"f").size}get sizeEdges(){return yt(this,Fg,"f").size}getNodes(){return yt(this,Gg,"f").getSelection()}getEdges(){return yt(this,Fg,"f").getSelection()}addNodes(){yt(this,Gg,"f").add(...arguments)}addEdges(){yt(this,Fg,"f").add(...arguments)}deleteNodes(e){yt(this,Gg,"f").delete(e)}deleteEdges(e){yt(this,Fg,"f").delete(e)}clear(){yt(this,Gg,"f").clear(),yt(this,Fg,"f").clear()}commit(){const e={nodes:yt(this,Gg,"f").commit(),edges:yt(this,Fg,"f").commit()};for(var t=arguments.length,i=new Array(t),o=0;o{this.updateSelection()})}setOptions(e){e!==void 0&&js(["multiselect","hoverConnectedEdges","selectable","selectConnectedEdges"],this.options,e)}selectOnPoint(e){let t=!1;if(this.options.selectable===!0){const i=this.getNodeAt(e)||this.getEdgeAt(e);this.unselectAll(),i!==void 0&&(t=this.selectObject(i)),this.body.emitter.emit("_requestRedraw")}return t}selectAdditionalOnPoint(e){let t=!1;if(this.options.selectable===!0){const i=this.getNodeAt(e)||this.getEdgeAt(e);i!==void 0&&(t=!0,i.isSelected()===!0?this.deselectObject(i):this.selectObject(i),this.body.emitter.emit("_requestRedraw"))}return t}_initBaseEvent(e,t){const i={};return i.pointer={DOM:{x:t.x,y:t.y},canvas:this.canvas.DOMtoCanvas(t)},i.event=e,i}generateClickEvent(e,t,i,o){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;const A=this._initBaseEvent(t,i);if(r===!0)A.nodes=[],A.edges=[];else{const I=this.getSelection();A.nodes=I.nodes,A.edges=I.edges}o!==void 0&&(A.previousSelection=o),e=="click"&&(A.items=this.getClickedItems(i)),t.controlEdge!==void 0&&(A.controlEdge=t.controlEdge),this.body.emitter.emit(e,A)}selectObject(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.selectConnectedEdges;return e!==void 0?(e instanceof Nt?(t===!0&&this._selectionAccumulator.addEdges(...e.edges),this._selectionAccumulator.addNodes(e)):this._selectionAccumulator.addEdges(e),!0):!1}deselectObject(e){e.isSelected()===!0&&(e.selected=!1,this._removeFromSelection(e))}_getAllNodesOverlappingWith(e){const t=[],i=this.body.nodes;for(let o=0;o1&&arguments[1]!==void 0?arguments[1]:!0;const i=this._pointerToPositionObject(e),o=this._getAllNodesOverlappingWith(i);if(o.length>0)return t===!0?this.body.nodes[o[o.length-1]]:o[o.length-1]}_getEdgesOverlappingWith(e,t){const i=this.body.edges;for(let o=0;o1&&arguments[1]!==void 0?arguments[1]:!0;const i=this.canvas.DOMtoCanvas(e);let o=10,r=null;const A=this.body.edges;for(let I=0;I0&&(this.generateClickEvent("deselectEdge",t,e,r),i=!0),o.nodes.deleted.length>0&&(this.generateClickEvent("deselectNode",t,e,r),i=!0),o.nodes.added.length>0&&(this.generateClickEvent("selectNode",t,e),i=!0),o.edges.added.length>0&&(this.generateClickEvent("selectEdge",t,e),i=!0),i===!0&&this.generateClickEvent("select",t,e)}getSelection(){return{nodes:this.getSelectedNodeIds(),edges:this.getSelectedEdgeIds()}}getSelectedNodes(){return this._selectionAccumulator.getNodes()}getSelectedEdges(){return this._selectionAccumulator.getEdges()}getSelectedNodeIds(){var e;return un(e=this._selectionAccumulator.getNodes()).call(e,t=>t.id)}getSelectedEdgeIds(){var e;return un(e=this._selectionAccumulator.getEdges()).call(e,t=>t.id)}setSelection(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e||!e.nodes&&!e.edges)throw new TypeError("Selection must be an object with nodes and/or edges properties");if((t.unselectAll||t.unselectAll===void 0)&&this.unselectAll(),e.nodes)for(const i of e.nodes){const o=this.body.nodes[i];if(!o)throw new RangeError('Node with id "'+i+'" not found');this.selectObject(o,t.highlightEdges)}if(e.edges)for(const i of e.edges){const o=this.body.edges[i];if(!o)throw new RangeError('Edge with id "'+i+'" not found');this.selectObject(o)}this.body.emitter.emit("_requestRedraw"),this._selectionAccumulator.commit()}selectNodes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({nodes:e},{highlightEdges:t})}selectEdges(e){if(!e||e.length===void 0)throw"Selection must be an array with ids";this.setSelection({edges:e})}updateSelection(){for(const e in this._selectionAccumulator.getNodes())Object.prototype.hasOwnProperty.call(this.body.nodes,e.id)||this._selectionAccumulator.deleteNodes(e);for(const e in this._selectionAccumulator.getEdges())Object.prototype.hasOwnProperty.call(this.body.edges,e.id)||this._selectionAccumulator.deleteEdges(e)}getClickedItems(e){const t=this.canvas.DOMtoCanvas(e),i=[],o=this.body.nodeIndices,r=this.body.nodes;for(let l=o.length-1;l>=0;l--){const h=r[o[l]].getItemsOnPoint(t);i.push.apply(i,h)}const A=this.body.edgeIndices,I=this.body.edges;for(let l=A.length-1;l>=0;l--){const h=I[A[l]].getItemsOnPoint(t);i.push.apply(i,h)}return i}}class Fx{abstract(){throw new Error("Can't instantiate abstract class!")}fake_use(){}curveType(){return this.abstract()}getPosition(e){return this.fake_use(e),this.abstract()}setPosition(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;this.fake_use(e,t,i),this.abstract()}getTreeSize(e){return this.fake_use(e),this.abstract()}sort(e){this.fake_use(e),this.abstract()}fix(e,t){this.fake_use(e,t),this.abstract()}shift(e,t){this.fake_use(e,t),this.abstract()}}class eJ extends Fx{constructor(e){super(),this.layout=e}curveType(){return"horizontal"}getPosition(e){return e.x}setPosition(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;i!==void 0&&this.layout.hierarchical.addToOrdering(e,i),e.x=t}getTreeSize(e){const t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_x,max:t.max_x}}sort(e){gg(e).call(e,function(t,i){return t.x-i.x})}fix(e,t){e.y=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.y=!0}shift(e,t){this.layout.body.nodes[e].x+=t}}class tJ extends Fx{constructor(e){super(),this.layout=e}curveType(){return"vertical"}getPosition(e){return e.y}setPosition(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;i!==void 0&&this.layout.hierarchical.addToOrdering(e,i),e.y=t}getTreeSize(e){const t=this.layout.hierarchical.getTreeSize(this.layout.body.nodes,e);return{min:t.min_y,max:t.max_y}}sort(e){gg(e).call(e,function(t,i){return t.y-i.y})}fix(e,t){e.x=this.layout.options.hierarchical.levelSeparation*t,e.options.fixed.x=!0}shift(e,t){this.layout.body.nodes[e].y+=t}}var nJ=ze,iJ=Og.every,gJ=Ts,oJ=gJ("every");nJ({target:"Array",proto:!0,forced:!oJ},{every:function(e){return iJ(this,e,arguments.length>1?arguments[1]:void 0)}});var sJ=Xt,rJ=sJ("Array").every,aJ=Zt,AJ=rJ,ju=Array.prototype,CJ=function(n){var e=n.every;return n===ju||aJ(ju,n)&&e===ju.every?AJ:e},IJ=CJ,lJ=IJ,cJ=lJ,Vx=Ne(cJ);function dJ(n,e){const t=new Ti;return tt(n).call(n,i=>{var o;tt(o=i.edges).call(o,r=>{r.connected&&t.add(r)})}),tt(t).call(t,i=>{const o=i.from.id,r=i.to.id;e[o]==null&&(e[o]=0),(e[r]==null||e[o]>=e[r])&&(e[r]=e[o]+1)}),e}function uJ(n){return Ux(e=>{var t,i;return Vx(t=$t(i=e.edges).call(i,o=>n.has(o.toId))).call(t,o=>o.to===e)},(e,t)=>t>e,"from",n)}function hJ(n){return Ux(e=>{var t,i;return Vx(t=$t(i=e.edges).call(i,o=>n.has(o.toId))).call(t,o=>o.from===e)},(e,t)=>tp+1+m.edges.length,0),I=t+"Id",l=t==="to"?1:-1;for(const[p,m]of i){if(!i.has(p)||!n(m))continue;r[p]=0;const b=[m];let w=0,O;for(;O=b.pop();){var c,h;if(!i.has(p))continue;const x=r[O.id]+l;if(tt(c=$t(h=O.edges).call(h,S=>S.connected&&S.to!==S.from&&S[t]!==O&&i.has(S.toId)&&i.has(S.fromId))).call(c,S=>{const E=S[I],_=r[E];(_==null||e(x,_))&&(r[E]=x,b.push(S[t]))}),w>A)return dJ(i,r);++w}}return r}class fJ{constructor(){this.childrenReference={},this.parentReference={},this.trees={},this.distributionOrdering={},this.levels={},this.distributionIndex={},this.isTree=!1,this.treeIndex=-1}addRelation(e,t){this.childrenReference[e]===void 0&&(this.childrenReference[e]=[]),this.childrenReference[e].push(t),this.parentReference[t]===void 0&&(this.parentReference[t]=[]),this.parentReference[t].push(e)}checkIfTree(){for(const e in this.parentReference)if(this.parentReference[e].length>1){this.isTree=!1;return}this.isTree=!0}numTrees(){return this.treeIndex+1}setTreeIndex(e,t){t!==void 0&&this.trees[e.id]===void 0&&(this.trees[e.id]=t,this.treeIndex=Math.max(t,this.treeIndex))}ensureLevel(e){this.levels[e]===void 0&&(this.levels[e]=0)}getMaxLevel(e){const t={},i=o=>{if(t[o]!==void 0)return t[o];let r=this.levels[o];if(this.childrenReference[o]){const A=this.childrenReference[o];if(A.length>0)for(let I=0;Ir-A);for(const r of o)t.set(r,i++);for(const r in this.levels)Object.prototype.hasOwnProperty.call(this.levels,r)&&(this.levels[r]=t.get(this.levels[r]))}getTreeSize(e,t){let i=1e9,o=-1e9,r=1e9,A=-1e9;for(const I in this.trees)if(Object.prototype.hasOwnProperty.call(this.trees,I)&&this.trees[I]===t){const l=e[I];i=Math.min(l.x,i),o=Math.max(l.x,o),r=Math.min(l.y,r),A=Math.max(l.y,A)}return{min_x:i,max_x:o,min_y:r,max_y:A}}hasSameParent(e,t){const i=this.parentReference[e.id],o=this.parentReference[t.id];if(i===void 0||o===void 0)return!1;for(let r=0;r{this.setupHierarchicalLayout()}),this.body.emitter.on("_dataLoaded",()=>{this.layoutNetwork()}),this.body.emitter.on("_resetHierarchicalLayout",()=>{this.setupHierarchicalLayout()}),this.body.emitter.on("_adjustEdgesForHierarchicalLayout",()=>{if(this.options.hierarchical.enabled!==!0)return;const e=this.direction.curveType();this.body.emitter.emit("_forceDisableDynamicCurves",e,!1)})}setOptions(e,t){if(e!==void 0){const i=this.options.hierarchical,o=i.enabled;if(js(["randomSeed","improvedLayout","clusterThreshold"],this.options,e),ri(this.options,e,"hierarchical"),e.randomSeed!==void 0&&this._resetRNG(e.randomSeed),i.enabled===!0)return o===!0&&this.body.emitter.emit("refresh",!0),i.direction==="RL"||i.direction==="DU"?i.levelSeparation>0&&(i.levelSeparation*=-1):i.levelSeparation<0&&(i.levelSeparation*=-1),this.setDirectionStrategy(),this.body.emitter.emit("_resetHierarchicalLayout"),this.adaptAllOptionsForHierarchicalLayout(t);if(o===!0)return this.body.emitter.emit("refresh"),vt(t,this.optionsBackup)}return t}_resetRNG(e){this.initialRandomSeed=e,this._rng=UC(this.initialRandomSeed)}adaptAllOptionsForHierarchicalLayout(e){if(this.options.hierarchical.enabled===!0){const t=this.optionsBackup.physics;e.physics===void 0||e.physics===!0?(e.physics={enabled:t.enabled===void 0?!0:t.enabled,solver:"hierarchicalRepulsion"},t.enabled=t.enabled===void 0?!0:t.enabled,t.solver=t.solver||"barnesHut"):typeof e.physics=="object"?(t.enabled=e.physics.enabled===void 0?!0:e.physics.enabled,t.solver=e.physics.solver||"barnesHut",e.physics.solver="hierarchicalRepulsion"):e.physics!==!1&&(t.solver="barnesHut",e.physics={solver:"hierarchicalRepulsion"});let i=this.direction.curveType();if(e.edges===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges={smooth:!1};else if(e.edges.smooth===void 0)this.optionsBackup.edges={smooth:{enabled:!0,type:"dynamic"}},e.edges.smooth=!1;else if(typeof e.edges.smooth=="boolean")this.optionsBackup.edges={smooth:e.edges.smooth},e.edges.smooth={enabled:e.edges.smooth,type:i};else{const o=e.edges.smooth;o.type!==void 0&&o.type!=="dynamic"&&(i=o.type),this.optionsBackup.edges={smooth:{enabled:o.enabled===void 0?!0:o.enabled,type:o.type===void 0?"dynamic":o.type,roundness:o.roundness===void 0?.5:o.roundness,forceDirection:o.forceDirection===void 0?!1:o.forceDirection}},e.edges.smooth={enabled:o.enabled===void 0?!0:o.enabled,type:i,roundness:o.roundness===void 0?.5:o.roundness,forceDirection:o.forceDirection===void 0?!1:o.forceDirection}}this.body.emitter.emit("_forceDisableDynamicCurves",i)}return e}positionInitially(e){if(this.options.hierarchical.enabled!==!0){this._resetRNG(this.initialRandomSeed);const t=e.length+50;for(let i=0;ir){const l=e.length;for(;e.length>r&&o<=10;){o+=1;const c=e.length;o%3===0?this.body.modules.clustering.clusterBridges(A):this.body.modules.clustering.clusterOutliers(A);const h=e.length;if(c==h&&o%3!==0){this._declusterAll(),this.body.emitter.emit("_layoutFailed"),console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.");return}}this.body.modules.kamadaKawai.setOptions({springLength:Math.max(150,2*l)})}o>10&&console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."),this.body.modules.kamadaKawai.solve(e,this.body.edgeIndices,!0),this._shiftToCenter();const I=70;for(let l=0;l0){let e,t,i=!1,o=!1;this.lastNodeOnLevel={},this.hierarchical=new fJ;for(t in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,t)&&(e=this.body.nodes[t],e.options.level!==void 0?(i=!0,this.hierarchical.levels[t]=e.options.level):o=!0);if(o===!0&&i===!0)throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");{if(o===!0){const A=this.options.hierarchical.sortMethod;A==="hubsize"?this._determineLevelsByHubsize():A==="directed"?this._determineLevelsDirected():A==="custom"&&this._determineLevelsCustomCallback()}for(const A in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,A)&&this.hierarchical.ensureLevel(A);const r=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(r),this._condenseHierarchy(),this._shiftToCenter()}}}_condenseHierarchy(){var e=this;let t=!1;const i={},o=()=>{const S=A();let E=0;for(let _=0;_{const _=this.hierarchical.trees;for(const j in _)Object.prototype.hasOwnProperty.call(_,j)&&_[j]===S&&this.direction.shift(j,E)},A=()=>{const S=[];for(let E=0;E{if(!E[S.id]&&(E[S.id]=!0,this.hierarchical.childrenReference[S.id])){const _=this.hierarchical.childrenReference[S.id];if(_.length>0)for(let j=0;j<_.length;j++)I(this.body.nodes[_[j]],E)}},l=function(S){let E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e9,_=1e9,j=1e9,X=1e9,ne=-1e9;for(const F in S)if(Object.prototype.hasOwnProperty.call(S,F)){const V=e.body.nodes[F],Ie=e.hierarchical.levels[V.id],Ee=e.direction.getPosition(V),[Ze,xe]=e._getSpaceAroundNode(V,S);_=Math.min(Ze,_),j=Math.min(xe,j),Ie<=E&&(X=Math.min(Ee,X),ne=Math.max(Ee,ne))}return[X,ne,_,j]},c=(S,E)=>{const _=this.hierarchical.getMaxLevel(S.id),j=this.hierarchical.getMaxLevel(E.id);return Math.min(_,j)},h=(S,E,_)=>{const j=this.hierarchical;for(let X=0;X1)for(let V=0;V2&&arguments[2]!==void 0?arguments[2]:!1;const j=e.direction.getPosition(S),X=e.direction.getPosition(E),ne=Math.abs(X-j),F=e.options.hierarchical.nodeSpacing;if(ne>F){const V={},Ie={};I(S,V),I(E,Ie);const Ee=c(S,E),Ze=l(V,Ee),xe=l(Ie,Ee),He=Ze[1],Fe=xe[0],le=xe[2];if(Math.abs(He-Fe)>F){let Q=He-Fe+F;Q<-le+F&&(Q=-le+F),Q<0&&(e._shiftBlock(E.id,Q),t=!0,_===!0&&e._centerParent(E))}}},m=(S,E)=>{const _=E.id,j=E.edges,X=this.hierarchical.levels[E.id],ne=this.options.hierarchical.levelSeparation*this.options.hierarchical.levelSeparation,F={},V=[];for(let le=0;le{let Q=0;for(let W=0;W{let Q=0;for(let W=0;W{let Q=this.direction.getPosition(E);const W={};for(let ge=0;ge{const M=this.direction.getPosition(E);if(i[E.id]===void 0){const U={};I(E,U),i[E.id]=U}const Q=l(i[E.id]),W=Q[2],ge=Q[3],ee=le-M;let T=0;ee>0?T=Math.min(ee,ge-this.options.hierarchical.nodeSpacing):ee<0&&(T=-Math.min(-ee,W-this.options.hierarchical.nodeSpacing)),T!=0&&(this._shiftBlock(E.id,T),t=!0)},He=le=>{const M=this.direction.getPosition(E),[Q,W]=this._getSpaceAroundNode(E),ge=le-M;let ee=M;ge>0?ee=Math.min(M+(W-this.options.hierarchical.nodeSpacing),le):ge<0&&(ee=Math.max(M-(Q-this.options.hierarchical.nodeSpacing),le)),ee!==M&&(this.direction.setPosition(E,ee),t=!0)};let Fe=Ze(S,V);xe(Fe),Fe=Ze(S,j),He(Fe)},b=S=>{let E=this.hierarchical.getLevels();E=To(E).call(E);for(let _=0;_{let E=this.hierarchical.getLevels();E=To(E).call(E);for(let _=0;_{for(const S in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,S)&&this._centerParent(this.body.nodes[S])},x=()=>{let S=this.hierarchical.getLevels();S=To(S).call(S);for(let E=0;E0&&Math.abs(p)0&&(c=this.direction.getPosition(o[A-1])+l),this.direction.setPosition(I,c,i),this._validatePositionAndContinue(I,i,c),r++}}}}_placeBranchNodes(e,t){var i;const o=this.hierarchical.childrenReference[e];if(o===void 0)return;const r=[];for(let I=0;It&&this.positionedNodes[l.id]===void 0){const h=this.options.hierarchical.nodeSpacing;let p;I===0?p=this.direction.getPosition(this.body.nodes[e]):p=this.direction.getPosition(r[I-1])+h,this.direction.setPosition(l,p,c),this._validatePositionAndContinue(l,c,p)}else return}const A=this._getCenterPosition(r);this.direction.setPosition(this.body.nodes[e],A,t)}_validatePositionAndContinue(e,t,i){if(this.hierarchical.isTree){if(this.lastNodeOnLevel[t]!==void 0){const o=this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[t]]);if(i-o{var o;It(o=this.body.edgeIndices).call(o,i.id)!==-1&&t.push(i)}),t}_getHubSizes(){const e={},t=this.body.nodeIndices;Ke(t,o=>{const r=this.body.nodes[o],A=this._getActiveEdges(r).length;e[A]=!0});const i=[];return Ke(e,o=>{i.push(Number(o))}),gg(i).call(i,function(o,r){return r-o}),i}_determineLevelsByHubsize(){const e=(i,o)=>{this.hierarchical.levelDownstream(i,o)},t=this._getHubSizes();for(let i=0;i{const A=this.body.nodes[r];o===this._getActiveEdges(A).length&&this._crawlNetwork(e,r)})}}_determineLevelsCustomCallback(){const t=function(o,r,A){},i=(o,r,A)=>{let I=this.hierarchical.levels[o.id];I===void 0&&(I=this.hierarchical.levels[o.id]=1e5);const l=t(Dn.cloneOptions(o,"node"),Dn.cloneOptions(r,"node"),Dn.cloneOptions(A,"edge"));this.hierarchical.levels[r.id]=I+l};this._crawlNetwork(i),this.hierarchical.setMinLevelToZero()}_determineLevelsDirected(){var e;const t=mu(e=this.body.nodeIndices).call(e,(i,o)=>(i.set(o,this.body.nodes[o]),i),new ka);this.options.hierarchical.shakeTowards==="roots"?this.hierarchical.levels=hJ(t):this.hierarchical.levels=uJ(t),this.hierarchical.setMinLevelToZero()}_generateMap(){const e=(t,i)=>{this.hierarchical.levels[i.id]>this.hierarchical.levels[t.id]&&this.hierarchical.addRelation(t.id,i.id)};this._crawlNetwork(e),this.hierarchical.checkIfTree()}_crawlNetwork(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){},t=arguments.length>1?arguments[1]:void 0;const i={},o=(r,A)=>{if(i[r.id]===void 0){this.hierarchical.setTreeIndex(r,A),i[r.id]=!0;let I;const l=this._getActiveEdges(r);for(let c=0;c{if(i[r])return;i[r]=!0,this.direction.shift(r,t);const A=this.hierarchical.childrenReference[r];if(A!==void 0)for(let I=0;I{const l=this.hierarchical.parentReference[I];if(l!==void 0)for(let c=0;c{const l=this.hierarchical.parentReference[I];if(l!==void 0)for(let c=0;c{this._clean()}),this.body.emitter.on("_dataChanged",ge(r=this._restore).call(r,this)),this.body.emitter.on("_resetData",ge(A=this._restore).call(A,this))}_restore(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}setOptions(e,t,i){t!==void 0&&(t.locale!==void 0?this.options.locale=t.locale:this.options.locale=i.locale,t.locales!==void 0?this.options.locales=t.locales:this.options.locales=i.locales),e!==void 0&&(typeof e=="boolean"?this.options.enabled=e:(this.options.enabled=!0,vt(this.options,e)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}toggleEditMode(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}enableEditMode(){this.editMode=!0,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}disableEditMode(){this.editMode=!1,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}showManipulatorToolbar(){if(this._clean(),this.manipulationDOM={},this.guiEnabled===!0){var e,t;this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";const i=this.selectionHandler.getSelectedNodeCount(),o=this.selectionHandler.getSelectedEdgeCount(),r=i+o,A=this.options.locales[this.options.locale];let I=!1;this.options.addNode!==!1&&(this._createAddNodeButton(A),I=!0),this.options.addEdge!==!1&&(I===!0?this._createSeperator(1):I=!0,this._createAddEdgeButton(A)),i===1&&typeof this.options.editNode=="function"?(I===!0?this._createSeperator(2):I=!0,this._createEditNodeButton(A)):o===1&&i===0&&this.options.editEdge!==!1&&(I===!0?this._createSeperator(3):I=!0,this._createEditEdgeButton(A)),r!==0&&(i>0&&this.options.deleteNode!==!1?(I===!0&&this._createSeperator(4),this._createDeleteButton(A)):i===0&&this.options.deleteEdge!==!1&&(I===!0&&this._createSeperator(4),this._createDeleteButton(A))),this._bindElementEvents(this.closeDiv,ge(e=this.toggleEditMode).call(e,this)),this._temporaryBindEvent("select",ge(t=this.showManipulatorToolbar).call(t,this))}this.body.emitter.emit("_redraw")}addNodeMode(){var e;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var t;const i=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(i),this._createSeperator(),this._createDescription(i.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,ge(t=this.toggleEditMode).call(t,this))}this._temporaryBindEvent("click",ge(e=this._performAddNode).call(e,this))}editNode(){this.editMode!==!0&&this.enableEditMode(),this._clean();const e=this.selectionHandler.getSelectedNodes()[0];if(e!==void 0)if(this.inMode="editNode",typeof this.options.editNode=="function")if(e.isCluster!==!0){const t=vt({},e.options,!1);if(t.x=e.x,t.y=e.y,this.options.editNode.length===2)this.options.editNode(t,i=>{i!=null&&this.inMode==="editNode"&&this.body.data.nodes.getDataSet().update(i),this.showManipulatorToolbar()});else throw new Error("The function for edit does not support two arguments (data, callback)")}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError);else throw new Error("No function has been configured to handle the editing of nodes.");else this.showManipulatorToolbar()}addEdgeMode(){var e,t,i,o,r;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var A;const I=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(I),this._createSeperator(),this._createDescription(I.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,ge(A=this.toggleEditMode).call(A,this))}this._temporaryBindUI("onTouch",ge(e=this._handleConnect).call(e,this)),this._temporaryBindUI("onDragEnd",ge(t=this._finishConnect).call(t,this)),this._temporaryBindUI("onDrag",ge(i=this._dragControlNode).call(i,this)),this._temporaryBindUI("onRelease",ge(o=this._finishConnect).call(o,this)),this._temporaryBindUI("onDragStart",ge(r=this._dragStartEdge).call(r,this)),this._temporaryBindUI("onHold",()=>{})}editEdgeMode(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",typeof this.options.editEdge=="object"&&typeof this.options.editEdge.editWithoutDrag=="function"&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0)){const A=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(A.from.id,A.to.id);return}if(this.guiEnabled===!0){var e;const A=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(A),this._createSeperator(),this._createDescription(A.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,ge(e=this.toggleEditMode).call(e,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var t,i,o,r;const A=this.body.edges[this.edgeBeingEditedId],I=this._getNewTargetNode(A.from.x,A.from.y),l=this._getNewTargetNode(A.to.x,A.to.y);this.temporaryIds.nodes.push(I.id),this.temporaryIds.nodes.push(l.id),this.body.nodes[I.id]=I,this.body.nodeIndices.push(I.id),this.body.nodes[l.id]=l,this.body.nodeIndices.push(l.id),this._temporaryBindUI("onTouch",ge(t=this._controlNodeTouch).call(t,this)),this._temporaryBindUI("onTap",()=>{}),this._temporaryBindUI("onHold",()=>{}),this._temporaryBindUI("onDragStart",ge(i=this._controlNodeDragStart).call(i,this)),this._temporaryBindUI("onDrag",ge(o=this._controlNodeDrag).call(o,this)),this._temporaryBindUI("onDragEnd",ge(r=this._controlNodeDragEnd).call(r,this)),this._temporaryBindUI("onMouseMove",()=>{}),this._temporaryBindEvent("beforeDrawing",c=>{const h=A.edgeType.findBorderPositions(c);I.selected===!1&&(I.x=h.from.x,I.y=h.from.y),l.selected===!1&&(l.x=h.to.x,l.y=h.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}deleteSelected(){this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";const e=this.selectionHandler.getSelectedNodeIds(),t=this.selectionHandler.getSelectedEdgeIds();let i;if(e.length>0){for(let o=0;o0&&typeof this.options.deleteEdge=="function"&&(i=this.options.deleteEdge);if(typeof i=="function"){const o={nodes:e,edges:t};if(i.length===2)i(o,r=>{r!=null&&this.inMode==="delete"?(this.body.data.edges.getDataSet().remove(r.edges),this.body.data.nodes.getDataSet().remove(r.nodes),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()):(this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar())});else throw new Error("The function for delete does not support two arguments (data, callback)")}else this.body.data.edges.getDataSet().remove(t),this.body.data.nodes.getDataSet().remove(e),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}_setup(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}_createWrappers(){if(this.manipulationDiv===void 0&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),this.editModeDiv===void 0&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),this.closeDiv===void 0){var e,t;this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",(e=(t=this.options.locales[this.options.locale])===null||t===void 0?void 0:t.close)!==null&&e!==void 0?e:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv)}}_getNewTargetNode(e,t){const i=vt({},this.options.controlNodeStyle);i.id="targetNode"+Gs(),i.hidden=!1,i.physics=!1,i.x=e,i.y=t;const o=this.body.functions.createNode(i);return o.shape.boundingBox={left:e,right:e,top:t,bottom:t},o}_createEditButton(){var e;this._clean(),this.manipulationDOM={},kg(this.editModeDiv);const t=this.options.locales[this.options.locale],i=this._createButton("editMode","vis-edit vis-edit-mode",t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(i),this._bindElementEvents(i,ge(e=this.toggleEditMode).call(e,this))}_clean(){this.inMode=!1,this.guiEnabled===!0&&(kg(this.editModeDiv),kg(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}_cleanupDOMEventListeners(){for(const t of Ri(e=this._domEventListenerCleanupQueue).call(e,0)){var e;t()}}_removeManipulationDOM(){this._clean(),kg(this.manipulationDiv),kg(this.editModeDiv),kg(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}_createSeperator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+e]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+e].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+e])}_createAddNodeButton(e){var t;const i=this._createButton("addNode","vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,ge(t=this.addNodeMode).call(t,this))}_createAddEdgeButton(e){var t;const i=this._createButton("addEdge","vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,ge(t=this.addEdgeMode).call(t,this))}_createEditNodeButton(e){var t;const i=this._createButton("editNode","vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,ge(t=this.editNode).call(t,this))}_createEditEdgeButton(e){var t;const i=this._createButton("editEdge","vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,ge(t=this.editEdgeMode).call(t,this))}_createDeleteButton(e){var t;let i;this.options.rtl?i="vis-delete-rtl":i="vis-delete";const o=this._createButton("delete",i,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(o),this._bindElementEvents(o,ge(t=this.deleteSelected).call(t,this))}_createBackButton(e){var t;const i=this._createButton("back","vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,ge(t=this.showManipulatorToolbar).call(t,this))}_createButton(e,t,i){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"vis-label";return this.manipulationDOM[e+"Div"]=document.createElement("button"),this.manipulationDOM[e+"Div"].className="vis-button "+t,this.manipulationDOM[e+"Label"]=document.createElement("div"),this.manipulationDOM[e+"Label"].className=o,this.manipulationDOM[e+"Label"].innerText=i,this.manipulationDOM[e+"Div"].appendChild(this.manipulationDOM[e+"Label"]),this.manipulationDOM[e+"Div"]}_createDescription(e){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=e,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}_temporaryBindEvent(e,t){this.temporaryEventFunctions.push({event:e,boundFunction:t}),this.body.emitter.on(e,t)}_temporaryBindUI(e,t){if(this.body.eventListeners[e]!==void 0)this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=t;else throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+Ts(xt(this.body.eventListeners)))}_unbindTemporaryUIs(){for(const e in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}_unbindTemporaryEvents(){for(let e=0;e{i.destroy()});const o=r=>{let{keyCode:A,key:I}=r;(I==="Enter"||I===" "||A===13||A===32)&&t()};e.addEventListener("keyup",o,!1),this._domEventListenerCleanupQueue.push(()=>{e.removeEventListener("keyup",o,!1)})}_cleanupTemporaryNodesAndEdges(){for(let r=0;r=0;I--)if(r[I]!==this.selectedControlNode.id){A=this.body.nodes[r[I]];break}if(A!==void 0&&this.selectedControlNode!==void 0)if(A.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{const I=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===I.id?this._performEditEdge(A.id,o.to.id):this._performEditEdge(o.from.id,A.id)}else o.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}_handleConnect(e){if(new Date().valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=Ut({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;const t=this.lastTouch,i=this.selectionHandler.getNodeAt(t);if(i!==void 0)if(i.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{const o=this._getNewTargetNode(i.x,i.y);this.body.nodes[o.id]=o,this.body.nodeIndices.push(o.id);const r=this.body.functions.createEdge({id:"connectionEdge"+Gs(),from:i.id,to:o.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[r.id]=r,this.body.edgeIndices.push(r.id),this.temporaryIds.nodes.push(o.id),this.temporaryIds.edges.push(r.id)}this.touchTime=new Date().valueOf()}}_dragControlNode(e){const t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t);let o;this.temporaryIds.edges[0]!==void 0&&(o=this.body.edges[this.temporaryIds.edges[0]].fromId);const r=this.selectionHandler._getAllNodesOverlappingWith(i);let A;for(let l=r.length-1;l>=0;l--){var I;if(At(I=this.temporaryIds.nodes).call(I,r[l])===-1){A=this.body.nodes[r[l]];break}}if(e.controlEdge={from:o,to:A?A.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",e,t),this.temporaryIds.nodes[0]!==void 0){const l=this.body.nodes[this.temporaryIds.nodes[0]];l.x=this.canvas._XconvertDOMtoCanvas(t.x),l.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(e)}_finishConnect(e){const t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t);let o;this.temporaryIds.edges[0]!==void 0&&(o=this.body.edges[this.temporaryIds.edges[0]].fromId);const r=this.selectionHandler._getAllNodesOverlappingWith(i);let A;for(let l=r.length-1;l>=0;l--){var I;if(At(I=this.temporaryIds.nodes).call(I,r[l])===-1){A=this.body.nodes[r[l]];break}}this._cleanupTemporaryNodesAndEdges(),A!==void 0&&(A.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[o]!==void 0&&this.body.nodes[A.id]!==void 0&&this._performAddEdge(o,A.id)),e.controlEdge={from:o,to:A?A.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",e,t),this.body.emitter.emit("_redraw")}_dragStartEdge(e){const t=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",e,t,void 0,!0)}_performAddNode(e){const t={id:Gs(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if(typeof this.options.addNode=="function")if(this.options.addNode.length===2)this.options.addNode(t,i=>{i!=null&&this.inMode==="addNode"&&this.body.data.nodes.getDataSet().add(i),this.showManipulatorToolbar()});else throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");else this.body.data.nodes.getDataSet().add(t),this.showManipulatorToolbar()}_performAddEdge(e,t){const i={from:e,to:t};if(typeof this.options.addEdge=="function")if(this.options.addEdge.length===2)this.options.addEdge(i,o=>{o!=null&&this.inMode==="addEdge"&&(this.body.data.edges.getDataSet().add(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for connect does not support two arguments (data,callback)");else this.body.data.edges.getDataSet().add(i),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}_performEditEdge(e,t){const i={id:this.edgeBeingEditedId,from:e,to:t,label:this.body.data.edges.get(this.edgeBeingEditedId).label};let o=this.options.editEdge;if(typeof o=="object"&&(o=o.editWithoutDrag),typeof o=="function")if(o.length===2)o(i,r=>{r==null||this.inMode!=="editEdge"?(this.body.edges[i.id].updateEdgeType(),this.body.emitter.emit("_redraw"),this.showManipulatorToolbar()):(this.body.data.edges.getDataSet().update(r),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for edit does not support two arguments (data, callback)");else this.body.data.edges.getDataSet().update(i),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}const Ae="string",oe="boolean",H="number",Fa="array",we="object",Bx="dom",Gq="any",ju=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],Zu={borderWidth:{number:H},borderWidthSelected:{number:H,undefined:"undefined"},brokenImage:{string:Ae,undefined:"undefined"},chosen:{label:{boolean:oe,function:"function"},node:{boolean:oe,function:"function"},__type__:{object:we,boolean:oe}},color:{border:{string:Ae},background:{string:Ae},highlight:{border:{string:Ae},background:{string:Ae},__type__:{object:we,string:Ae}},hover:{border:{string:Ae},background:{string:Ae},__type__:{object:we,string:Ae}},__type__:{object:we,string:Ae}},opacity:{number:H,undefined:"undefined"},fixed:{x:{boolean:oe},y:{boolean:oe},__type__:{object:we,boolean:oe}},font:{align:{string:Ae},color:{string:Ae},size:{number:H},face:{string:Ae},background:{string:Ae},strokeWidth:{number:H},strokeColor:{string:Ae},vadjust:{number:H},multi:{boolean:oe,string:Ae},bold:{color:{string:Ae},size:{number:H},face:{string:Ae},mod:{string:Ae},vadjust:{number:H},__type__:{object:we,string:Ae}},boldital:{color:{string:Ae},size:{number:H},face:{string:Ae},mod:{string:Ae},vadjust:{number:H},__type__:{object:we,string:Ae}},ital:{color:{string:Ae},size:{number:H},face:{string:Ae},mod:{string:Ae},vadjust:{number:H},__type__:{object:we,string:Ae}},mono:{color:{string:Ae},size:{number:H},face:{string:Ae},mod:{string:Ae},vadjust:{number:H},__type__:{object:we,string:Ae}},__type__:{object:we,string:Ae}},group:{string:Ae,number:H,undefined:"undefined"},heightConstraint:{minimum:{number:H},valign:{string:Ae},__type__:{object:we,boolean:oe,number:H}},hidden:{boolean:oe},icon:{face:{string:Ae},code:{string:Ae},size:{number:H},color:{string:Ae},weight:{string:Ae,number:H},__type__:{object:we}},id:{string:Ae,number:H},image:{selected:{string:Ae,undefined:"undefined"},unselected:{string:Ae,undefined:"undefined"},__type__:{object:we,string:Ae}},imagePadding:{top:{number:H},right:{number:H},bottom:{number:H},left:{number:H},__type__:{object:we,number:H}},label:{string:Ae,undefined:"undefined"},labelHighlightBold:{boolean:oe},level:{number:H,undefined:"undefined"},margin:{top:{number:H},right:{number:H},bottom:{number:H},left:{number:H},__type__:{object:we,number:H}},mass:{number:H},physics:{boolean:oe},scaling:{min:{number:H},max:{number:H},label:{enabled:{boolean:oe},min:{number:H},max:{number:H},maxVisible:{number:H},drawThreshold:{number:H},__type__:{object:we,boolean:oe}},customScalingFunction:{function:"function"},__type__:{object:we}},shadow:{enabled:{boolean:oe},color:{string:Ae},size:{number:H},x:{number:H},y:{number:H},__type__:{object:we,boolean:oe}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:oe,array:Fa},borderRadius:{number:H},interpolation:{boolean:oe},useImageSize:{boolean:oe},useBorderWithImage:{boolean:oe},coordinateOrigin:{string:["center","top-left"]},__type__:{object:we}},size:{number:H},title:{string:Ae,dom:Bx,undefined:"undefined"},value:{number:H,undefined:"undefined"},widthConstraint:{minimum:{number:H},maximum:{number:H},__type__:{object:we,boolean:oe,number:H}},x:{number:H},y:{number:H},__type__:{object:we}},Fq={configure:{enabled:{boolean:oe},filter:{boolean:oe,string:Ae,array:Fa,function:"function"},container:{dom:Bx},showButton:{boolean:oe},__type__:{object:we,boolean:oe,string:Ae,array:Fa,function:"function"}},edges:{arrows:{to:{enabled:{boolean:oe},scaleFactor:{number:H},type:{string:ju},imageHeight:{number:H},imageWidth:{number:H},src:{string:Ae},__type__:{object:we,boolean:oe}},middle:{enabled:{boolean:oe},scaleFactor:{number:H},type:{string:ju},imageWidth:{number:H},imageHeight:{number:H},src:{string:Ae},__type__:{object:we,boolean:oe}},from:{enabled:{boolean:oe},scaleFactor:{number:H},type:{string:ju},imageWidth:{number:H},imageHeight:{number:H},src:{string:Ae},__type__:{object:we,boolean:oe}},__type__:{string:["from","to","middle"],object:we}},endPointOffset:{from:{number:H},to:{number:H},__type__:{object:we,number:H}},arrowStrikethrough:{boolean:oe},background:{enabled:{boolean:oe},color:{string:Ae},size:{number:H},dashes:{boolean:oe,array:Fa},__type__:{object:we,boolean:oe}},chosen:{label:{boolean:oe,function:"function"},edge:{boolean:oe,function:"function"},__type__:{object:we,boolean:oe}},color:{color:{string:Ae},highlight:{string:Ae},hover:{string:Ae},inherit:{string:["from","to","both"],boolean:oe},opacity:{number:H},__type__:{object:we,string:Ae}},dashes:{boolean:oe,array:Fa},font:{color:{string:Ae},size:{number:H},face:{string:Ae},background:{string:Ae},strokeWidth:{number:H},strokeColor:{string:Ae},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:H},multi:{boolean:oe,string:Ae},bold:{color:{string:Ae},size:{number:H},face:{string:Ae},mod:{string:Ae},vadjust:{number:H},__type__:{object:we,string:Ae}},boldital:{color:{string:Ae},size:{number:H},face:{string:Ae},mod:{string:Ae},vadjust:{number:H},__type__:{object:we,string:Ae}},ital:{color:{string:Ae},size:{number:H},face:{string:Ae},mod:{string:Ae},vadjust:{number:H},__type__:{object:we,string:Ae}},mono:{color:{string:Ae},size:{number:H},face:{string:Ae},mod:{string:Ae},vadjust:{number:H},__type__:{object:we,string:Ae}},__type__:{object:we,string:Ae}},hidden:{boolean:oe},hoverWidth:{function:"function",number:H},label:{string:Ae,undefined:"undefined"},labelHighlightBold:{boolean:oe},length:{number:H,undefined:"undefined"},physics:{boolean:oe},scaling:{min:{number:H},max:{number:H},label:{enabled:{boolean:oe},min:{number:H},max:{number:H},maxVisible:{number:H},drawThreshold:{number:H},__type__:{object:we,boolean:oe}},customScalingFunction:{function:"function"},__type__:{object:we}},selectionWidth:{function:"function",number:H},selfReferenceSize:{number:H},selfReference:{size:{number:H},angle:{number:H},renderBehindTheNode:{boolean:oe},__type__:{object:we}},shadow:{enabled:{boolean:oe},color:{string:Ae},size:{number:H},x:{number:H},y:{number:H},__type__:{object:we,boolean:oe}},smooth:{enabled:{boolean:oe},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:H},forceDirection:{string:["horizontal","vertical","none"],boolean:oe},__type__:{object:we,boolean:oe}},title:{string:Ae,undefined:"undefined"},width:{number:H},widthConstraint:{maximum:{number:H},__type__:{object:we,boolean:oe,number:H}},value:{number:H,undefined:"undefined"},__type__:{object:we}},groups:{useDefaultGroups:{boolean:oe},__any__:Zu,__type__:{object:we}},interaction:{dragNodes:{boolean:oe},dragView:{boolean:oe},hideEdgesOnDrag:{boolean:oe},hideEdgesOnZoom:{boolean:oe},hideNodesOnDrag:{boolean:oe},hover:{boolean:oe},keyboard:{enabled:{boolean:oe},speed:{x:{number:H},y:{number:H},zoom:{number:H},__type__:{object:we}},bindToWindow:{boolean:oe},autoFocus:{boolean:oe},__type__:{object:we,boolean:oe}},multiselect:{boolean:oe},navigationButtons:{boolean:oe},selectable:{boolean:oe},selectConnectedEdges:{boolean:oe},hoverConnectedEdges:{boolean:oe},tooltipDelay:{number:H},zoomView:{boolean:oe},zoomSpeed:{number:H},__type__:{object:we}},layout:{randomSeed:{undefined:"undefined",number:H,string:Ae},improvedLayout:{boolean:oe},clusterThreshold:{number:H},hierarchical:{enabled:{boolean:oe},levelSeparation:{number:H},nodeSpacing:{number:H},treeSpacing:{number:H},blockShifting:{boolean:oe},edgeMinimization:{boolean:oe},parentCentralization:{boolean:oe},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:we,boolean:oe}},__type__:{object:we}},manipulation:{enabled:{boolean:oe},initiallyActive:{boolean:oe},addNode:{boolean:oe,function:"function"},addEdge:{boolean:oe,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:we,boolean:oe,function:"function"}},deleteNode:{boolean:oe,function:"function"},deleteEdge:{boolean:oe,function:"function"},controlNodeStyle:Zu,__type__:{object:we,boolean:oe}},nodes:Zu,physics:{enabled:{boolean:oe},barnesHut:{theta:{number:H},gravitationalConstant:{number:H},centralGravity:{number:H},springLength:{number:H},springConstant:{number:H},damping:{number:H},avoidOverlap:{number:H},__type__:{object:we}},forceAtlas2Based:{theta:{number:H},gravitationalConstant:{number:H},centralGravity:{number:H},springLength:{number:H},springConstant:{number:H},damping:{number:H},avoidOverlap:{number:H},__type__:{object:we}},repulsion:{centralGravity:{number:H},springLength:{number:H},springConstant:{number:H},nodeDistance:{number:H},damping:{number:H},__type__:{object:we}},hierarchicalRepulsion:{centralGravity:{number:H},springLength:{number:H},springConstant:{number:H},nodeDistance:{number:H},damping:{number:H},avoidOverlap:{number:H},__type__:{object:we}},maxVelocity:{number:H},minVelocity:{number:H},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:oe},iterations:{number:H},updateInterval:{number:H},onlyDynamicEdges:{boolean:oe},fit:{boolean:oe},__type__:{object:we,boolean:oe}},timestep:{number:H},adaptiveTimestep:{boolean:oe},wind:{x:{number:H},y:{number:H},__type__:{object:we}},__type__:{object:we,boolean:oe}},autoResize:{boolean:oe},clickToUse:{boolean:oe},locale:{string:Ae},locales:{__any__:{any:Gq},__type__:{object:we}},height:{string:Ae},width:{string:Ae},__type__:{object:we}},Px={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},opacity:[0,0,1,.1],fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown","hexagon"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"}},endPointOffset:{from:[0,-10,10,1],to:[0,-10,10,1]},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],selfReference:{size:[20,0,200,1],angle:[Math.PI/2,-6*Math.PI,6*Math.PI,Math.PI/8],renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"],shakeTowards:["leaves","roots"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0,autoFocus:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0,zoomSpeed:[1,.1,2,.1]},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{theta:[.5,.1,1,.05],gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{theta:[.5,.1,1,.05],gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01],wind:{x:[0,-10,10,.1],y:[0,-10,10,.1]}}},Vq=(n,e,t)=>{var i;return!!(Dg(n).call(n,"physics")&&Dg(i=Px.physics.solver).call(i,e)&&t.physics.solver!==e&&e!=="wind")};class Uq{constructor(){}getDistances(e,t,i){const o={},r=e.edges;for(let I=0;I2&&arguments[2]!==void 0?arguments[2]:!1;const o=this.distanceSolver.getDistances(this.body,e,t);this._createL_matrix(o),this._createK_matrix(o),this._createE_matrix();const r=.01,A=1;let I=0;const l=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),c=5;let h=1e9,p=0,m=0,b=0,w=0,S=0;for(;h>r&&IA&&Sthis.body.emitter.emit("_requestRedraw")),this.groups=new TH,this.canvas=new P$(this.body),this.selectionHandler=new mq(this.body,this.canvas),this.interactionHandler=new U$(this.body,this.canvas,this.selectionHandler),this.view=new G$(this.body,this.canvas),this.renderer=new R$(this.body,this.canvas),this.physics=new M$(this.body),this.layoutEngine=new Bq(this.body),this.clustering=new k$(this.body),this.manipulation=new Lq(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new t$(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new S$(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new Yq(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(t),this.setData(e)}xb(me.prototype),me.prototype.setOptions=function(n){if(n===null&&(n=void 0),n!==void 0){if(pU.validate(n,Fq)===!0&&console.error("%cErrors have been found in the supplied options object.",S1),_s(["locale","locales","clickToUse"],this.options,n),n.locale!==void 0&&(n.locale=MU(n.locales||this.options.locales,n.locale)),n=this.layoutEngine.setOptions(n.layout,n),this.canvas.setOptions(n),this.groups.setOptions(n.groups),this.nodesHandler.setOptions(n.nodes),this.edgesHandler.setOptions(n.edges),this.physics.setOptions(n.physics),this.manipulation.setOptions(n.manipulation,n,this.options),this.interactionHandler.setOptions(n.interaction),this.renderer.setOptions(n.interaction),this.selectionHandler.setOptions(n.interaction),n.groups!==void 0&&this.body.emitter.emit("refreshNodes"),"configure"in n&&(this.configurator||(this.configurator=new hU(this,this.body.container,Px,this.canvas.pixelRatio,Vq)),this.configurator.setOptions(n.configure)),this.configurator&&this.configurator.options.enabled===!0){const i={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};vt(i.nodes,this.nodesHandler.options),vt(i.edges,this.edgesHandler.options),vt(i.layout,this.layoutEngine.options),vt(i.interaction,this.selectionHandler.options),vt(i.interaction,this.renderer.options),vt(i.interaction,this.interactionHandler.options),vt(i.manipulation,this.manipulation.options),vt(i.physics,this.physics.options),vt(i.global,this.canvas.options),vt(i.global,this.options),this.configurator.setModuleOptions(i)}n.clickToUse!==void 0?n.clickToUse===!0?this.activator===void 0&&(this.activator=new uU(this.canvas.frame),this.activator.on("change",()=>{this.body.emitter.emit("activate")})):(this.activator!==void 0&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}},me.prototype._updateVisibleIndices=function(){const n=this.body.nodes,e=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&!this.clustering._isClusteredNode(t)&&n[t].options.hidden===!1&&this.body.nodeIndices.push(n[t].id);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const i=e[t],o=n[i.fromId],r=n[i.toId],A=o!==void 0&&r!==void 0;!this.clustering._isClusteredEdge(t)&&i.options.hidden===!1&&A&&o.options.hidden===!1&&r.options.hidden===!1&&this.body.edgeIndices.push(i.id)}},me.prototype.bindEventListeners=function(){this.body.emitter.on("_dataChanged",()=>{this.edgesHandler._updateState(),this.body.emitter.emit("_dataUpdated")}),this.body.emitter.on("_dataUpdated",()=>{this.clustering._updateState(),this._updateVisibleIndices(),this._updateValueRange(this.body.nodes),this._updateValueRange(this.body.edges),this.body.emitter.emit("startSimulation"),this.body.emitter.emit("_requestRedraw")})},me.prototype.setData=function(n){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),n&&n.dot&&(n.nodes||n.edges))throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.');if(this.setOptions(n&&n.options),n&&n.dot){console.warn("The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);");const e=OU(n.dot);this.setData(e);return}else if(n&&n.gephi){console.warn("The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);");const e=NU(n.gephi);this.setData(e);return}else this.nodesHandler.setData(n&&n.nodes,!0),this.edgesHandler.setData(n&&n.edges,!0);this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")},me.prototype.destroy=function(){this.body.emitter.emit("destroy"),this.body.emitter.off(),this.off(),delete this.groups,delete this.canvas,delete this.selectionHandler,delete this.interactionHandler,delete this.view,delete this.renderer,delete this.physics,delete this.layoutEngine,delete this.clustering,delete this.manipulation,delete this.nodesHandler,delete this.edgesHandler,delete this.configurator,delete this.images;for(const n in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,n)&&delete this.body.nodes[n];for(const n in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,n)&&delete this.body.edges[n];kg(this.body.container)},me.prototype._updateValueRange=function(n){let e,t,i,o=0;for(e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const r=n[e].getValue();r!==void 0&&(t=t===void 0?r:Math.min(r,t),i=i===void 0?r:Math.max(r,i),o+=r)}if(t!==void 0&&i!==void 0)for(e in n)Object.prototype.hasOwnProperty.call(n,e)&&n[e].setValueRange(t,i,o)},me.prototype.isActive=function(){return!this.activator||this.activator.active},me.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)},me.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)},me.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)},me.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)},me.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)},me.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)},me.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)},me.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)},me.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)},me.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)},me.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)},me.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)},me.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)},me.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)},me.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)},me.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)},me.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)},me.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)},me.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)},me.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)},me.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)},me.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)},me.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)},me.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)},me.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)},me.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)},me.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)},me.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)},me.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)},me.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)},me.prototype.getConnectedNodes=function(n){return this.body.nodes[n]!==void 0?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)},me.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)},me.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)},me.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)},me.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)},me.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)},me.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)},me.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)},me.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)},me.prototype.getNodeAt=function(){const n=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return n!==void 0&&n.id!==void 0?n.id:n},me.prototype.getEdgeAt=function(){const n=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return n!==void 0&&n.id!==void 0?n.id:n},me.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)},me.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)},me.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()},me.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)},me.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)},me.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)},me.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)},me.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)},me.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)},me.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)},me.prototype.getOptionsFromConfigurator=function(){let n={};return this.configurator&&(n=this.configurator.getOptions.apply(this.configurator)),n};function Hq(n,e){n.on("click",t=>{e.onHover(null),t.edges.length===0&&e.onHoverEdge(null);const i=t.nodes[0];i!==void 0?e.onFocus(String(i)):e.onClear()}),n.on("doubleClick",t=>{const i=t.nodes[0];if(i!==void 0){e.onOpenSource(String(i));return}const o=t.edges[0];o!==void 0&&e.onOpenRelationshipSource(String(o))}),n.on("hoverNode",t=>{t.node!==void 0&&(e.onInteractionStart(),e.onHoverEdge(null),e.onHover({nodeId:String(t.node),x:t.pointer.DOM.x,y:t.pointer.DOM.y}))}),n.on("blurNode",()=>e.onHover(null)),n.on("hoverEdge",t=>{t.edge!==void 0&&(e.onHover(null),e.onHoverEdge({edgeId:String(t.edge),x:t.pointer.DOM.x,y:t.pointer.DOM.y}))}),n.on("blurEdge",()=>e.onHoverEdge(null)),n.on("dragStart",()=>{e.onInteractionStart(),e.onHover(null),e.onHoverEdge(null)}),n.on("zoom",()=>{e.onHover(null),e.onHoverEdge(null)})}const Kq=1e3,Wq=4e3,Bu=4e3;function Qq(n){return n.nodes.length>=Kq||n.edges.length>=Wq?"static":"interactive"}function Xq(n,e=!1){if(e)return nJ(n);const t=new Map;for(const h of n){const p=t.get(h.community)??[];p.push(h),t.set(h.community,p)}const i=[...t.entries()].sort(([h],[p])=>h-p).map(([h,p])=>({community:h,members:p.sort((m,b)=>m.id.localeCompare(b.id))})),o=i.reduce((h,p)=>Math.max(h,p.members.length),1),r=Math.max(1,Math.ceil(Math.sqrt(i.length))),A=Math.max(1,Math.ceil(i.length/r)),I=Math.max(280,Math.ceil(Math.sqrt(o))*48),l=Math.PI*(3-Math.sqrt(5)),c=new Map;return i.forEach((h,p)=>{const m=p%r,b=Math.floor(p/r),w=(m-(r-1)/2)*I,S=(b-(A-1)/2)*I;h.members.forEach((x,O)=>{if(O===0){c.set(x.id,{x:w,y:S});return}const E=24*Math.sqrt(O),R=O*l;c.set(x.id,{x:w+Math.cos(R)*E,y:S+Math.sin(R)*E})})}),c}function $q(n,e,t=!1){const i=[...n].sort((o,r)=>o.community-r.community||(r.degree??0)-(o.degree??0)||o.id.localeCompare(r.id));if(e==="circle"){const o=Math.max(160,i.length*44/(2*Math.PI));return new Map(i.map((r,A)=>{const I=-Math.PI/2+A*2*Math.PI/Math.max(1,i.length);return[r.id,{x:Math.cos(I)*o,y:Math.sin(I)*o}]}))}if(e==="concentric"){const o=[...n].sort((r,A)=>(A.degree??0)-(r.degree??0)||(A.memberCount??0)-(r.memberCount??0)||r.community-A.community||r.id.localeCompare(A.id));return Jq(o)}return e==="hierarchical"?qq(i):e==="spiral"?eJ(i):tJ(i,t)}function qq(n){const e=new Map;for(const o of n){const r=o.depth??(o.root?0:1),A=e.get(r)??[];A.push(o),e.set(r,A)}const t=[...e.entries()].sort(([o],[r])=>o-r),i=new Map;for(const[o,r]of t){r.sort((I,l)=>Number(l.root??!1)-Number(I.root??!1)||(l.degree??0)-(I.degree??0)||I.id.localeCompare(l.id));const A=148;r.forEach((I,l)=>i.set(I.id,{x:(l-(r.length-1)/2)*A,y:o*168}))}return i}function Jq(n){const e=new Map,t=n[0];if(!t)return e;e.set(t.id,{x:0,y:0});let i=1,o=1;for(;i{if(o===0)return[i.id,{x:0,y:0}];const r=36*Math.sqrt(o),A=o*.52;return[i.id,{x:Math.cos(A)*r,y:Math.sin(A)*r}]}))}function tJ(n,e){const r=new Map;n.forEach((w,S)=>{const x=e?Math.floor(S/16):w.community,O=r.get(x)??[];O.push(w),r.set(x,O)});const A=[...r.entries()].sort(([w],[S])=>w-S).map(([w,S])=>{const x=Math.max(1,Math.ceil(Math.sqrt(S.length))),O=Math.max(1,Math.ceil(S.length/x));return{key:w,members:S,columns:x,rows:O,width:(x-1)*56,height:(O-1)*56}}),I=Math.max(1,Math.ceil(Math.sqrt(A.length))),l=Math.max(1,Math.ceil(A.length/I)),c=Array.from({length:I},()=>0),h=Array.from({length:l},()=>0);A.forEach((w,S)=>{const x=S%I,O=Math.floor(S/I);c[x]=Math.max(c[x]??0,w.width),h[O]=Math.max(h[O]??0,w.height)});const p=Lx(c,112),m=Lx(h,112),b=new Map;return A.forEach((w,S)=>{const x=S%I,O=Math.floor(S/I);w.members.forEach((E,R)=>{const B=Math.floor(R/w.columns),W=Math.min(w.columns,w.members.length-B*w.columns),ne=R%w.columns;b.set(E.id,{x:(p[x]??0)+(ne-(W-1)/2)*56,y:(m[O]??0)+(B-(w.rows-1)/2)*56})})}),b}function Lx(n,e){let i=-(n.reduce((o,r)=>o+r,0)+Math.max(0,n.length-1)*e)/2;return n.map(o=>{const r=i+o/2;return i+=o+e,r})}function Gx(n){if(!n.stats.aggregated||n.edges.length<=Bu)return n.edges;const e=[...n.edges].sort((A,I)=>(I.weight??Fx(I.relation))-(A.weight??Fx(A.relation))||A.source.localeCompare(I.source)||A.target.localeCompare(I.target)||A.id.localeCompare(I.id)),t=new Map(n.nodes.map(A=>[A.id,A.id])),i=A=>{let I=t.get(A)??A;for(;t.get(I)!==void 0&&t.get(I)!==I;)I=t.get(I);let l=A;for(;t.get(l)!==void 0&&t.get(l)!==I;){const c=t.get(l);t.set(l,I),l=c}return I},o=[],r=new Set;for(const A of e){const I=i(A.source),l=i(A.target);if(I!==l&&(t.set(l,I),o.push(A),r.add(A.id),o.length===Bu))return o}for(const A of e)if(!r.has(A.id)&&(o.push(A),o.length===Bu))break;return o}function Fx(n){const e=Number.parseInt(n,10);return Number.isFinite(e)&&e>0?e:1}function nJ(n){const e=[...n].sort((o,r)=>(r.degree??0)-(o.degree??0)||(r.memberCount??0)-(o.memberCount??0)||o.id.localeCompare(r.id)),t=Math.PI*(3-Math.sqrt(5)),i=34;return new Map(e.map((o,r)=>{if(r===0)return[o.id,{x:0,y:0}];const A=i*Math.sqrt(r),I=r*t;return[o.id,{x:Math.cos(I)*A,y:Math.sin(I)*A}]}))}const dI=176,uI=108,Vx=8,iJ=1500,gJ=2e3;function oJ(n){const e=[...n.positions.values()],t=n.viewport.left+n.viewport.width,i=n.viewport.top+n.viewport.height,o=[...e.map(L=>L.x),n.viewport.left,t],r=[...e.map(L=>L.y),n.viewport.top,i],A=Math.min(...o),I=Math.max(...o),l=Math.min(...r),c=Math.max(...r),h=Math.max(1,I-A),p=Math.max(1,c-l),m=dI-Vx*2,b=uI-Vx*2,w=Math.min(m/h,b/p),S=h*w,x=p*w,O=(dI-S)/2,E=(uI-x)/2,R=({x:L,y:G})=>({x:O+(L-A)*w,y:E+(G-l)*w}),B=({x:L,y:G})=>({x:A+(L-O)/w,y:l+(G-E)/w}),W=R({x:n.viewport.left,y:n.viewport.top}),ne=R({x:t,y:i});return{project:R,unproject:B,viewport:{x:W.x,y:W.y,width:ne.x-W.x,height:ne.y-W.y}}}function sJ({model:n,snapshot:e,visibleNodeIds:t,visibleEdgeIds:i,focusedNodeId:o,semanticDetail:r=!1,onNavigate:A}){const I=Z.useMemo(()=>oJ(e),[e]),l=Z.useMemo(()=>n.nodes.filter(b=>!t||t.has(b.id)).sort((b,w)=>b.id.localeCompare(w.id)),[n.nodes,t]),c=l.slice(0,iJ),h=Z.useMemo(()=>n.edges.filter(b=>(!i||i.has(b.id))&&(!t||t.has(b.source)&&t.has(b.target))).sort((b,w)=>b.id.localeCompare(w.id)).slice(0,gJ),[n.edges,i,t]),p=Z.useMemo(()=>new Map(n.communities.map(b=>[b.id,b.color])),[n.communities]),m=b=>{const w=b.currentTarget.getBoundingClientRect();w.width<=0||w.height<=0||A(I.unproject({x:(b.clientX-w.left)/w.width*dI,y:(b.clientY-w.top)/w.height*uI}))};return f.jsxs("aside",{className:"compass-minimap compass-glass-panel","aria-label":"Graph overview",children:[f.jsxs("header",{children:[f.jsx("span",{children:"Map"}),f.jsx("small",{children:c.length{const w=e.positions.get(b.source),S=e.positions.get(b.target);if(!w||!S)return null;const x=I.project(w),O=I.project(S);return f.jsx("line",{x1:x.x,y1:x.y,x2:O.x,y2:O.y},b.id)})}),f.jsx("g",{className:"compass-minimap-nodes",children:c.map(b=>{const w=e.positions.get(b.id);if(!w)return null;const S=I.project(w);return f.jsx("circle",{cx:S.x,cy:S.y,r:b.id===o?3:1.65,fill:r?$3(ls(b.kind)):b.color?.background??p.get(b.community)??"currentColor","data-node-category":r?ls(b.kind):void 0,"data-focused":b.id===o?"true":void 0},b.id)})}),f.jsx("rect",{className:"compass-minimap-viewport",x:I.viewport.x,y:I.viewport.y,width:I.viewport.width,height:I.viewport.height,rx:"2"})]})})]})}const Ux={added:{background:"#163d24",border:"#56d364"},removed:{background:"#4b1f24",border:"#ff7b72"},changed:{background:"#3d3015",border:"#d7a72b"},unchanged:{background:"#29313b",border:"#8b949e"}},rJ={callable:{background:"#193652",border:"#5fa8ff"},type:{background:"#3d341b",border:"#e3b341"},module:{background:"#193b38",border:"#56d4b4"},boundary:{background:"#432b29",border:"#ff9b87"},other:{background:"#29313b",border:"#8b949e"}},aJ={execution:"#5fa8ff",dependency:"#56d4b4",structure:"#e3b341",flow:"#ff9b87",other:"#60728b"},AJ=200,CJ=1500,Yx=.1,IJ=3,lJ=18,cJ=96,dJ=1500;function uJ(n,e){const t=[...e].sort().slice(0,dJ),i=n.getPositions(t),o=Object.values(i),r=o.length===0?0:Math.max(Math.max(...o.map(({x:l})=>l))-Math.min(...o.map(({x:l})=>l)),Math.max(...o.map(({y:l})=>l))-Math.min(...o.map(({y:l})=>l))),A=Math.min(cJ,Math.max(lJ,r*.012)),I=Math.PI*(3-Math.sqrt(5));t.forEach((l,c)=>{const h=i[l];if(!h)return;const p=c*I;n.moveNode(l,h.x+Math.cos(p)*A,h.y+Math.sin(p)*A)})}function Ys(n){return window.matchMedia("(prefers-reduced-motion: reduce)").matches?!1:{duration:n,easingFunction:"easeInOutQuad"}}const hJ={autoResize:!0,interaction:{hover:!0,tooltipDelay:100,hideEdgesOnDrag:!0,navigationButtons:!1,keyboard:{enabled:!0}},layout:{improvedLayout:!0},nodes:{borderWidth:1.5,shape:"dot"},edges:{arrows:{to:{enabled:!0,scaleFactor:.5}},smooth:{enabled:!0,type:"continuous",roundness:.2},selectionWidth:3},physics:{enabled:!0,solver:"forceAtlas2Based",stabilization:{enabled:!0,iterations:200,fit:!0,updateInterval:20},forceAtlas2Based:{gravitationalConstant:-60,centralGravity:.005,springLength:120,springConstant:.08,damping:.4,avoidOverlap:.8}}},fJ={autoResize:!0,interaction:{hover:!0,tooltipDelay:100,hideEdgesOnDrag:!0,navigationButtons:!1,keyboard:{enabled:!0}},layout:{improvedLayout:!0,randomSeed:17},nodes:{borderWidth:2,shape:"dot"},edges:{arrows:{to:{enabled:!0,scaleFactor:.38}},smooth:{enabled:!0,type:"continuous",roundness:.14},selectionWidth:3},physics:{enabled:!0,solver:"barnesHut",stabilization:{enabled:!0,iterations:520,fit:!0,updateInterval:25},maxVelocity:35,minVelocity:.55,barnesHut:{theta:.45,gravitationalConstant:-12e3,centralGravity:.12,springLength:180,springConstant:.025,damping:.3,avoidOverlap:.85}}},pJ={autoResize:!0,interaction:{hover:!0,tooltipDelay:100,hideEdgesOnDrag:!0,hideEdgesOnZoom:!0,hoverConnectedEdges:!1,selectConnectedEdges:!1,navigationButtons:!1,keyboard:{enabled:!0}},layout:{improvedLayout:!1,randomSeed:17},nodes:{borderWidth:1.5,shape:"dot"},edges:{arrows:{to:{enabled:!1}},chosen:!1,smooth:!1,selectionWidth:3},physics:{enabled:!1,solver:"barnesHut"}};function Hx(n,e,t,i,o,r){const A=e.change&&i?i[e.change]:void 0,I=r?.[ls(e.kind)],l=A?A.background:I?.background??e.color?.background??o?.get(e.community)??n.communities.find(c=>c.id===e.community)?.color??"#6688aa";return{background:l,border:t??A?.border??I?.border??e.color?.border??l}}function Rt(n,e){return typeof window>"u"?e:getComputedStyle(document.documentElement).getPropertyValue(n).trim()||e}function mJ(n){return n==="extracted"?{dashes:!1,width:2,opacity:.7}:n==="ambiguous"?{dashes:[3,4],width:2,opacity:.62}:n==="aggregated"?{dashes:!1,width:1,opacity:.2}:{dashes:!0,width:1,opacity:.35}}function Kx(n,e,t,i){if(n==="added")return{color:i.added.border,dashes:!1,width:1.7,opacity:.6};if(n==="removed")return{color:i.removed.border,dashes:[6,5],width:1.6,opacity:.56};if(n==="changed")return{color:i.changed.border,dashes:!1,width:1.65,opacity:.48};if(n==="unchanged")return{color:i.unchanged.border,dashes:!0,width:1,opacity:.2};const o=mJ(e);return{color:t,...o}}function vJ(n){return n==="added"?{enabled:!0,type:"curvedCW",roundness:.13}:n==="removed"?{enabled:!0,type:"curvedCCW",roundness:.13}:{enabled:!0,type:"continuous",roundness:.1}}function bJ(n){const e=new Map;for(const r of[...n].sort((A,I)=>A.id.localeCompare(I.id))){const A=r.change??"unchanged",I=e.get(A)??[];I.push(r),e.set(A,I)}const t={added:-300,changed:0,removed:300,unchanged:0},i=new Map,o=Math.PI*(3-Math.sqrt(5));for(const[r,A]of e)A.forEach((I,l)=>{const c=l*o,h=r==="unchanged"?210+Math.sqrt(l)*34:42+Math.sqrt(l)*40;i.set(I.id,{x:t[r]+Math.cos(c)*h,y:Math.sin(c)*h})});return i}function yJ(){const[n,e]=Z.useState(0);return Z.useEffect(()=>{const t=()=>e(r=>r+1),i=new MutationObserver(t);i.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style"]}),i.observe(document.body,{attributes:!0,attributeFilter:["class","style"]});const o=window.matchMedia("(prefers-color-scheme: dark)");return o.addEventListener("change",t),()=>{i.disconnect(),o.removeEventListener("change",t)}},[]),n}function Pu(n){const e=n.match(/^#([\da-f]{3}|[\da-f]{6})$/i)?.[1];if(e){const i=e.length===3?[...e].map(o=>`${o}${o}`).join(""):e;return[Number.parseInt(i.slice(0,2),16),Number.parseInt(i.slice(2,4),16),Number.parseInt(i.slice(4,6),16)]}const t=n.match(/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)/i);if(t)return[Number.parseFloat(t[1]??"0"),Number.parseFloat(t[2]??"0"),Number.parseFloat(t[3]??"0")]}function wJ(n,e,t){const i=Pu(n),o=Pu(e);if(!i||!o)return e;const r=i.map((A,I)=>Math.round(A*(1-t)+o[I]*t));return`rgb(${r[0]}, ${r[1]}, ${r[2]})`}function Wx(n){const e=Pu(n);return e?(e[0]*299+e[1]*587+e[2]*114)/1e3<145:!0}function Hs(n,e,t,i=!1){return{background:wJ(n,e,i?t?.18:.1:t?.26:.14),border:e}}const xJ=Z.forwardRef(function({model:e,focusedNodeId:t,physicsRunning:i,layoutStyle:o="automatic",initialPositions:r,forceLabels:A,showEdgeLabels:I=!1,isolatedNodeIds:l,isolatedEdgeIds:c,layoutSpacing:h=1,showMinimap:p=!1,semanticDetail:m=!1,hiddenCommunities:b,hiddenChanges:w,onFocus:S,onOpenSource:x,onOpenRelationshipSource:O,onInteractionStart:E=()=>{},onHover:R,onHoverEdge:B,onClear:W,onStabilized:ne},L){const G=Z.useRef(null),Ie=Z.useRef(null),[fe,Be]=Z.useState(null),Te=Z.useRef(i);Te.current=i;const He=Z.useRef(i),Ve=Z.useRef({onFocus:S,onOpenSource:x,onOpenRelationshipSource:O,onInteractionStart:E,onHover:R,onHoverEdge:B,onClear:W});Ve.current={onFocus:S,onOpenSource:x,onOpenRelationshipSource:O,onInteractionStart:E,onHover:R,onHoverEdge:B,onClear:W};const Ce=Z.useRef(ne);Ce.current=ne;const M=Z.useRef(null),Q=Z.useRef(h),K=yJ(),ie=Z.useMemo(()=>Qq(e),[e.edges.length,e.nodes.length]),ee=Z.useMemo(()=>Gx(e),[e]),T=Z.useMemo(()=>new Set(e.nodes.filter(V=>!b.has(V.community)&&!w.has(V.change??"unchanged")&&(!l||l.has(V.id))).map(V=>V.id)),[w,b,l,e.nodes]),F=Z.useMemo(()=>new Set(ee.filter(V=>T.has(V.source)&&T.has(V.target)&&(!c||c.has(V.id))).map(V=>V.id)),[c,ee,T]),te=Z.useRef(T);te.current=T;const re=Z.useCallback(()=>{const V=Ie.current,ae=G.current;if(!V||!ae)return;const Xe=V.getPositions([...te.current].sort().slice(0,CJ)),St=V.getViewPosition(),wt=Math.max(Yx,V.getScale()),Mn=Math.max(1,ae.clientWidth)/wt,wI=Math.max(1,ae.clientHeight)/wt;Be({positions:new Map(Object.entries(Xe)),viewport:{left:St.x-Mn/2,top:St.y-wI/2,width:Mn,height:wI}})},[]),le=Z.useMemo(()=>{let V=1;for(const ae of e.nodes)V=Math.max(V,ae.degree??1);return V},[e.nodes]),pe=Z.useMemo(()=>new Map(e.communities.map(V=>[V.id,V.color])),[e.communities]),Pe=Z.useMemo(()=>Rt("--vscode-editor-foreground",Rt("--foreground","#eef5ff")),[K]),dt=Z.useMemo(()=>Rt("--vscode-descriptionForeground",Rt("--muted-foreground","#60728b")),[K]),Re=Z.useMemo(()=>Rt("--vscode-editor-foreground",Rt("--foreground","#d8e4f2")),[K]),en=Z.useMemo(()=>{const V=Rt("--vscode-editor-background",Rt("--background","#08111f")),ae=Wx(V);return{added:Hs(V,Rt("--vscode-gitDecoration-addedResourceForeground",ae?"#56d364":"#1a7f37"),ae),removed:Hs(V,Rt("--vscode-gitDecoration-deletedResourceForeground",ae?"#ff7b72":"#cf222e"),ae),changed:Hs(V,Rt("--vscode-gitDecoration-modifiedResourceForeground",ae?"#d7a72b":"#9a6700"),ae),unchanged:Hs(V,Rt("--vscode-descriptionForeground",ae?"#8b949e":"#656d76"),ae,!0)}},[K]),z=Z.useMemo(()=>{const V=Rt("--vscode-editor-background",Rt("--background","#08111f")),ae=Wx(V),Xe=(St,wt,Mn)=>Hs(V,Rt(St,ae?wt:Mn),ae);return{callable:Xe("--vscode-symbolIcon-functionForeground","#5fa8ff","#0969da"),type:Xe("--vscode-symbolIcon-classForeground","#e3b341","#9a6700"),module:Xe("--vscode-symbolIcon-moduleForeground","#56d4b4","#168b76"),boundary:Xe("--vscode-symbolIcon-eventForeground","#ff9b87","#cf4c35"),other:Hs(V,Rt("--vscode-descriptionForeground",ae?"#8b949e":"#656d76"),ae,!0)}},[K]),ve=Z.useMemo(()=>({execution:Rt("--vscode-symbolIcon-functionForeground","#5fa8ff"),dependency:Rt("--vscode-symbolIcon-moduleForeground","#56d4b4"),structure:Rt("--vscode-symbolIcon-classForeground","#e3b341"),flow:Rt("--vscode-symbolIcon-eventForeground","#ff9b87"),other:dt}),[dt,K]),xe=Z.useMemo(()=>e.nodes.some(V=>V.change!==void 0)||e.edges.some(V=>V.change!==void 0),[e.edges,e.nodes]),ze=Z.useMemo(()=>new Set(xe?e.nodes.filter(V=>V.change!=="unchanged").sort((V,ae)=>(ae.degree??0)-(V.degree??0)||V.id.localeCompare(ae.id)).slice(0,12).map(V=>V.id):ie==="static"?[...e.nodes].sort((V,ae)=>(ae.degree??0)-(V.degree??0)||V.id.localeCompare(ae.id)).slice(0,20).map(V=>V.id):[]),[xe,e.nodes,ie]),Bt=Z.useMemo(()=>ie==="static"?new Set([...e.nodes].sort((V,ae)=>(ae.degree??0)-(V.degree??0)||V.id.localeCompare(ae.id)).slice(0,AJ).map(V=>V.id)):new Set,[e.nodes,ie]),Ht=Z.useMemo(()=>xe?bJ(e.nodes):new Map,[xe,e.nodes]),fn=o==="automatic"?1:h,se=Z.useMemo(()=>o==="automatic"?new Map:$q(e.nodes,o,e.stats.aggregated),[o,e.nodes,e.stats.aggregated]),je=Z.useMemo(()=>ie==="static"&&!xe?Xq(e.nodes,e.stats.aggregated):new Map,[xe,e.nodes,e.stats.aggregated,ie]),ke=Z.useMemo(()=>typeof document>"u"?void 0:document.body.classList.contains("vscode-high-contrast")||document.body.classList.contains("vscode-high-contrast-light")?Rt("--vscode-contrastBorder","#ffffff"):void 0,[K]),Pt=Z.useMemo(()=>new Fs(e.nodes.map(V=>{const ae=V.size??Math.min(40,10+30*(V.degree??1)/le),Xe=xe?V.change==="unchanged"?7+5*Math.sqrt((V.degree??1)/le):11+12*Math.sqrt((V.degree??1)/le):ae,St=se.get(V.id)??Ht.get(V.id)??r?.get(V.id)??je.get(V.id),wt=St?{x:St.x*fn,y:St.y*fn}:void 0;return{id:V.id,label:V.label,color:Hx(e,V,void 0,Ux,pe,m?rJ:void 0),shape:m?X3(ls(V.kind)):"dot",size:Xe,...wt??{},opacity:V.change==="unchanged"?.58:1,font:{color:"#eef5ff",face:"system-ui",size:xe||ie==="static"?ze.has(V.id)?12:0:(V.degree??1)>=le*.15?12:0}}})),[ze,xe,Ht,pe,r,fn,le,e,ie,m,se,je]),Sn=Z.useMemo(()=>new Fs(ee.map(V=>{const ae=Kx(V.change,V.confidence,m?aJ[uc(V.relation)]:"#60728b",Ux);return{id:V.id,from:V.source,to:V.target,dashes:ae.dashes,width:ae.width,...xe&&ie!=="static"?{smooth:vJ(V.change)}:{},color:{color:ae.color,opacity:ae.opacity}}})),[xe,ee,ie,m]);return Z.useEffect(()=>{const V=G.current;if(!V)return;M.current=null;const ae=new me(V,{nodes:Pt,edges:Sn},ie==="static"?pJ:xe?fJ:hJ);ae.setOptions({physics:{enabled:Te.current}}),Te.current||ae.stopSimulation(),Ie.current=ae,Hq(ae,{onFocus:wt=>Ve.current.onFocus(wt),onOpenSource:wt=>Ve.current.onOpenSource(wt),onOpenRelationshipSource:wt=>Ve.current.onOpenRelationshipSource(wt),onInteractionStart:()=>{Te.current&&ae.stopSimulation(),Ve.current.onInteractionStart()},onHover:wt=>Ve.current.onHover(wt),onHoverEdge:wt=>Ve.current.onHoverEdge(wt),onClear:()=>Ve.current.onClear()}),ae.on("stabilizationIterationsDone",()=>{ae.stopSimulation(),M.current={position:ae.getViewPosition(),scale:ae.getScale()},Ce.current(),re()}),ae.on("stabilized",re),ae.on("dragEnd",re),ae.on("zoom",re),ae.on("resize",re),ae.on("animationFinished",re);const Xe=Ht.size>0||se.size>0||(r?.size??0)>0||je.size>0;!Te.current&&Xe&&(ae.stopSimulation(),ae.fit({animation:!1}),M.current={position:ae.getViewPosition(),scale:ae.getScale()});const St=window.setTimeout(re,0);return()=>{window.clearTimeout(St),ae.destroy(),Ie.current=null}},[Sn,Pt,xe,Ht,r,ie,se,je,re]),Z.useEffect(()=>{const V=Ie.current;if(!V)return;const ae=He.current;He.current=i,V.setOptions({physics:{enabled:i}}),i?(ae||uJ(V,te.current),V.startSimulation()):V.stopSimulation()},[Sn,Pt,i]),Z.useEffect(()=>{const V=Ie.current;if(!V||o!=="automatic"||ie==="static")return;const ae=Q.current;if(Q.current=h,V.setOptions({physics:xe?{barnesHut:{springLength:180*h}}:{forceAtlas2Based:{springLength:120*h}}}),!i&&ae!==h){const Xe=h/ae,St=V.getPositions();Pt.update(Object.entries(St).map(([wt,Mn])=>({id:wt,x:Mn.x*Xe,y:Mn.y*Xe}))),V.redraw(),re()}},[xe,h,o,Pt,i,re,ie]),Z.useEffect(()=>{Pt.update(e.nodes.map(V=>({id:V.id,hidden:!T.has(V.id)}))),Sn.update(ee.map(V=>({id:V.id,hidden:!F.has(V.id)}))),re()},[Sn,re,ee,e.nodes,Pt,F,T]),Z.useEffect(()=>{const V=Ie.current;if(!V)return;const ae=t?new Set(V.getConnectedNodes(t).map(String)):new Set;if(Pt.update(e.nodes.map(Xe=>{const St=Xe.id===t,wt=!t||St||ae.has(Xe.id),Mn=Xe.change==="unchanged"?.58:1;return{id:Xe.id,opacity:t?wt?Math.max(Mn,.72):.08:Mn,borderWidth:St?4:ke?2.5:1.5,color:Hx(e,Xe,ke,en,pe,m?z:void 0),shadow:St?{enabled:!0,color:Xe.change?en[Xe.change].border:m?z[ls(Xe.kind)].border:Xe.color?.background??pe.get(Xe.community)??"#76b7ff",size:24,x:0,y:0}:{enabled:!1}}})),Sn.update(ee.map(Xe=>{const St=Kx(Xe.change,Xe.confidence,m?ve[uc(Xe.relation)]:dt,en),wt=Xe.source===t||Xe.target===t;return{id:Xe.id,dashes:St.dashes,color:{color:St.color,opacity:t?wt?.92:.05:St.opacity},width:wt?Math.max(3,St.width):St.width}})),t)if(V.selectNodes([t]),Te.current)V.focus(t,{scale:1.35,animation:window.matchMedia("(prefers-reduced-motion: reduce)").matches?!1:{duration:260,easingFunction:"easeInOutQuad"}});else{const Xe=V.getPositions([t])[t];Xe&&V.moveTo({position:Xe,scale:1.35,animation:!1})}else V.unselectAll()},[ke,en,pe,dt,Sn,t,e,Pt,ee,m,ve,z]),Z.useEffect(()=>{Pt.update(e.nodes.map(V=>({id:V.id,font:{color:Pe,size:A&&(ie!=="static"||Bt.has(V.id))||V.id===t||(xe||ie==="static"?ze.has(V.id):(V.degree??1)>=le*.15)?12:0}})))},[ze,xe,Bt,t,A,Pe,le,e.nodes,Pt,ie]),Z.useEffect(()=>{Sn.update(ee.map(V=>({id:V.id,label:I?V.relation:"",font:{align:"middle",color:Re,face:"system-ui",size:10,strokeWidth:3,strokeColor:Rt("--vscode-editor-background",Rt("--background","#08111f"))}})))},[Sn,Re,ee,I]),Z.useImperativeHandle(L,()=>({fit(){Ie.current?.fit({animation:Ys(280)})},fitSelection(V){const ae=Ie.current;!ae||V.length===0||ae.fit({nodes:[...new Set(V)],animation:Ys(240)})},reset(){const V=Ie.current,ae=M.current;if(V){if(!ae){V.fit({animation:!1});return}V.moveTo({position:ae.position,scale:ae.scale,animation:!1})}},resetZoom(){Ie.current?.moveTo({scale:1,animation:Ys(180)})},zoomIn(){const V=Ie.current;V&&V.moveTo({scale:Math.min(IJ,V.getScale()*1.25),animation:Ys(160)})},zoomOut(){const V=Ie.current;V&&V.moveTo({scale:Math.max(Yx,V.getScale()/1.25),animation:Ys(160)})}}),[]),f.jsxs(f.Fragment,{children:[f.jsx("div",{ref:G,className:"compass-canvas","data-rendering-profile":ie,"data-layout-style":o,"data-physics-running":i?"true":"false","data-isolated":l?"true":"false","data-layout-spacing":h,role:"region","aria-label":"Interactive Compass code graph",onMouseLeave:()=>{R(null),B(null)}}),p&&fe?f.jsx(sJ,{model:e,snapshot:fe,visibleNodeIds:T,visibleEdgeIds:F,focusedNodeId:t,semanticDetail:m,onNavigate:V=>Ie.current?.moveTo({position:V,animation:Ys(180)})}):null]})}),Qx=1,Xx=4;function SJ(n){return Math.max(Qx,Math.min(Xx,Math.trunc(n)))}function EJ(n,e,t,i){const o=SJ(t),r=new Map,A=new Map;for(const h of n.edges){const p=r.get(h.source)??[];p.push(h),r.set(h.source,p);const m=A.get(h.target)??[];m.push(h),A.set(h.target,m)}for(const h of[...r.values(),...A.values()])h.sort((p,m)=>p.id.localeCompare(m.id));const I=new Set([e]),l=new Set;let c=[e];for(let h=0;h0;h+=1){const p=new Set;for(const m of c.sort()){if(i!=="incoming")for(const b of r.get(m)??[])l.add(b.id),I.has(b.target)||p.add(b.target);if(i!=="outgoing")for(const b of A.get(m)??[])l.add(b.id),I.has(b.source)||p.add(b.source)}c=[...p];for(const m of c)I.add(m)}return{nodeIds:I,edgeIds:l}}const $x={focusedNodeId:null,physicsRunning:!1,layoutStyle:"automatic",initialLayoutPending:!1,forceLabels:!1,showEdgeLabels:!1,isolateSelection:!1,neighborhoodDepth:1,edgeDirection:"both",layoutSpacing:1,showMinimap:!0,hiddenCommunities:new Set,hiddenChanges:new Set,query:""};function TJ(n,e="automatic"){return e!=="automatic"?{...$x,layoutStyle:e,physicsRunning:!1,initialLayoutPending:!1}:{...$x,physicsRunning:!1,initialLayoutPending:!1}}function OJ(n,e){switch(e.type){case"focus":return{...n,focusedNodeId:e.nodeId,physicsRunning:!1};case"clearFocus":return{...n,focusedNodeId:null,isolateSelection:!1};case"stabilized":return n.physicsRunning||n.initialLayoutPending?{...n,physicsRunning:!1,initialLayoutPending:!1}:n;case"revealLayout":return{...n,physicsRunning:!1,initialLayoutPending:!1};case"setPhysics":return{...n,physicsRunning:e.running};case"setLayout":return{...n,layoutStyle:e.layout,physicsRunning:e.runPhysics,initialLayoutPending:!1};case"setLabels":return{...n,forceLabels:e.visible};case"setEdgeLabels":return{...n,showEdgeLabels:e.visible};case"setIsolation":return{...n,isolateSelection:e.isolated};case"setNeighborhoodDepth":return{...n,neighborhoodDepth:Math.max(1,Math.min(4,Math.trunc(e.depth)))};case"setEdgeDirection":return{...n,edgeDirection:e.direction};case"setLayoutSpacing":return{...n,layoutSpacing:e.spacing};case"setMinimap":return{...n,showMinimap:e.visible};case"search":return{...n,query:e.query};case"toggleCommunity":{const t=new Set(n.hiddenCommunities);return t.has(e.communityId)?t.delete(e.communityId):t.add(e.communityId),{...n,hiddenCommunities:t}}case"setHiddenCommunities":return{...n,hiddenCommunities:new Set(e.communityIds)};case"toggleChange":{const t=new Set(n.hiddenChanges);return t.has(e.change)?t.delete(e.change):t.add(e.change),{...n,hiddenChanges:t}}}}const NJ=[{value:"added",label:"Added"},{value:"removed",label:"Removed"},{value:"changed",label:"Changed"},{value:"unchanged",label:"Context"}],DJ={hierarchical:"Depth-layer layout",circle:"Circle layout",concentric:"Concentric layout",spiral:"Spiral layout",grid:"Square grid layout"},Lu=["both","outgoing","incoming"];function MJ(n){return n instanceof HTMLElement&&(n.isContentEditable||n.tagName==="INPUT"||n.tagName==="TEXTAREA"||n.tagName==="SELECT")}function Gu({model:n,host:e,communityDetail:t,communityLoading:i,communityError:o,onBackToOverview:r,sourceRevisions:A,queryResult:I,initialInspectorLayout:l,onInspectorLayoutChange:c,preferredLayout:h="automatic",toolbarLeading:p,toolbarLeadingPanel:m,toolbarLeadingOpen:b,onToolbarLeadingClose:w,stageOverlay:S,showInspectorHeader:x=!0}){const[O,E]=Z.useState(()=>Ev(l)),R=Z.useCallback(ne=>{const L=Ev(ne);E(L),c?.(L)},[c]),B=t?.model??n,W=t?`community-${t.communityId}`:"overview";return f.jsx(zJ,{model:B,host:e,detailCommunityId:t?.communityId,communityLoading:i,communityError:o,onBackToOverview:t?r:void 0,bounded:t?.bounded,sourceRevisions:A,queryResult:I,inspectorLayout:O,onInspectorLayoutChange:R,preferredLayout:h,toolbarLeading:p,toolbarLeadingPanel:m,toolbarLeadingOpen:b,onToolbarLeadingClose:w,stageOverlay:S,showInspectorHeader:x},W)}function zJ({model:n,host:e,detailCommunityId:t,communityLoading:i,communityError:o,onBackToOverview:r,bounded:A,sourceRevisions:I,queryResult:l,inspectorLayout:c,onInspectorLayoutChange:h,preferredLayout:p,toolbarLeading:m,toolbarLeadingPanel:b,toolbarLeadingOpen:w,onToolbarLeadingClose:S,stageOverlay:x,showInspectorHeader:O}){const[E,R]=Z.useReducer(OJ,n,se=>TJ(se,p)),[B,W]=Z.useState(null),[ne,L]=Z.useState(null),G=Z.useRef(null),Ie=Z.useRef(e);Ie.current=e;const fe=Z.useMemo(()=>new Map(n.nodes.map(se=>[se.id,se])),[n.nodes]),Be=Z.useMemo(()=>new Map(n.edges.map(se=>[se.id,se])),[n.edges]),Te=Z.useMemo(()=>{const se=new Map,je=new Map;for(const ke of n.edges){const Pt=se.get(ke.source)??new Set;Pt.add(ke.target),se.set(ke.source,Pt);const Sn=se.get(ke.target)??new Set;Sn.add(ke.source),se.set(ke.target,Sn);const V=je.get(ke.source)??[];V.push(ke),je.set(ke.source,V);const ae=je.get(ke.target)??[];ae.push(ke),je.set(ke.target,ae)}return{neighborIds:se,edges:je}},[n.edges]),He=Z.useMemo(()=>n.nodes.map(se=>({node:se,text:[se.label,se.source?.file,se.kind].filter(je=>je!==void 0).join(` -`).toLocaleLowerCase()})),[n.nodes]),Ve=Z.useMemo(()=>Gx(n).length,[n]),Ce=E.focusedNodeId?fe.get(E.focusedNodeId):void 0,M=Z.useMemo(()=>Ce?EJ(n,Ce.id,E.neighborhoodDepth,E.edgeDirection):null,[n,Ce,E.edgeDirection,E.neighborhoodDepth]),Q=B?fe.get(B.nodeId):void 0,K=Q?Tv(n,Q,t):void 0,ie=ne?Be.get(ne.edgeId):void 0,ee=ie?fe.get(ie.source):void 0,T=ie?fe.get(ie.target):void 0,F=Z.useMemo(()=>n.nodes.some(se=>se.change!==void 0)||n.edges.some(se=>se.change!==void 0),[n.edges,n.nodes]),te=Z.useMemo(()=>{const se=new Map;for(const je of n.nodes){const ke=je.change??"unchanged";se.set(ke,(se.get(ke)??0)+1)}return se},[n.nodes]),re=Z.useMemo(()=>Ce?[...Te.neighborIds.get(Ce.id)??[]].map(se=>fe.get(se)).filter(se=>se!==void 0).sort((se,je)=>se.label.localeCompare(je.label)):[],[Te.neighborIds,fe,Ce]),le=Z.useMemo(()=>Ce?Te.edges.get(Ce.id)??[]:[],[Te.edges,Ce]),pe=Z.useDeferredValue(E.query),Pe=Z.useMemo(()=>{const se=pe.trim().toLocaleLowerCase();if(!se)return[];const je=[];for(const ke of He)if(ke.text.includes(se)&&je.push(ke.node),je.length===20)break;return je},[pe,He]),dt=Z.useCallback(se=>{W(null),L(null),R({type:"focus",nodeId:se})},[]),Re=Z.useCallback(()=>{E.physicsRunning&&R({type:"setPhysics",running:!1})},[E.physicsRunning]),en=Z.useCallback(()=>{W(null),L(null),R({type:"clearFocus"})},[]);Z.useEffect(()=>{E.focusedNodeId&&!fe.has(E.focusedNodeId)&&en()},[en,fe,E.focusedNodeId]),Z.useEffect(()=>{const se=je=>{if(je.metaKey||je.ctrlKey||je.altKey||MJ(je.target))return;const ke=je.key.toLocaleLowerCase();let Pt=!0;if(ke==="f")je.shiftKey&&M?G.current?.fitSelection([...M.nodeIds]):je.shiftKey?Pt=!1:G.current?.fit();else if(ke==="+"||ke==="=")G.current?.zoomIn();else if(ke==="-"||ke==="_")G.current?.zoomOut();else if(ke==="0")G.current?.resetZoom();else if(ke==="i"&&Ce)R({type:"setIsolation",isolated:!E.isolateSelection});else if(ke==="[")R({type:"setNeighborhoodDepth",depth:Math.max(Qx,E.neighborhoodDepth-1)});else if(ke==="]")R({type:"setNeighborhoodDepth",depth:Math.min(Xx,E.neighborhoodDepth+1)});else if(ke==="d"){const Sn=Lu.indexOf(E.edgeDirection);R({type:"setEdgeDirection",direction:Lu[(Sn+1)%Lu.length]??"both"})}else ke==="m"?R({type:"setMinimap",visible:!E.showMinimap}):Pt=!1;Pt&&je.preventDefault()};return document.addEventListener("keydown",se,{capture:!0}),()=>document.removeEventListener("keydown",se,{capture:!0})},[Ce,M,E.edgeDirection,E.isolateSelection,E.neighborhoodDepth,E.showMinimap]);const z=Z.useCallback(()=>{R({type:"stabilized"})},[]),ve=Z.useCallback(()=>{R({type:"revealLayout"})},[]),xe=Z.useCallback(se=>{const je=fe.get(se);if(!je)return;const ke=Tv(n,je,t);ke.type==="community"&&Ie.current.openCommunity?.(ke.communityId),ke.type==="source"&&Ie.current.openSource(ke.source,je.change==="removed"?I?.before:I?.after)},[t,fe,n.stats.aggregated,I?.after,I?.before]),ze=Z.useCallback(se=>{const je=Be.get(se);if(!je)return;const ke=dv(je);ke&&Ie.current.openSource(ke,je.change==="removed"?I?.before:I?.after)},[Be,I?.after,I?.before]),Bt=Ce&&E.isolateSelection&&M?`Isolated ${M.nodeIds.size} nodes · ${E.neighborhoodDepth} hop${E.neighborhoodDepth===1?"":"s"}`:Ce?`Inspecting ${Ce.label}`:E.layoutStyle!=="automatic"?DJ[E.layoutStyle]:E.physicsRunning?"Layout running":"Layout static",Ht=i!=null?n.communities.find(se=>se.id===i):void 0,fn=i!=null?{kind:"community",communityLabel:Ht?.label??`Community ${i}`}:E.initialLayoutPending?{kind:"layout"}:null;return f.jsxs("div",{className:"compass-workspace",style:{"--compass-inspector-width":`${c.width}px`},children:[f.jsxs("div",{className:"compass-workspace-content","data-inspector-collapsed":c.collapsed,inert:fn?!0:void 0,"aria-hidden":fn?!0:void 0,children:[f.jsxs("main",{className:"compass-graph-stage","data-comparison":F?"true":"false",children:[f.jsx(xJ,{ref:G,model:n,focusedNodeId:Ce?.id??null,physicsRunning:E.physicsRunning,layoutStyle:E.layoutStyle,forceLabels:E.forceLabels,showEdgeLabels:E.showEdgeLabels,isolatedNodeIds:E.isolateSelection?M?.nodeIds:void 0,isolatedEdgeIds:E.isolateSelection?M?.edgeIds:void 0,layoutSpacing:E.layoutSpacing,showMinimap:E.showMinimap,semanticDetail:t!==void 0&&!F,hiddenCommunities:E.hiddenCommunities,hiddenChanges:E.hiddenChanges,onFocus:dt,onOpenSource:xe,onOpenRelationshipSource:ze,onInteractionStart:Re,onHover:W,onHoverEdge:L,onClear:en,onStabilized:z}),x,f.jsx(P3,{status:Bt,physicsRunning:E.physicsRunning,layoutStyle:E.layoutStyle,forceLabels:E.forceLabels,showEdgeLabels:E.showEdgeLabels,hasSelection:Ce!==void 0,isolateSelection:E.isolateSelection,neighborhoodDepth:E.neighborhoodDepth,edgeDirection:E.edgeDirection,layoutSpacing:E.layoutSpacing,showMinimap:E.showMinimap,leadingControls:m,leadingPanel:b,leadingPanelOpen:w,onLeadingPanelClose:S,onTogglePhysics:()=>R({type:"setPhysics",running:!E.physicsRunning}),onLayoutChange:se=>R({type:"setLayout",layout:se,runPhysics:!1}),onZoomOut:()=>G.current?.zoomOut(),onResetZoom:()=>G.current?.resetZoom(),onZoomIn:()=>G.current?.zoomIn(),onFit:()=>G.current?.fit(),onFitSelection:()=>{M&&G.current?.fitSelection([...M.nodeIds])},onReset:()=>{en(),R({type:"setIsolation",isolated:!1}),G.current?.reset()},onToggleLabels:()=>R({type:"setLabels",visible:!E.forceLabels}),onToggleEdgeLabels:()=>R({type:"setEdgeLabels",visible:!E.showEdgeLabels}),onToggleIsolation:()=>{const se=!E.isolateSelection;R({type:"setIsolation",isolated:se}),se&&M&&window.requestAnimationFrame(()=>{G.current?.fitSelection([...M.nodeIds])})},onNeighborhoodDepthChange:se=>R({type:"setNeighborhoodDepth",depth:se}),onEdgeDirectionChange:se=>R({type:"setEdgeDirection",direction:se}),onLayoutSpacingChange:se=>R({type:"setLayoutSpacing",spacing:se}),onToggleMinimap:()=>R({type:"setMinimap",visible:!E.showMinimap}),onBack:r}),F&&f.jsx("div",{className:"compass-change-legend","aria-label":"Graph change filters",children:NJ.filter(({value:se})=>(te.get(se)??0)>0).map(({value:se,label:je})=>{const ke=!E.hiddenChanges.has(se);return f.jsxs("button",{type:"button","data-change":se,"aria-pressed":ke,onClick:()=>R({type:"toggleChange",change:se}),children:[f.jsx("span",{"aria-hidden":"true"}),je,f.jsx("small",{children:te.get(se)??0})]},se)})}),t!==void 0&&!F?f.jsx(e_,{model:n}):null,o&&f.jsx("div",{className:"absolute bottom-4 left-4 z-20 max-w-md rounded-md border border-destructive/50 bg-background/95 px-3 py-2 text-sm text-destructive shadow-lg",role:"alert",children:o}),A&&f.jsxs("div",{className:"compass-bounded-notice",role:"status",children:[f.jsx("strong",{children:"Partial community comparison"}),f.jsxs("span",{children:["This view is limited to ",A.limit.toLocaleString()," nodes. Increase"," ",f.jsx("code",{children:"compass.graphNodeLimit"})," to inspect all"," ",Math.max(A.parentMembers,A.currentMembers).toLocaleString()," symbols."]})]}),B&&Q&&K&&f.jsx(o_,{node:Q,hover:B,activation:K}),ne&&ie&&ee&&T&&f.jsx(I_,{edge:ie,sourceNode:ee,targetNode:T,hover:ne})]}),!c.collapsed&&f.jsx(i_,{width:c.width,onResize:se=>h({...c,width:se})}),f.jsx(_3,{model:n,selected:Ce,neighbors:re,connectedEdges:le,query:E.query,matches:Pe,hiddenCommunities:E.hiddenCommunities,comparisonMode:F,sourceRevisions:I,queryResult:l,renderedEdgeCount:Ve,showHeader:O,onQueryChange:se=>R({type:"search",query:se}),onFocus:dt,onOpenSource:e.openSource,onOpenCommunity:t===void 0?e.openCommunity:void 0,onQueryNode:e.queryNode,onToggleCommunity:se=>R({type:"toggleCommunity",communityId:se}),onSetAllVisible:se=>R({type:"setHiddenCommunities",communityIds:se?[]:n.communities.map(je=>je.id)}),collapsed:c.collapsed,onToggleCollapsed:()=>h({...c,collapsed:!c.collapsed})})]}),fn?.kind==="community"?f.jsx(bv,{kind:"community",communityLabel:fn.communityLabel}):fn?.kind==="layout"?f.jsx(bv,{kind:"layout",onShowGraph:ve}):null]})}const Fu=224,kJ=76,hI=124,Vu=96,Ks=96,RJ=288,_J=112,Uu=12;function jJ(n,e,t={width:1280,height:620},i={},o){const r=n.filter(L=>L.nodeCount>0||L.incomingCalls>0||L.outgoingCalls>0);if(r.length===0)return{width:t.width,height:t.height,nodes:[],routes:[],lanes:[]};const A=new Set(r.map(L=>L.id)),I=e.filter(L=>A.has(L.sourceSection)&&A.has(L.targetSection)),l=ZJ(r,I),c=l.length,h=Math.max(t.width,Ks*2+RJ*c),p=(h-Ks*2)/c;LJ(l,I);const m=Math.max(...l.map(L=>L.length)),b=Math.max(t.height,hI+Vu+m*_J),w=l.findIndex(L=>L.some(G=>G.id===o)),S=Array.from({length:c},(L,G)=>({index:G,x:Ks+p*G,width:p,label:YJ(G,c,w<0?void 0:w)})),x=b-hI-Vu,O=l.flatMap((L,G)=>{const Ie=x/Math.max(1,L.length);return L.map((fe,Be)=>{const Te={x:Ks+p*G+p/2,y:hI+Ie*Be+Ie/2},He=i[fe.id]??Te;return{...fe,x:Yu(He.x,Ks+Fu/2,h-Ks-Fu/2),y:Yu(He.y,hI,b-Vu),width:Math.min(Fu,p-40),height:kJ,column:UJ(He.x,S)}})}),E=new Map(O.map(L=>[L.id,L])),R=FJ(I,E),B=t2(I,E,"source"),W=t2(I,E,"target"),ne=I.flatMap(L=>{const G=E.get(L.sourceSection),Ie=E.get(L.targetSection);if(!G||!Ie)return[];const fe=n2(G,Ie);return[{...L,direction:fe,path:GJ(G,Ie,fe,R.get(L.id)??0,{height:b},B.get(L.id)??0,W.get(L.id)??0),width:1+Math.min(4.4,Math.log10(L.calls+1)*1.35)}]});return{width:h,height:b,nodes:O,routes:ne,lanes:S}}function ZJ(n,e){if(n.length===1)return[[n[0]]];if(e.length===0)return qx(n);const t=BJ(n,e),i=new Map(t.map((c,h)=>[c.id,h])),o=new Map;for(const c of n)o.set(c.id,[]);for(const c of e)(i.get(c.sourceSection)??0)<(i.get(c.targetSection)??0)&&c.sourceSection!==c.targetSection&&o.get(c.targetSection)?.push(c);const r=new Map;for(const c of t){const h=(o.get(c.id)??[]).map(p=>(r.get(p.sourceSection)??0)+1);r.set(c.id,h.length>0?Math.max(...h):0)}const A=Math.max(0,...r.values()),I=Math.min(Uu,A+1);if(I===1)return qx(n);const l=Array.from({length:I},()=>[]);for(const c of t){const h=r.get(c.id)??0,p=Ac.length>0)}function BJ(n,e){const t=new Map(n.map(A=>[A.id,A])),i=new Set(t.keys()),o=[],r=[];for(;i.size>0;){const A=PJ(i,e),I=[...i].map(p=>({section:t.get(p),incoming:A.incoming.get(p)??0,outgoing:A.outgoing.get(p)??0})),l=I.filter(p=>p.incoming===0),c=I.filter(p=>p.outgoing===0);if(l.length>0){const p=l.sort((m,b)=>b.outgoing-m.outgoing||Va(m.section,b.section))[0];o.push(p.section),i.delete(p.section.id);continue}if(c.length>0){const p=c.sort((m,b)=>b.incoming-m.incoming||Va(m.section,b.section))[0];r.unshift(p.section),i.delete(p.section.id);continue}const h=I.sort((p,m)=>m.outgoing-m.incoming-(p.outgoing-p.incoming)||m.outgoing+m.incoming-(p.outgoing+p.incoming)||Va(p.section,m.section))[0];o.push(h.section),i.delete(h.section.id)}return[...o,...r]}function PJ(n,e){const t=new Map,i=new Map;for(const o of e){if(o.sourceSection===o.targetSection||!n.has(o.sourceSection)||!n.has(o.targetSection))continue;const r=1+Math.log10(o.calls+1);i.set(o.sourceSection,(i.get(o.sourceSection)??0)+r),t.set(o.targetSection,(t.get(o.targetSection)??0)+r)}return{incoming:t,outgoing:i}}function qx(n){const e=Math.min(6,Math.max(2,Math.ceil(Math.sqrt(n.length)))),t=Array.from({length:e},()=>[]);return[...n].sort(Va).forEach((i,o)=>{t[Math.floor(o*e/n.length)].push(i)}),t}function LJ(n,e){const t=new Map;for(const i of e)Jx(t,i.sourceSection,i.targetSection,i.calls),Jx(t,i.targetSection,i.sourceSection,i.calls);for(let i=0;i<8;i+=1)for(const o of[1,-1]){const r=o===1?1:n.length-2,A=o===1?n.length:-1;for(let I=r;I!==A;I+=o){const l=new Map,c=o===1?n.slice(0,I):n.slice(I+1);for(const p of c)p.forEach((m,b)=>{l.set(m.id,p.length===1?.5:b/(p.length-1))});const h=new Map(n[I].map((p,m,b)=>[p.id,b.length===1?.5:m/(b.length-1)]));n[I].sort((p,m)=>{const b=e2(p.id,t,l),w=e2(m.id,t,l);return(b??h.get(p.id)??.5)-(w??h.get(m.id)??.5)||Va(p,m)})}}}function Jx(n,e,t,i){const o=n.get(e)??new Map;o.set(t,(o.get(t)??0)+i),n.set(e,o)}function e2(n,e,t){let i=0,o=0;for(const[r,A]of e.get(n)??[]){const I=t.get(r);I!==void 0&&(i+=I*A,o+=A)}return o>0?i/o:void 0}function GJ(n,e,t,i,o,r,A){const I=n.y+r,l=e.y+A;if(t==="forward"){const w=n.x+n.width/2,S=e.x-e.width/2,x=Math.max(1,S-w),O=Yu(x*.42,42,168),E=HJ(i%9,1.5);return[`M ${w} ${I}`,`C ${w+O} ${I+E}`,`${S-O} ${l+E}`,`${S} ${l}`].join(" ")}if(t==="backward"){const w=n.x-n.width/2,S=e.x+e.width/2,x=(I+l)/2{const I=e.get(r.sourceSection),l=e.get(A.sourceSection),c=e.get(r.targetSection),h=e.get(A.targetSection);return(I?.column??0)-(l?.column??0)||(c?.column??0)-(h?.column??0)||(I?.y??0)-(l?.y??0)||(c?.y??0)-(h?.y??0)||A.calls-r.calls||r.id.localeCompare(A.id)});for(const r of o){const A=e.get(r.sourceSection),I=e.get(r.targetSection);if(!A||!I)continue;const l=n2(A,I),c=`${Math.min(A.column,I.column)}:${Math.max(A.column,I.column)}:${l}`,h=i.get(c)??0;t.set(r.id,h),i.set(c,h+1)}return t}function t2(n,e,t){const i=new Map;for(const r of n){const A=t==="source"?r.sourceSection:r.targetSection,I=i.get(A)??[];I.push(r),i.set(A,I)}const o=new Map;for(const r of i.values()){r.sort((I,l)=>{const c=e.get(t==="source"?I.targetSection:I.sourceSection),h=e.get(t==="source"?l.targetSection:l.sourceSection);return(c?.y??0)-(h?.y??0)||(c?.x??0)-(h?.x??0)||I.id.localeCompare(l.id)});const A=Math.min(8,38/Math.max(1,r.length-1));r.forEach((I,l)=>{o.set(I.id,(l-(r.length-1)/2)*A)})}return o}function VJ(n,e,t,i,o){const r=Math.sign(i-e)||1,A=Math.sign(o-t)||1,I=Math.min(12,Math.abs(i-e)/2,Math.abs(t-n)/2);return[`M ${n} ${e}`,`H ${t-Math.sign(t-n)*I}`,`Q ${t} ${e} ${t} ${e+r*I}`,`V ${i-r*I}`,`Q ${t} ${i} ${t+A*I} ${i}`,`H ${o}`].join(" ")}function n2(n,e){return e.column>n.column?"forward":e.columng2(i)),A=Z.useRef(o),[I,l]=Z.useState(1),[c,h]=Z.useState("none"),p=Z.useRef("none"),m=Z.useRef(0),[b,w]=Z.useState(WJ),[S,x]=Z.useState("key"),[O,E]=Z.useState(),R=Z.useRef(null),B=Z.useRef(void 0),W=Z.useRef(void 0);Z.useEffect(()=>{const z=g2(i);A.current=z,r(z),l(1),p.current="start",m.current=0,h("start"),R.current?.scrollTo?.({left:0,top:0}),x("key")},[i]);const ne=Z.useMemo(()=>$J(n.routes,e),[n.routes,e]),L=Z.useMemo(()=>S==="complete"?{routes:n.routes,reciprocals:new Map}:qJ(n.routes.filter(z=>ne.has(z.id)),e?.kind==="route"?e.id:void 0),[ne,n.routes,S,e]),G=L.routes,Ie=Z.useMemo(()=>{if(S==="complete"||e===void 0)return n.sections;const z=new Set;e.kind==="section"&&z.add(e.id);for(const ve of G)z.add(ve.sourceSection),z.add(ve.targetSection);return n.sections.filter(ve=>z.has(ve.id))},[n.sections,S,G,e]),fe=Z.useMemo(()=>jJ(Ie,G,b,o,S==="key"&&e?.kind==="section"?e.id:void 0),[Ie,o,S,G,e,b]),Be=fe.routes,Te=Z.useMemo(()=>e?.kind!=="section"?new Set:new Set(Be.filter(z=>z.sourceSection===e.id||z.targetSection===e.id).flatMap(z=>[z.id,z.sourceSection,z.targetSection])),[Be,e]),He=Math.max(1,...Be.map(z=>z.calls)),Ve=n.routes.length-Be.length,Ce={width:Math.round(fe.width*I),height:Math.round(fe.height*I)},M=z=>{t(z)},Q=(z,ve)=>{(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),M(ve))},K=(z,ve)=>{const xe={...A.current,[z]:ve};A.current=xe,r(xe)},ie=()=>{try{window.localStorage.setItem(i,JSON.stringify(A.current))}catch{}},ee=()=>{A.current={},r({});try{window.localStorage.removeItem(i)}catch{}},T=()=>{l(1),p.current="start",m.current=0,h("start");const z=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;R.current?.scrollTo?.({left:0,top:0,behavior:z?"auto":"smooth"})},F=z=>{const ve=Math.max(0,z.scrollWidth-z.clientWidth),xe=ve<=1?"none":z.scrollLeft<=1?"start":z.scrollLeft>=ve-1?"end":"middle";m.current=ve,p.current=xe,h(ze=>ze===xe?ze:xe)},te=z=>{F(z.currentTarget)},re=z=>{z.target!==z.currentTarget||!R.current||(B.current={x:z.clientX,y:z.clientY,scrollLeft:R.current.scrollLeft,scrollTop:R.current.scrollTop,pointerId:z.pointerId},z.currentTarget.setPointerCapture(z.pointerId))},le=z=>{const ve=B.current,xe=R.current;!ve||!xe||ve.pointerId!==z.pointerId||(xe.scrollLeft=ve.scrollLeft-(z.clientX-ve.x),xe.scrollTop=ve.scrollTop-(z.clientY-ve.y))},pe=z=>{B.current?.pointerId===z.pointerId&&(B.current=void 0,z.currentTarget.hasPointerCapture(z.pointerId)&&z.currentTarget.releasePointerCapture(z.pointerId))},Pe=(z,ve)=>{z.stopPropagation();const xe=i2(z.currentTarget.ownerSVGElement,z);xe&&(W.current={id:ve.id,pointerId:z.pointerId,offsetX:xe.x-ve.x,offsetY:xe.y-ve.y,startClientX:z.clientX,startClientY:z.clientY,moved:!1},E(ve.id),z.currentTarget.setPointerCapture(z.pointerId))},dt=(z,ve)=>{const xe=W.current;!xe||xe.id!==ve.id||xe.pointerId!==z.pointerId||(z.currentTarget.hasPointerCapture(z.pointerId)&&z.currentTarget.releasePointerCapture(z.pointerId),W.current=void 0,E(void 0),xe.moved?ie():M({kind:"section",id:ve.id}))},Re=z=>{W.current?.pointerId===z.pointerId&&(W.current=void 0,E(void 0))},en=(z,ve)=>{if(z.key==="Enter"||z.key===" "){z.preventDefault(),M({kind:"section",id:ve.id});return}if(!z.altKey||!z.key.startsWith("Arrow"))return;z.preventDefault();const xe=z.shiftKey?24:8;K(ve.id,{x:ve.x+(z.key==="ArrowRight"?xe:z.key==="ArrowLeft"?-xe:0),y:ve.y+(z.key==="ArrowDown"?xe:z.key==="ArrowUp"?-xe:0)}),ie()};return Z.useEffect(()=>{const z=R.current;if(!z)return;const ve=()=>{const ze=m.current,Bt=Math.max(0,z.scrollWidth-z.clientWidth),Ht=ze>1&&z.scrollLeft>=ze-1;if(Bt>ze&&(p.current==="end"||Ht)&&(z.scrollLeft=Bt),F(z),z.clientWidth<=0||z.clientHeight<=0)return;const fn={width:Math.round(z.clientWidth),height:Math.round(z.clientHeight)};w(se=>se.width===fn.width&&se.height===fn.height?se:fn)};if(ve(),typeof ResizeObserver>"u")return;const xe=new ResizeObserver(ve);return xe.observe(z),()=>xe.disconnect()},[Ce.height,Ce.width]),f.jsxs("section",{className:"architecture-map-panel","aria-labelledby":"architecture-map-title","data-route-mode":S,children:[f.jsxs("header",{className:"architecture-map-header",children:[f.jsxs("div",{className:"architecture-map-intro",children:[f.jsx("span",{children:"Flow canvas"}),f.jsx("strong",{id:"architecture-map-title",children:"Subsystem call direction"}),f.jsx("small",{id:"architecture-map-help",children:"Scroll sideways or drag open canvas space to follow the complete architecture."})]}),f.jsxs("div",{className:"architecture-map-actions",children:[f.jsxs("div",{className:"architecture-route-mode",role:"group","aria-label":"Route visibility",children:[f.jsx("button",{type:"button","aria-pressed":S==="key",onClick:()=>x("key"),children:e?.kind==="section"?"Neighbors":"Key routes"}),f.jsxs("button",{type:"button","aria-pressed":S==="complete",onClick:()=>x("complete"),children:["All routes · ",n.routes.length]})]}),f.jsxs("div",{className:"architecture-map-toolbar","aria-label":"Map controls",children:[f.jsx("button",{type:"button","aria-label":"Zoom out",onClick:()=>l(z=>Math.max(.75,z-.25)),children:f.jsx(s3,{"aria-hidden":"true"})}),f.jsxs("span",{"aria-live":"polite",children:[Math.round(I*100),"%"]}),f.jsx("button",{type:"button","aria-label":"Zoom in",onClick:()=>l(z=>Math.min(2,z+.25)),children:f.jsx(Qm,{"aria-hidden":"true"})}),f.jsx("button",{type:"button","aria-label":"Reset zoom and scroll position",title:"Reset zoom and scroll position",onClick:T,children:f.jsx(Hm,{"aria-hidden":"true"})}),f.jsx("button",{type:"button","aria-label":"Reset subsystem positions",title:"Reset subsystem positions",disabled:Object.keys(o).length===0,onClick:ee,children:f.jsx(Xm,{"aria-hidden":"true"})})]})]})]}),f.jsx("div",{ref:R,className:"architecture-map-viewport",role:"region","aria-label":"Scrollable architecture flow diagram","aria-describedby":"architecture-map-help",tabIndex:0,"data-scroll-position":c,onScroll:te,children:fe.nodes.length>0?f.jsx("div",{className:"architecture-map-canvas",style:{width:Ce.width,height:Ce.height},children:f.jsxs("svg",{className:"architecture-map",viewBox:`0 0 ${fe.width} ${fe.height}`,role:"group","aria-label":eee(fe.nodes.length,Be.length,n.routes.length),onPointerDown:re,onPointerMove:le,onPointerUp:pe,onPointerCancel:()=>{B.current=void 0},children:[f.jsxs("defs",{children:[f.jsx("marker",{id:"architecture-arrow",className:"architecture-arrow architecture-arrow-default",markerWidth:"8",markerHeight:"8",refX:"7",refY:"4",orient:"auto-start-reverse",markerUnits:"userSpaceOnUse",children:f.jsx("path",{d:"M 0 0 L 8 4 L 0 8 z"})}),f.jsx("marker",{id:"architecture-arrow-incoming",className:"architecture-arrow architecture-arrow-incoming",markerWidth:"8",markerHeight:"8",refX:"7",refY:"4",orient:"auto-start-reverse",markerUnits:"userSpaceOnUse",children:f.jsx("path",{d:"M 0 0 L 8 4 L 0 8 z"})}),f.jsx("marker",{id:"architecture-arrow-outgoing",className:"architecture-arrow architecture-arrow-outgoing",markerWidth:"8",markerHeight:"8",refX:"7",refY:"4",orient:"auto-start-reverse",markerUnits:"userSpaceOnUse",children:f.jsx("path",{d:"M 0 0 L 8 4 L 0 8 z"})})]}),f.jsxs("g",{className:"architecture-map-lanes","aria-hidden":"true",children:[fe.lanes.map(z=>f.jsxs("g",{children:[f.jsx("rect",{x:z.x+8,y:34,width:z.width-16,height:fe.height-76,rx:"12"}),f.jsx("text",{x:z.x+z.width/2,y:61,children:z.label})]},z.index)),f.jsx("text",{className:"architecture-map-direction",x:96,y:24,children:"PRIMARY CALL DIRECTION →"})]}),f.jsx("g",{className:"architecture-routes",children:Be.map(z=>{const ve=L.reciprocals.get(z.id),xe=e?.kind==="route"&&e.id===z.id,ze=xe||e===void 0||e.kind==="section"&&Te.has(z.id),Bt=z.inferred>z.extracted?"inferred":"extracted",Ht=e?.kind==="section"?z.targetSection===e.id?"incoming":z.sourceSection===e.id?"outgoing":void 0:void 0,fn=S==="key"?.3+Math.sqrt(z.calls/He)*.28:.1+Math.sqrt(z.calls/He)*.2;return f.jsxs("g",{role:"button",tabIndex:0,"aria-label":`${z.sourceSection} to ${z.targetSection}, ${z.calls} calls${ve?`; bidirectional, ${ve.calls} reverse calls`:""}${z.direction==="backward"?", feedback route":""}`,"data-direction":z.direction,"data-evidence":Bt,"data-reciprocal":ve?"true":void 0,"data-focus-direction":Ht,"data-selected":xe||void 0,"data-dimmed":!ze||void 0,onClick:()=>M({kind:"route",id:z.id}),onKeyDown:se=>Q(se,{kind:"route",id:z.id}),children:[f.jsx("path",{className:"architecture-route-hit",d:z.path}),f.jsx("path",{className:"architecture-route-line",d:z.path,style:{strokeWidth:z.width,"--architecture-route-opacity":fn},markerStart:ve?JJ(Ht):void 0,markerEnd:Ht==="incoming"?"url(#architecture-arrow-incoming)":Ht==="outgoing"?"url(#architecture-arrow-outgoing)":"url(#architecture-arrow)"}),f.jsxs("title",{children:[z.sourceSection," → ",z.targetSection,": ",z.calls," calls",ve&&` · ${ve.sourceSection} → ${ve.targetSection}: ${ve.calls} calls`]})]},z.id)})}),f.jsx("g",{className:"architecture-map-nodes",children:fe.nodes.map(z=>{const ve=e?.kind==="section"&&e.id===z.id,xe=ve||e===void 0||e.kind==="section"&&Te.has(z.id)||e.kind==="route"&&n.routes.some(ze=>ze.id===e.id&&(ze.sourceSection===z.id||ze.targetSection===z.id));return f.jsxs("g",{role:"button",tabIndex:0,"aria-label":`${z.name}, ${z.nodeCount} visible symbols, ${z.incomingCalls} incoming and ${z.outgoingCalls} outgoing calls; drag to reposition`,transform:`translate(${z.x-z.width/2} ${z.y-z.height/2})`,"data-selected":ve||void 0,"data-dimmed":!xe||void 0,"data-dragging":O===z.id||void 0,onPointerDown:ze=>Pe(ze,z),onPointerMove:ze=>{const Bt=W.current;if(!Bt||Bt.id!==z.id||Bt.pointerId!==ze.pointerId)return;const Ht=i2(ze.currentTarget.ownerSVGElement,ze);Ht&&((Math.abs(ze.clientX-Bt.startClientX)>3||Math.abs(ze.clientY-Bt.startClientY)>3)&&(Bt.moved=!0),K(z.id,{x:Ht.x-Bt.offsetX,y:Ht.y-Bt.offsetY}))},onPointerUp:ze=>dt(ze,z),onPointerCancel:ze=>Re(ze),onKeyDown:ze=>en(ze,z),children:[f.jsx("rect",{className:"architecture-map-node-shadow",width:z.width,height:z.height,rx:"9"}),f.jsx("rect",{className:"architecture-map-node-card",width:z.width,height:z.height,rx:"9"}),f.jsx("rect",{className:"architecture-map-node-accent",width:"4",height:z.height-16,x:"8",y:"8",rx:"2"}),f.jsx("text",{x:"20",y:"27",className:"architecture-map-node-name",children:XJ(z.name,24)}),f.jsxs("text",{x:"20",y:"48",className:"architecture-map-node-meta",children:[z.nodeCount.toLocaleString()," symbols"," · ","↓",z.incomingCalls.toLocaleString()," ↑",z.outgoingCalls.toLocaleString()]}),f.jsxs("g",{className:"architecture-map-node-grip","aria-hidden":"true",children:[f.jsx("circle",{cx:z.width-18,cy:"26",r:"1.2"}),f.jsx("circle",{cx:z.width-13,cy:"26",r:"1.2"}),f.jsx("circle",{cx:z.width-18,cy:"31",r:"1.2"}),f.jsx("circle",{cx:z.width-13,cy:"31",r:"1.2"}),f.jsx("circle",{cx:z.width-18,cy:"36",r:"1.2"}),f.jsx("circle",{cx:z.width-13,cy:"36",r:"1.2"})]}),f.jsxs("title",{children:[z.name," — drag to reposition"]})]},z.id)})})]})}):f.jsxs("div",{className:"architecture-map-empty",children:[f.jsx("strong",{children:"No architecture to draw"}),f.jsx("span",{children:"No subsystems match the current scope and evidence filters."})]})}),f.jsxs("footer",{className:"architecture-map-footer",children:[f.jsxs("div",{className:"architecture-map-legend","aria-label":"Map legend",children:[f.jsxs("span",{children:[f.jsx("i",{"data-evidence":"extracted"})," Extracted"]}),f.jsxs("span",{children:[f.jsx("i",{"data-evidence":"inferred"})," Inferred"]}),f.jsxs("span",{children:[f.jsx("i",{"data-direction":"incoming"})," Incoming"]}),f.jsxs("span",{children:[f.jsx("i",{"data-direction":"outgoing"})," Outgoing"]}),f.jsxs("span",{children:[f.jsx("i",{"data-direction":"bidirectional","aria-hidden":"true",children:"↔"})," Bidirectional"]}),f.jsxs("span",{children:[f.jsx("i",{"data-direction":"feedback"})," Feedback"]}),f.jsxs("span",{children:[f.jsx(r3,{"aria-hidden":"true"})," Drag cards to arrange"]}),Ve>0&&f.jsxs("button",{type:"button",onClick:()=>x("complete"),children:[Be.length," of ",n.routes.length," routes · Show all"]})]}),f.jsxs("details",{className:"architecture-map-table",children:[f.jsx("summary",{children:"View routes as a table"}),f.jsx("div",{children:f.jsxs("table",{children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:"From"}),f.jsx("th",{children:"To"}),f.jsx("th",{children:"Calls"}),f.jsx("th",{children:"Evidence"})]})}),f.jsx("tbody",{children:n.routes.map(z=>f.jsxs("tr",{children:[f.jsx("td",{children:o2(n,z.sourceSection)}),f.jsx("td",{children:o2(n,z.targetSection)}),f.jsx("td",{children:z.calls.toLocaleString()}),f.jsxs("td",{children:[z.extracted," extracted · ",z.inferred," inferred"]})]},z.id))})]})})]})]})]})}function i2(n,e){if(!n)return;const t=n.getScreenCTM();if(!t)return;const i=n.createSVGPoint();i.x=e.clientX,i.y=e.clientY;const o=i.matrixTransform(t.inverse());return{x:o.x,y:o.y}}function g2(n){try{const e=JSON.parse(window.localStorage.getItem(n)??"{}");return!e||typeof e!="object"||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).flatMap(([t,i])=>i&&typeof i=="object"&&"x"in i&&"y"in i&&typeof i.x=="number"&&typeof i.y=="number"&&Number.isFinite(i.x)&&Number.isFinite(i.y)?[[t,{x:i.x,y:i.y}]]:[]))}catch{return{}}}function o2(n,e){return n.sections.find(t=>t.id===e)?.name??e}function XJ(n,e){return n.length<=e?n:`${n.slice(0,e-1)}…`}function $J(n,e){const t=o=>[...o].sort((r,A)=>A.calls-r.calls||r.id.localeCompare(A.id)),i=new Set;if(e?.kind==="route"){const o=n.find(r=>r.id===e.id);if(o){i.add(o.id);const r=n.find(A=>A.sourceSection===o.targetSection&&A.targetSection===o.sourceSection);r&&i.add(r.id)}return i}else if(e?.kind==="section"){const o=t(n.filter(A=>A.targetSection===e.id)).slice(0,6),r=t(n.filter(A=>A.sourceSection===e.id)).slice(0,6);for(const A of t([...o,...r]))i.add(A.id);return i}for(const o of t(n)){if(i.size>=KJ)break;i.add(o.id)}return i}function qJ(n,e){const t=new Map(n.map(A=>[s2(A.sourceSection,A.targetSection),A])),i=new Set,o=[],r=new Map;for(const A of n){if(i.has(A.id))continue;const I=t.get(s2(A.targetSection,A.sourceSection));if(!I||I.id===A.id||i.has(I.id)){o.push(A),i.add(A.id);continue}const l=A.id===e?A:I.id===e?I:A.calls>I.calls||A.calls===I.calls&&A.id.localeCompare(I.id)<=0?A:I,c=l.id===A.id?I:A;o.push(l),r.set(l.id,c),i.add(A.id),i.add(I.id)}return o.sort((A,I)=>I.calls-A.calls||A.id.localeCompare(I.id)),{routes:o,reciprocals:r}}function s2(n,e){return`${n}\0${e}`}function JJ(n){return n==="incoming"?"url(#architecture-arrow-outgoing)":n==="outgoing"?"url(#architecture-arrow-incoming)":"url(#architecture-arrow)"}function eee(n,e,t){return e===t?`${n} subsystems and ${t} directed routes`:`${n} subsystems and ${e} of ${t} directed routes visible`}function r2(n){var e,t,i="";if(typeof n=="string"||typeof n=="number")i+=n;else if(typeof n=="object")if(Array.isArray(n)){var o=n.length;for(e=0;etypeof n=="boolean"?`${n}`:n===0?"0":n,C2=a2,Hu=(n,e)=>t=>{var i;if(e?.variants==null)return C2(n,t?.class,t?.className);const{variants:o,defaultVariants:r}=e,A=Object.keys(o).map(c=>{const h=t?.[c],p=r?.[c];if(h===null)return null;const m=A2(h)||A2(p);return o[c][m]}),I=t&&Object.entries(t).reduce((c,h)=>{let[p,m]=h;return m===void 0||(c[p]=m),c},{}),l=e==null||(i=e.compoundVariants)===null||i===void 0?void 0:i.reduce((c,h)=>{let{class:p,className:m,...b}=h;return Object.entries(b).every(w=>{let[S,x]=w;return Array.isArray(x)?x.includes({...r,...I}[S]):{...r,...I}[S]===x})?[...c,p,m]:c},[]);return C2(n,A,l,t?.class,t?.className)},tee=(n,e)=>{const t=new Array(n.length+e.length);for(let i=0;i({classGroupId:n,validator:e}),I2=(n=new Map,e=null,t)=>({nextPart:n,validators:e,classGroupId:t}),fI="-",l2=[],iee="arbitrary..",gee=n=>{const e=see(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:i}=n;return{getClassGroupId:A=>{if(A.startsWith("[")&&A.endsWith("]"))return oee(A);const I=A.split(fI),l=I[0]===""&&I.length>1?1:0;return c2(I,l,e)},getConflictingClassGroupIds:(A,I)=>{if(I){const l=i[A],c=t[A];return l?c?tee(c,l):l:c||l2}return t[A]||l2}}},c2=(n,e,t)=>{if(n.length-e===0)return t.classGroupId;const o=n[e],r=t.nextPart.get(o);if(r){const c=c2(n,e+1,r);if(c)return c}const A=t.validators;if(A===null)return;const I=e===0?n.join(fI):n.slice(e).join(fI),l=A.length;for(let c=0;cn.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=n.slice(1,-1),t=e.indexOf(":"),i=e.slice(0,t);return i?iee+i:void 0})(),see=n=>{const{theme:e,classGroups:t}=n;return ree(t,e)},ree=(n,e)=>{const t=I2();for(const i in n){const o=n[i];Ku(o,t,i,e)}return t},Ku=(n,e,t,i)=>{const o=n.length;for(let r=0;r{if(typeof n=="string"){Aee(n,e,t);return}if(typeof n=="function"){Cee(n,e,t,i);return}Iee(n,e,t,i)},Aee=(n,e,t)=>{const i=n===""?e:d2(e,n);i.classGroupId=t},Cee=(n,e,t,i)=>{if(lee(n)){Ku(n(i),e,t,i);return}e.validators===null&&(e.validators=[]),e.validators.push(nee(t,n))},Iee=(n,e,t,i)=>{const o=Object.entries(n),r=o.length;for(let A=0;A{let t=n;const i=e.split(fI),o=i.length;for(let r=0;r"isThemeGetter"in n&&n.isThemeGetter===!0,cee=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=Object.create(null),i=Object.create(null);const o=(r,A)=>{t[r]=A,e++,e>n&&(e=0,i=t,t=Object.create(null))};return{get(r){let A=t[r];if(A!==void 0)return A;if((A=i[r])!==void 0)return o(r,A),A},set(r,A){r in t?t[r]=A:o(r,A)}}},Wu="!",u2=":",dee=[],h2=(n,e,t,i,o)=>({modifiers:n,hasImportantModifier:e,baseClassName:t,maybePostfixModifierPosition:i,isExternal:o}),uee=n=>{const{prefix:e,experimentalParseClassName:t}=n;let i=o=>{const r=[];let A=0,I=0,l=0,c;const h=o.length;for(let S=0;Sl?c-l:void 0;return h2(r,b,m,w)};if(e){const o=e+u2,r=i;i=A=>A.startsWith(o)?r(A.slice(o.length)):h2(dee,!1,A,void 0,!0)}if(t){const o=i;i=r=>t({className:r,parseClassName:o})}return i},hee=n=>{const e=new Map;return n.orderSensitiveModifiers.forEach((t,i)=>{e.set(t,1e6+i)}),t=>{const i=[];let o=[];for(let r=0;r0&&(o.sort(),i.push(...o),o=[]),i.push(A)):o.push(A)}return o.length>0&&(o.sort(),i.push(...o)),i}},fee=n=>({cache:cee(n.cacheSize),parseClassName:uee(n),sortModifiers:hee(n),postfixLookupClassGroupIds:pee(n),...gee(n)}),pee=n=>{const e=Object.create(null),t=n.postfixLookupClassGroups;if(t)for(let i=0;i{const{parseClassName:t,getClassGroupId:i,getConflictingClassGroupIds:o,sortModifiers:r,postfixLookupClassGroupIds:A}=e,I=[],l=n.trim().split(mee);let c="";for(let h=l.length-1;h>=0;h-=1){const p=l[h],{isExternal:m,modifiers:b,hasImportantModifier:w,baseClassName:S,maybePostfixModifierPosition:x}=t(p);if(m){c=p+(c.length>0?" "+c:c);continue}let O=!!x,E;if(O){const L=S.substring(0,x);E=i(L);const G=E&&A[E]?i(S):void 0;G&&G!==E&&(E=G,O=!1)}else E=i(S);if(!E){if(!O){c=p+(c.length>0?" "+c:c);continue}if(E=i(S),!E){c=p+(c.length>0?" "+c:c);continue}O=!1}const R=b.length===0?"":b.length===1?b[0]:r(b).join(":"),B=w?R+Wu:R,W=B+E;if(I.indexOf(W)>-1)continue;I.push(W);const ne=o(E,O);for(let L=0;L0?" "+c:c)}return c},bee=(...n)=>{let e=0,t,i,o="";for(;e{if(typeof n=="string")return n;let e,t="";for(let i=0;i{let t,i,o,r;const A=l=>{const c=e.reduce((h,p)=>p(h),n());return t=fee(c),i=t.cache.get,o=t.cache.set,r=I,I(l)},I=l=>{const c=i(l);if(c)return c;const h=vee(l,t);return o(l,h),h};return r=A,(...l)=>r(bee(...l))},wee=[],an=n=>{const e=t=>t[n]||wee;return e.isThemeGetter=!0,e},p2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,m2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,xee=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,See=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Eee=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Tee=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Oee=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Nee=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vg=n=>xee.test(n),Ye=n=>!!n&&!Number.isNaN(Number(n)),Fi=n=>!!n&&Number.isInteger(Number(n)),Qu=n=>n.endsWith("%")&&Ye(n.slice(0,-1)),og=n=>See.test(n),v2=()=>!0,Dee=n=>Eee.test(n)&&!Tee.test(n),Xu=()=>!1,Mee=n=>Oee.test(n),zee=n=>Nee.test(n),kee=n=>!ce(n)&&!de(n),Ree=n=>n.startsWith("@container")&&(n[10]==="/"&&n[11]!==void 0||n[11]==="s"&&n[16]!==void 0&&n.startsWith("-size/",10)||n[11]==="n"&&n[18]!==void 0&&n.startsWith("-normal/",10)),_ee=n=>Ug(n,E2,Xu),ce=n=>p2.test(n),Lo=n=>Ug(n,T2,Dee),b2=n=>Ug(n,Vee,Ye),jee=n=>Ug(n,N2,v2),Zee=n=>Ug(n,O2,Xu),y2=n=>Ug(n,x2,Xu),Bee=n=>Ug(n,S2,zee),pI=n=>Ug(n,D2,Mee),de=n=>m2.test(n),Ua=n=>Go(n,T2),Pee=n=>Go(n,O2),w2=n=>Go(n,x2),Lee=n=>Go(n,E2),Gee=n=>Go(n,S2),mI=n=>Go(n,D2,!0),Fee=n=>Go(n,N2,!0),Ug=(n,e,t)=>{const i=p2.exec(n);return i?i[1]?e(i[1]):t(i[2]):!1},Go=(n,e,t=!1)=>{const i=m2.exec(n);return i?i[1]?e(i[1]):t:!1},x2=n=>n==="position"||n==="percentage",S2=n=>n==="image"||n==="url",E2=n=>n==="length"||n==="size"||n==="bg-size",T2=n=>n==="length",Vee=n=>n==="number",O2=n=>n==="family-name",N2=n=>n==="number"||n==="weight",D2=n=>n==="shadow",Uee=yee(()=>{const n=an("color"),e=an("font"),t=an("text"),i=an("font-weight"),o=an("tracking"),r=an("leading"),A=an("breakpoint"),I=an("container"),l=an("spacing"),c=an("radius"),h=an("shadow"),p=an("inset-shadow"),m=an("text-shadow"),b=an("drop-shadow"),w=an("blur"),S=an("perspective"),x=an("aspect"),O=an("ease"),E=an("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],W=()=>[...B(),de,ce],ne=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],G=()=>[de,ce,l],Ie=()=>[Vg,"full","auto",...G()],fe=()=>[Fi,"none","subgrid",de,ce],Be=()=>["auto",{span:["full",Fi,de,ce]},Fi,de,ce],Te=()=>[Fi,"auto",de,ce],He=()=>["auto","min","max","fr",de,ce],Ve=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Ce=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...G()],Q=()=>[Vg,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...G()],K=()=>[Vg,"screen","full","dvw","lvw","svw","min","max","fit",...G()],ie=()=>[Vg,"screen","full","lh","dvh","lvh","svh","min","max","fit",...G()],ee=()=>[n,de,ce],T=()=>[...B(),w2,y2,{position:[de,ce]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],te=()=>["auto","cover","contain",Lee,_ee,{size:[de,ce]}],re=()=>[Qu,Ua,Lo],le=()=>["","none","full",c,de,ce],pe=()=>["",Ye,Ua,Lo],Pe=()=>["solid","dashed","dotted","double"],dt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Re=()=>[Ye,Qu,w2,y2],en=()=>["","none",w,de,ce],z=()=>["none",Ye,de,ce],ve=()=>["none",Ye,de,ce],xe=()=>[Ye,de,ce],ze=()=>[Vg,"full",...G()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[og],breakpoint:[og],color:[v2],container:[og],"drop-shadow":[og],ease:["in","out","in-out"],font:[kee],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[og],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[og],shadow:[og],spacing:["px",Ye],text:[og],"text-shadow":[og],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Vg,ce,de,x]}],container:["container"],"container-type":[{"@container":["","normal","size",de,ce]}],"container-named":[Ree],columns:[{columns:[Ye,ce,de,I]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:W()}],overflow:[{overflow:ne()}],"overflow-x":[{"overflow-x":ne()}],"overflow-y":[{"overflow-y":ne()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Ie()}],"inset-x":[{"inset-x":Ie()}],"inset-y":[{"inset-y":Ie()}],start:[{"inset-s":Ie(),start:Ie()}],end:[{"inset-e":Ie(),end:Ie()}],"inset-bs":[{"inset-bs":Ie()}],"inset-be":[{"inset-be":Ie()}],top:[{top:Ie()}],right:[{right:Ie()}],bottom:[{bottom:Ie()}],left:[{left:Ie()}],visibility:["visible","invisible","collapse"],z:[{z:[Fi,"auto",de,ce]}],basis:[{basis:[Vg,"full","auto",I,...G()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ye,Vg,"auto","initial","none",ce]}],grow:[{grow:["",Ye,de,ce]}],shrink:[{shrink:["",Ye,de,ce]}],order:[{order:[Fi,"first","last","none",de,ce]}],"grid-cols":[{"grid-cols":fe()}],"col-start-end":[{col:Be()}],"col-start":[{"col-start":Te()}],"col-end":[{"col-end":Te()}],"grid-rows":[{"grid-rows":fe()}],"row-start-end":[{row:Be()}],"row-start":[{"row-start":Te()}],"row-end":[{"row-end":Te()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":He()}],"auto-rows":[{"auto-rows":He()}],gap:[{gap:G()}],"gap-x":[{"gap-x":G()}],"gap-y":[{"gap-y":G()}],"justify-content":[{justify:[...Ve(),"normal"]}],"justify-items":[{"justify-items":[...Ce(),"normal"]}],"justify-self":[{"justify-self":["auto",...Ce()]}],"align-content":[{content:["normal",...Ve()]}],"align-items":[{items:[...Ce(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Ce(),{baseline:["","last"]}]}],"place-content":[{"place-content":Ve()}],"place-items":[{"place-items":[...Ce(),"baseline"]}],"place-self":[{"place-self":["auto",...Ce()]}],p:[{p:G()}],px:[{px:G()}],py:[{py:G()}],ps:[{ps:G()}],pe:[{pe:G()}],pbs:[{pbs:G()}],pbe:[{pbe:G()}],pt:[{pt:G()}],pr:[{pr:G()}],pb:[{pb:G()}],pl:[{pl:G()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":G()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":G()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],"inline-size":[{inline:["auto",...K()]}],"min-inline-size":[{"min-inline":["auto",...K()]}],"max-inline-size":[{"max-inline":["none",...K()]}],"block-size":[{block:["auto",...ie()]}],"min-block-size":[{"min-block":["auto",...ie()]}],"max-block-size":[{"max-block":["none",...ie()]}],w:[{w:[I,"screen",...Q()]}],"min-w":[{"min-w":[I,"screen","none",...Q()]}],"max-w":[{"max-w":[I,"screen","none","prose",{screen:[A]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh",...Q()]}],"font-size":[{text:["base",t,Ua,Lo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,Fee,jee]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Qu,ce]}],"font-family":[{font:[Pee,Zee,e]}],"font-features":[{"font-features":[ce]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,de,ce]}],"line-clamp":[{"line-clamp":[Ye,"none",de,b2]}],leading:[{leading:[r,...G()]}],"list-image":[{"list-image":["none",de,ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",de,ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ee()}],"text-color":[{text:ee()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Pe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ye,"from-font","auto",de,Lo]}],"text-decoration-color":[{decoration:ee()}],"underline-offset":[{"underline-offset":[Ye,"auto",de,ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:G()}],"tab-size":[{tab:[Fi,de,ce]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de,ce]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",de,ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:T()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:te()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Fi,de,ce],radial:["",de,ce],conic:[Fi,de,ce]},Gee,Bee]}],"bg-color":[{bg:ee()}],"gradient-from-pos":[{from:re()}],"gradient-via-pos":[{via:re()}],"gradient-to-pos":[{to:re()}],"gradient-from":[{from:ee()}],"gradient-via":[{via:ee()}],"gradient-to":[{to:ee()}],rounded:[{rounded:le()}],"rounded-s":[{"rounded-s":le()}],"rounded-e":[{"rounded-e":le()}],"rounded-t":[{"rounded-t":le()}],"rounded-r":[{"rounded-r":le()}],"rounded-b":[{"rounded-b":le()}],"rounded-l":[{"rounded-l":le()}],"rounded-ss":[{"rounded-ss":le()}],"rounded-se":[{"rounded-se":le()}],"rounded-ee":[{"rounded-ee":le()}],"rounded-es":[{"rounded-es":le()}],"rounded-tl":[{"rounded-tl":le()}],"rounded-tr":[{"rounded-tr":le()}],"rounded-br":[{"rounded-br":le()}],"rounded-bl":[{"rounded-bl":le()}],"border-w":[{border:pe()}],"border-w-x":[{"border-x":pe()}],"border-w-y":[{"border-y":pe()}],"border-w-s":[{"border-s":pe()}],"border-w-e":[{"border-e":pe()}],"border-w-bs":[{"border-bs":pe()}],"border-w-be":[{"border-be":pe()}],"border-w-t":[{"border-t":pe()}],"border-w-r":[{"border-r":pe()}],"border-w-b":[{"border-b":pe()}],"border-w-l":[{"border-l":pe()}],"divide-x":[{"divide-x":pe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":pe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Pe(),"hidden","none"]}],"divide-style":[{divide:[...Pe(),"hidden","none"]}],"border-color":[{border:ee()}],"border-color-x":[{"border-x":ee()}],"border-color-y":[{"border-y":ee()}],"border-color-s":[{"border-s":ee()}],"border-color-e":[{"border-e":ee()}],"border-color-bs":[{"border-bs":ee()}],"border-color-be":[{"border-be":ee()}],"border-color-t":[{"border-t":ee()}],"border-color-r":[{"border-r":ee()}],"border-color-b":[{"border-b":ee()}],"border-color-l":[{"border-l":ee()}],"divide-color":[{divide:ee()}],"outline-style":[{outline:[...Pe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ye,de,ce]}],"outline-w":[{outline:["",Ye,Ua,Lo]}],"outline-color":[{outline:ee()}],shadow:[{shadow:["","none",h,mI,pI]}],"shadow-color":[{shadow:ee()}],"inset-shadow":[{"inset-shadow":["none",p,mI,pI]}],"inset-shadow-color":[{"inset-shadow":ee()}],"ring-w":[{ring:pe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ee()}],"ring-offset-w":[{"ring-offset":[Ye,Lo]}],"ring-offset-color":[{"ring-offset":ee()}],"inset-ring-w":[{"inset-ring":pe()}],"inset-ring-color":[{"inset-ring":ee()}],"text-shadow":[{"text-shadow":["none",m,mI,pI]}],"text-shadow-color":[{"text-shadow":ee()}],opacity:[{opacity:[Ye,de,ce]}],"mix-blend":[{"mix-blend":[...dt(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":dt()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ye]}],"mask-image-linear-from-pos":[{"mask-linear-from":Re()}],"mask-image-linear-to-pos":[{"mask-linear-to":Re()}],"mask-image-linear-from-color":[{"mask-linear-from":ee()}],"mask-image-linear-to-color":[{"mask-linear-to":ee()}],"mask-image-t-from-pos":[{"mask-t-from":Re()}],"mask-image-t-to-pos":[{"mask-t-to":Re()}],"mask-image-t-from-color":[{"mask-t-from":ee()}],"mask-image-t-to-color":[{"mask-t-to":ee()}],"mask-image-r-from-pos":[{"mask-r-from":Re()}],"mask-image-r-to-pos":[{"mask-r-to":Re()}],"mask-image-r-from-color":[{"mask-r-from":ee()}],"mask-image-r-to-color":[{"mask-r-to":ee()}],"mask-image-b-from-pos":[{"mask-b-from":Re()}],"mask-image-b-to-pos":[{"mask-b-to":Re()}],"mask-image-b-from-color":[{"mask-b-from":ee()}],"mask-image-b-to-color":[{"mask-b-to":ee()}],"mask-image-l-from-pos":[{"mask-l-from":Re()}],"mask-image-l-to-pos":[{"mask-l-to":Re()}],"mask-image-l-from-color":[{"mask-l-from":ee()}],"mask-image-l-to-color":[{"mask-l-to":ee()}],"mask-image-x-from-pos":[{"mask-x-from":Re()}],"mask-image-x-to-pos":[{"mask-x-to":Re()}],"mask-image-x-from-color":[{"mask-x-from":ee()}],"mask-image-x-to-color":[{"mask-x-to":ee()}],"mask-image-y-from-pos":[{"mask-y-from":Re()}],"mask-image-y-to-pos":[{"mask-y-to":Re()}],"mask-image-y-from-color":[{"mask-y-from":ee()}],"mask-image-y-to-color":[{"mask-y-to":ee()}],"mask-image-radial":[{"mask-radial":[de,ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":Re()}],"mask-image-radial-to-pos":[{"mask-radial-to":Re()}],"mask-image-radial-from-color":[{"mask-radial-from":ee()}],"mask-image-radial-to-color":[{"mask-radial-to":ee()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":B()}],"mask-image-conic-pos":[{"mask-conic":[Ye]}],"mask-image-conic-from-pos":[{"mask-conic-from":Re()}],"mask-image-conic-to-pos":[{"mask-conic-to":Re()}],"mask-image-conic-from-color":[{"mask-conic-from":ee()}],"mask-image-conic-to-color":[{"mask-conic-to":ee()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:T()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",de,ce]}],filter:[{filter:["","none",de,ce]}],blur:[{blur:en()}],brightness:[{brightness:[Ye,de,ce]}],contrast:[{contrast:[Ye,de,ce]}],"drop-shadow":[{"drop-shadow":["","none",b,mI,pI]}],"drop-shadow-color":[{"drop-shadow":ee()}],grayscale:[{grayscale:["",Ye,de,ce]}],"hue-rotate":[{"hue-rotate":[Ye,de,ce]}],invert:[{invert:["",Ye,de,ce]}],saturate:[{saturate:[Ye,de,ce]}],sepia:[{sepia:["",Ye,de,ce]}],"backdrop-filter":[{"backdrop-filter":["","none",de,ce]}],"backdrop-blur":[{"backdrop-blur":en()}],"backdrop-brightness":[{"backdrop-brightness":[Ye,de,ce]}],"backdrop-contrast":[{"backdrop-contrast":[Ye,de,ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ye,de,ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ye,de,ce]}],"backdrop-invert":[{"backdrop-invert":["",Ye,de,ce]}],"backdrop-opacity":[{"backdrop-opacity":[Ye,de,ce]}],"backdrop-saturate":[{"backdrop-saturate":[Ye,de,ce]}],"backdrop-sepia":[{"backdrop-sepia":["",Ye,de,ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":G()}],"border-spacing-x":[{"border-spacing-x":G()}],"border-spacing-y":[{"border-spacing-y":G()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",de,ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ye,"initial",de,ce]}],ease:[{ease:["linear","initial",O,de,ce]}],delay:[{delay:[Ye,de,ce]}],animate:[{animate:["none",E,de,ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,de,ce]}],"perspective-origin":[{"perspective-origin":W()}],rotate:[{rotate:z()}],"rotate-x":[{"rotate-x":z()}],"rotate-y":[{"rotate-y":z()}],"rotate-z":[{"rotate-z":z()}],scale:[{scale:ve()}],"scale-x":[{"scale-x":ve()}],"scale-y":[{"scale-y":ve()}],"scale-z":[{"scale-z":ve()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[de,ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:W()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ze()}],"translate-x":[{"translate-x":ze()}],"translate-y":[{"translate-y":ze()}],"translate-z":[{"translate-z":ze()}],"translate-none":["translate-none"],zoom:[{zoom:[Fi,de,ce]}],accent:[{accent:ee()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ee()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",de,ce]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":ee()}],"scrollbar-track-color":[{"scrollbar-track":ee()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":G()}],"scroll-mx":[{"scroll-mx":G()}],"scroll-my":[{"scroll-my":G()}],"scroll-ms":[{"scroll-ms":G()}],"scroll-me":[{"scroll-me":G()}],"scroll-mbs":[{"scroll-mbs":G()}],"scroll-mbe":[{"scroll-mbe":G()}],"scroll-mt":[{"scroll-mt":G()}],"scroll-mr":[{"scroll-mr":G()}],"scroll-mb":[{"scroll-mb":G()}],"scroll-ml":[{"scroll-ml":G()}],"scroll-p":[{"scroll-p":G()}],"scroll-px":[{"scroll-px":G()}],"scroll-py":[{"scroll-py":G()}],"scroll-ps":[{"scroll-ps":G()}],"scroll-pe":[{"scroll-pe":G()}],"scroll-pbs":[{"scroll-pbs":G()}],"scroll-pbe":[{"scroll-pbe":G()}],"scroll-pt":[{"scroll-pt":G()}],"scroll-pr":[{"scroll-pr":G()}],"scroll-pb":[{"scroll-pb":G()}],"scroll-pl":[{"scroll-pl":G()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",de,ce]}],fill:[{fill:["none",...ee()]}],"stroke-w":[{stroke:[Ye,Ua,Lo,b2]}],stroke:[{stroke:["none",...ee()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Ya(...n){return Uee(a2(n))}const Yee=Hu("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"}},defaultVariants:{variant:"default"}});function $u({className:n,variant:e,...t}){return f.jsx("div",{"data-slot":"alert",role:"alert",className:Ya(Yee({variant:e}),n),...t})}function qu({className:n,...e}){return f.jsx("div",{"data-slot":"alert-title",className:Ya("font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",n),...e})}function Ju({className:n,...e}){return f.jsx("div",{"data-slot":"alert-description",className:Ya("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",n),...e})}var Hee=Object.defineProperty,eh=(n,e)=>Hee(n,"name",{value:e,configurable:!0});function th(n,e){if(typeof n=="function")return n(e);n!=null&&(n.current=e)}eh(th,"setRef");function M2(...n){return e=>{let t=!1;const i=n.map(o=>{const r=th(o,e);return!t&&typeof r=="function"&&(t=!0),r});if(t)return()=>{for(let o=0;oKee(n,"name",{value:e,configurable:!0});function k2(n){const e=Z.forwardRef((t,i)=>{let{children:o,...r}=t,A=null,I=!1;const l=[];nh(o)&&typeof vI=="function"&&(o=vI(o._payload)),Z.Children.forEach(o,m=>{if(B2(m)){I=!0;const b=m;let w="child"in b.props?b.props.child:b.props.children;nh(w)&&typeof vI=="function"&&(w=vI(w._payload)),A=Qee(b,w),l.push(A?.props?.children)}else l.push(m)}),A?A=Z.cloneElement(A,void 0,l):!I&&Z.Children.count(o)===1&&Z.isValidElement(o)&&(A=o);const c=A?Z2(A):void 0,h=z2(i,c);if(!A){if(o||o===0)throw new Error(I?qee(n):$ee(n));return o}const p=j2(r,A.props??{});return A.type!==Z.Fragment&&(p.ref=i?h:c),Z.cloneElement(A,p)});return e.displayName=`${n}.Slot`,e}Oi(k2,"createSlot");var R2=k2("Slot"),_2=Symbol.for("radix.slottable");function Wee(n){const e=Oi(t=>"child"in t?t.children(t.child):t.children,"Slottable");return e.displayName=`${n}.Slottable`,e.__radixId=_2,e}Oi(Wee,"createSlottable");var Qee=Oi((n,e)=>{if("child"in n.props){const t=n.props.child;return Z.isValidElement(t)?Z.cloneElement(t,void 0,n.props.children(t.props.children)):null}return Z.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function j2(n,e){const t={...e};for(const i in e){const o=n[i],r=e[i];/^on[A-Z]/.test(i)?o&&r?t[i]=(...I)=>{const l=r(...I);return o(...I),l}:o&&(t[i]=o):i==="style"?t[i]={...o,...r}:i==="className"&&(t[i]=[o,r].filter(Boolean).join(" "))}return{...n,...t}}Oi(j2,"mergeProps");function Z2(n){let e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}Oi(Z2,"getElementRef");function B2(n){return Z.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===_2}Oi(B2,"isSlottable");var Xee=Symbol.for("react.lazy");function nh(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===Xee&&"_payload"in n&&P2(n._payload)}Oi(nh,"isLazyComponent");function P2(n){return typeof n=="object"&&n!==null&&"then"in n}Oi(P2,"isPromiseLike");var $ee=Oi(n=>`${n} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),qee=Oi(n=>`${n} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),vI=PR[" use ".trim().toString()];const Jee=Hu("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function Yg({className:n,variant:e="default",asChild:t=!1,...i}){const o=t?R2:"span";return f.jsx(o,{"data-slot":"badge","data-variant":e,className:Ya(Jee({variant:e}),n),...i})}const ete=Hu("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function ih({className:n,variant:e="default",size:t="default",asChild:i=!1,...o}){const r=i?R2:"button";return f.jsx(r,{"data-slot":"button","data-variant":e,"data-size":t,className:Ya(ete({variant:e,size:t,className:n})),...o})}const gh={resolved:0,inferred:1,ambiguous:2,unresolved:3};function tte({graph:n,host:e}){const t=new Map,i=nte(n);for(const r of n.edges){const A=t.get(r.target);(!A||gh[r.resolution]>gh[A])&&t.set(r.target,r.resolution)}const o={schema:"compass.viewer.graph/1",title:`Calls from ${n.nodes.find(r=>r.id===n.rootSymbol)?.name??n.rootSymbol}`,stats:{nodes:n.nodes.length,edges:n.edges.length,communities:4,aggregated:!1},nodes:n.nodes.map(r=>({id:r.id,label:r.name,kind:r.unresolved?"Unresolved call":"Function",community:gh[t.get(r.id)??"resolved"],communityName:t.get(r.id)??"resolved",depth:i.get(r.id),root:r.id===n.rootSymbol,source:ite(r)})),edges:n.edges.map(r=>({id:r.id,source:r.source,target:r.target,relation:`${r.callee} · ${r.resolution}`,confidence:r.resolution==="resolved"?"extracted":r.resolution==="inferred"?"inferred":"ambiguous"})),communities:[{id:0,label:"Resolved",color:"#59A14F",hidden:!1},{id:1,label:"Inferred",color:"#4E79A7",hidden:!1},{id:2,label:"Ambiguous",color:"#F28E2B",hidden:!1},{id:3,label:"Unresolved",color:"#E15759",hidden:!1}],hyperedges:[]};return f.jsx(Gu,{model:o,host:e,preferredLayout:"hierarchical"})}function nte(n){const e=new Map;for(const o of n.edges){const r=e.get(o.source)??[];r.push(o.target),e.set(o.source,r);const A=e.get(o.target)??[];A.push(o.source),e.set(o.target,A)}const t=new Map([[n.rootSymbol,0]]),i=[n.rootSymbol];for(;i.length>0;){const o=i.shift();if(o===void 0)break;const r=t.get(o)??0;for(const A of e.get(o)??[])t.has(A)||(t.set(A,r+1),i.push(A))}return t}function ite(n){if(n.anchor)return{file:n.anchor.source_file,startByte:n.anchor.start_byte,endByte:n.anchor.end_byte};if(n.file)return{file:n.file,...n.startLine!=null?{startLine:n.startLine}:{},...n.endLine!=null?{endLine:n.endLine}:{},...n.startByte!=null?{startByte:n.startByte}:{},...n.endByte!=null?{endByte:n.endByte}:{}}}function gte({coverage:n}){return!n.partial&&n.unresolved===0&&n.ambiguous===0?null:f.jsxs($u,{children:[f.jsx(qu,{children:"Partial call coverage"}),f.jsx(Ju,{children:n.warning})]})}function ote({graph:n,host:e}){const[t,i]=Z.useState(!1),o=t?n.continuations:n.continuations.slice(0,20),r=n.direction==="callers"?"No callers found":n.direction==="callees"?"No callees found":"No calls found";return f.jsxs("div",{className:"call-graph-view relative h-screen",children:[f.jsx(tte,{graph:n,host:e}),f.jsx("div",{className:"call-graph-direction absolute top-2 left-1/2 z-20 flex -translate-x-1/2 gap-1 rounded-md border bg-popover/95 p-1 shadow-lg backdrop-blur",role:"group","aria-label":"Call graph direction",children:[["callers","Callers"],["both","Both"],["callees","Callees"]].map(([A,I])=>f.jsx(ih,{size:"sm",variant:n.direction===A?"secondary":"ghost","aria-pressed":n.direction===A,disabled:!e.changeDirection,onClick:()=>{n.direction!==A&&e.changeDirection?.(A)},children:I},A))}),f.jsxs("section",{className:"call-graph-summary absolute bottom-3 left-3 z-20 flex max-w-[min(44rem,calc(100%-1.5rem))] flex-col gap-2 rounded-md border bg-popover/95 p-3 text-popover-foreground shadow-xl backdrop-blur",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsxs(Yg,{variant:"outline",children:[f.jsx(Ic,{})," depth ",n.depth]}),f.jsxs(Yg,{variant:"outline",children:[n.nodes.length," ",n.nodes.length===1?"node":"nodes"]}),f.jsxs(Yg,{variant:"outline",children:[n.edges.length," ",n.edges.length===1?"edge":"edges"]}),f.jsxs(Yg,{variant:"secondary",children:[n.coverage.resolved," resolved"]}),f.jsxs(Yg,{variant:"outline",children:[n.coverage.inferred," inferred"]}),f.jsxs(Yg,{variant:"outline",children:[n.coverage.ambiguous," ambiguous"]}),f.jsxs(Yg,{variant:"destructive",children:[n.coverage.unresolved," unresolved"]}),n.coverage.evidenceLayer&&f.jsx(Yg,{variant:"outline",children:ste(n.coverage.evidenceLayer)})]}),n.edges.length===0&&f.jsxs($u,{children:[f.jsx(qu,{children:r}),f.jsx(Ju,{children:"Compass found the root function but no represented relationships in this direction."})]}),n.truncated&&f.jsxs($u,{children:[f.jsx(XA,{}),f.jsx(qu,{children:"Partial call graph"}),f.jsx(Ju,{children:"Compass reached the configured graph limit. Counts and paths may be incomplete."})]}),f.jsx(gte,{coverage:n.coverage}),n.continuations.length>0&&f.jsxs("div",{children:[f.jsx("div",{className:"flex max-h-24 flex-wrap gap-1 overflow-auto","aria-label":"Call graph continuations",children:o.map(A=>f.jsxs(ih,{size:"xs",variant:"outline",disabled:!e.expand,onClick:()=>e.expand?.(A.symbol,A.direction,A.nextDepth),children:[A.direction==="callers"?f.jsx(WR,{}):A.direction==="callees"?f.jsx(YR,{}):f.jsx(Qm,{}),"Expand ",A.direction]},`${A.symbol}:${A.direction}:${A.nextDepth}`))}),!t&&n.continuations.length>o.length&&f.jsxs("div",{className:"mt-2 flex flex-wrap items-center justify-between gap-2",children:[f.jsxs("p",{className:"text-xs text-muted-foreground",role:"status",children:["Showing ",o.length," of ",n.continuations.length," continuations"]}),f.jsxs(ih,{size:"xs",variant:"outline",onClick:()=>i(!0),children:["Show all ",n.continuations.length," continuations"]})]})]})]})]})}function ste(n){return n.split("_").map((e,t)=>t===0?`${e.slice(0,1).toUpperCase()}${e.slice(1)}`:e).join(" ")}const L2=0;function rte(n,e){const t=new Set(n.nodes.map(l=>l.id)),i=n.edges.filter(l=>t.has(l.source)&&t.has(l.target)).map(Ate),o=new Map;for(const l of i)o.set(l.source,(o.get(l.source)??0)+1),o.set(l.target,(o.get(l.target)??0)+1);const r=Ite(n),A=new Set(n.paths.flatMap(l=>l.nodeIds.slice(0,1))),I=n.nodes.map(l=>ate(l,o.get(l.id)??0,r.get(l.id),A.has(l.id)));return{schema:"compass.viewer.graph/1",title:e,stats:{nodes:I.length,edges:i.length,communities:I.length>0?1:0,aggregated:!1},nodes:I,edges:i,communities:I.length>0?[{id:L2,label:"Query result",color:"#6f7bf7",hidden:!1}]:[],hyperedges:[]}}function ate(n,e,t,i){const o=n.details?.type==="symbol"?n.details.data.signature??void 0:void 0;return{id:n.id,label:n.name,kind:n.kind,community:L2,communityName:"Query result",degree:e,...t!==void 0?{depth:t}:{},...i?{root:!0}:{},...n.language?{language:n.language}:{},...o?{signature:o}:{},...n.source?{source:n.source}:{},codeEvidence:n.evidence}}function Ate(n){const e=Cte(n);return{id:n.id,source:n.source,target:n.target,relation:n.kind,...n.relationshipSite?{relationshipSite:n.relationshipSite}:{},...n.details?{details:n.details}:{},...e?{confidence:e}:{},codeEvidence:n.evidence}}function Cte(n){return n.evidence.some(e=>e.confidence==="ambiguous")?"ambiguous":n.evidence.some(e=>e.confidence==="inferred")?"inferred":n.evidence.length>0?"extracted":void 0}function Ite(n){const e=new Map;for(const t of n.paths)t.nodeIds.forEach((i,o)=>{const r=e.get(i);(r===void 0||o[x.id,x])),i=new Map(e.nodes.map(x=>[x.id,x])),o=new Map,r=[],A=G2(i,t),I=G2(t,i),l=new Map(cte(i,t).map(x=>[x,tv(t.get(x),i.get(x),"node")])),c=[...l.entries()].filter(([,x])=>x.fields.length>0).map(([x])=>x),h=ute(n.edges,e.edges),p=h.matched.map(({before:x,after:O})=>({before:x,after:O,evidence:dte(x,O)})).filter(({evidence:x})=>x.fields.length>0);for(const x of A)oh(o,i.get(x),"added",$A(void 0,i.get(x)));for(const x of I)oh(o,t.get(x),"removed",$A(t.get(x),void 0));for(const x of c)oh(o,i.get(x),"changed",l.get(x));for(const x of h.added)r.push({...x,change:"added",evidence:$A(void 0,x)}),sh(o,x,t,i);for(const x of h.removed)r.push({...x,change:"removed",evidence:$A(x,void 0)}),sh(o,x,t,i);for(const{after:x,evidence:O}of p)r.push({...x,change:"changed",evidence:O}),sh(o,x,t,i);const m=[...o.values()].sort((x,O)=>x.id.localeCompare(O.id));r.sort((x,O)=>x.id.localeCompare(O.id));const b=hte(r),w=new Set(m.map(x=>x.community)),S=[...e.communities,...n.communities.filter(x=>!e.communities.some(O=>O.id===x.id))].filter(x=>w.has(x.id));return{addedNodes:A.length,removedNodes:I.length,changedNodes:c.length,addedEdges:h.added.length,removedEdges:h.removed.length,changedEdges:p.length,graph:{...e,title:`Graph delta · ${e.title}`,stats:{...e.stats,nodes:m.length,edges:b.length,communities:S.length,aggregated:n.stats.aggregated||e.stats.aggregated},nodes:m,edges:b,communities:S,hyperedges:[]}}}function G2(n,e){return[...n.keys()].filter(t=>!e.has(t))}function cte(n,e){return[...n.keys()].filter(t=>e.has(t))}function oh(n,e,t,i){e&&n.set(e.id,{...e,change:t,...i?{evidence:i}:{}})}function F2(n,e,t,i){if(n.has(e))return;const o=i.get(e)??t.get(e);o&&n.set(e,{...o,change:"unchanged"})}function sh(n,e,t,i){F2(n,e.source,t,i),F2(n,e.target,t,i)}function dte(n,e){return tv({...n,id:e.id},e,"edge")}function ute(n,e){const t=new Set,i=new Set,o=[],r=(I,l)=>{t.add(I),i.add(l),o.push({before:n[I],after:e[l]})};V2(n,e,t,i,r,I=>yI(I.id)?void 0:I.id),V2(n,e,t,i,r,I=>yI(I.id)?rh(I):void 0);const A=new Map;n.forEach((I,l)=>{if(t.has(l)||!yI(I.id))return;const c=A.get(bI(I))??{parent:[],current:[]};c.parent.push(l),A.set(bI(I),c)}),e.forEach((I,l)=>{if(i.has(l)||!yI(I.id))return;const c=A.get(bI(I))??{parent:[],current:[]};c.current.push(l),A.set(bI(I),c)});for(const I of A.values()){I.parent.sort((c,h)=>U2(n[c],n[h])),I.current.sort((c,h)=>U2(e[c],e[h]));const l=Math.min(I.parent.length,I.current.length);for(let c=0;c!i.has(l)),removed:n.filter((I,l)=>!t.has(l))}}function V2(n,e,t,i,o,r){const A=new Map;e.forEach((I,l)=>{if(i.has(l))return;const c=r(I);if(c===void 0)return;const h=A.get(c)??[];h.push(l),A.set(c,h)}),n.forEach((I,l)=>{if(t.has(l))return;const c=r(I);if(c===void 0)return;const p=A.get(c)?.shift();p!==void 0&&o(l,p)})}function rh(n){return JSON.stringify(y3(n,"edge"))}function bI(n){return JSON.stringify([n.source,n.target,n.relation])}function U2(n,e){return rh(n).localeCompare(rh(e))||n.id.localeCompare(e.id)}function yI(n){return/^edge-\d+-/.test(n)}function hte(n){const e=new Map;return n.map(t=>{const i=e.get(t.id)??0;return e.set(t.id,i+1),i===0?t:{...t,id:`${t.id}::${t.change}-${i}`}})}function fte({workbench:n,host:e,communityDetail:t,communityLoading:i,communityError:o,onBackToOverview:r,initialInspectorLayout:A,onInspectorLayoutChange:I}){const[l,c]=Z.useState(()=>H2(n)??n.defaultView),[h,p]=Z.useState(!1),m=n.views.find(w=>w.id===l)??n.views[0];Z.useEffect(()=>{const w=()=>{const S=H2(n);S&&c(S)};return window.addEventListener("hashchange",w),()=>window.removeEventListener("hashchange",w)},[n]);const b=w=>{c(w);const S=`view=${encodeURIComponent(w)}`;window.location.hash.slice(1)!==S&&(window.location.hash=S)};return m?f.jsxs("div",{className:"visualization-workbench","data-navigation-collapsed":h,children:[f.jsxs("aside",{className:"visualization-rail","data-collapsed":h,"aria-label":"Compass navigation",children:[f.jsxs("header",{children:[f.jsx("span",{className:"visualization-bearing","aria-hidden":"true",children:f.jsx(p3,{})}),f.jsxs("span",{children:[f.jsx("strong",{children:"Compass"}),f.jsx("small",{title:n.title,children:n.title})]}),f.jsx("button",{className:"visualization-rail-disclosure",type:"button","aria-label":h?"Expand graph navigation":"Collapse graph navigation",title:h?"Expand graph navigation":"Collapse graph navigation",onClick:()=>p(w=>!w),children:h?f.jsx(A3,{"aria-hidden":"true"}):f.jsx(a3,{"aria-hidden":"true"})})]}),f.jsx("nav",{"aria-label":"Graph views",children:n.views.map(w=>f.jsxs("button",{type:"button","aria-current":w.id===m.id?"page":void 0,onClick:()=>b(w.id),children:[f.jsx(wte,{view:w}),f.jsxs("span",{children:[f.jsx("strong",{children:w.title}),f.jsx("small",{children:w.description})]}),f.jsx("i",{"data-status":w.coverage.status,title:`${w.coverage.status} view`})]},w.id))}),f.jsxs("footer",{children:[f.jsx("span",{children:"Snapshot"}),f.jsx("code",{children:xte(n.graphIdentity)})]})]}),f.jsxs("main",{className:"visualization-main",children:[f.jsxs("header",{className:"visualization-context",children:[f.jsxs("div",{children:[f.jsx("span",{children:Ste(m)}),f.jsx("strong",{children:m.title})]}),f.jsxs("div",{className:"visualization-coverage","data-status":m.coverage.status,children:[m.kind!=="call"&&f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[m.coverage.nodes.toLocaleString()," nodes"]}),f.jsxs("span",{children:[m.coverage.edges.toLocaleString()," relationships"]})]}),f.jsx("strong",{children:Ete(m)})]})]}),f.jsx("section",{className:"visualization-stage","aria-label":`${m.title} visualization`,children:f.jsx(pte,{view:m,host:e,communityDetail:t,communityLoading:i,communityError:o,onBackToOverview:r,initialInspectorLayout:A,onInspectorLayoutChange:I},m.id)})]})]}):null}function pte({view:n,host:e,communityDetail:t,communityLoading:i,communityError:o,onBackToOverview:r,initialInspectorLayout:A,onInspectorLayoutChange:I}){if(n.kind==="call")return f.jsx(ote,{graph:n.graph,host:{openSource:e.openSource,...e.expandCall?{expand:e.expandCall}:{},...e.changeCallDirection?{changeDirection:e.changeCallDirection}:{}}});if(n.kind==="architecture")return f.jsx(mte,{model:n.model,host:e});if(n.kind==="impact")return f.jsx(ah,{model:rte(n.result,n.title),host:e,queryResult:n.result,preferredLayout:"hierarchical"});if(n.kind==="history"){const c=lte(n.before,n.after);return f.jsxs("div",{className:"workbench-history-view",children:[f.jsxs("div",{className:"workbench-history-banner",children:[f.jsx(Ym,{"aria-hidden":"true"}),f.jsxs("span",{children:[f.jsxs("strong",{children:[n.baseRevision," → ",n.targetRevision]}),f.jsxs("small",{children:["+",c.addedNodes," / −",c.removedNodes," / Δ",c.changedNodes," nodes"]})]})]}),f.jsx(ah,{model:c.graph,host:e,preferredLayout:"grid",sourceRevisions:{before:n.baseRevision,after:n.targetRevision}})]})}const l=n.kind==="affected"?"hierarchical":n.kind==="artifact"?n.lens==="routes"?"hierarchical":"grid":"automatic";return f.jsx(ah,{model:n.model,host:e,preferredLayout:l,communityDetails:n.kind==="code"?n.communityDetails:void 0,communityDetail:n.kind==="code"?t:void 0,communityLoading:n.kind==="code"?i:void 0,communityError:n.kind==="code"?o:void 0,onBackToOverview:n.kind==="code"?r:void 0,initialInspectorLayout:A,onInspectorLayoutChange:I})}function ah({model:n,host:e,queryResult:t,sourceRevisions:i,preferredLayout:o,communityDetails:r,communityDetail:A,communityLoading:I,communityError:l,onBackToOverview:c,initialInspectorLayout:h,onInspectorLayoutChange:p}){const[m,b]=Z.useState(""),[w,S]=Z.useState(""),[x,O]=Z.useState(""),[E,R]=Z.useState(""),[B,W]=Z.useState(),[ne,L]=Z.useState(!1),G=Z.useId(),Ie=Z.useRef(null),fe=Z.useRef(null),Te=(B===void 0?void 0:{communityId:B,model:r?.[String(B)]??n})??A,He=Te?.model??n,Ve=Te?`community-${Te.communityId}`:"overview",Ce=Z.useMemo(()=>vte(He),[He]),M=Z.useMemo(()=>bte(He,{relation:m,evidence:w,kind:x,language:E}),[He,w,x,E,m]);Z.useEffect(()=>{b(""),S(""),O(""),R(""),L(!1)},[Ve]),Z.useEffect(()=>{if(!ne)return;const T=te=>{te.key==="Escape"&&(L(!1),Ie.current?.focus())},F=te=>{const re=te.target;Ie.current?.contains(re)||fe.current?.contains(re)||L(!1)};return document.addEventListener("keydown",T),document.addEventListener("pointerdown",F),()=>{document.removeEventListener("keydown",T),document.removeEventListener("pointerdown",F)}},[ne]);const Q=Z.useCallback(()=>{b(""),S(""),O(""),R("")},[]),K=Z.useCallback(()=>L(!1),[]),ie=[m,w,x,E].filter(Boolean).length,ee=ie>0&&M.nodes.length===0;return f.jsx("div",{className:"workbench-graph-lens",children:f.jsx(Gu,{model:Te?n:M,communityDetail:Te?{...Te,model:M}:void 0,communityLoading:I,communityError:l,onBackToOverview:B===void 0?c:()=>W(void 0),initialInspectorLayout:h,onInspectorLayoutChange:p,host:{...e,openCommunity:T=>{r?.[String(T)]?W(T):e.openCommunity?.(T)}},queryResult:t,sourceRevisions:i,showInspectorHeader:!1,preferredLayout:o,toolbarLeading:f.jsxs("button",{ref:Ie,className:"workbench-filter-trigger",type:"button","aria-label":"Graph filters","aria-expanded":ne,"aria-controls":G,onClick:()=>L(T=>!T),children:[f.jsx(h3,{"aria-hidden":"true"}),f.jsx("span",{children:"Filters"}),ie>0?f.jsx("b",{children:ie}):null,f.jsxs("small",{children:[M.nodes.length.toLocaleString()," / ",He.nodes.length.toLocaleString()]})]}),toolbarLeadingPanel:ne?f.jsxs("div",{ref:fe,id:G,className:"workbench-filter-popover",role:"region","aria-label":"Graph filter options",children:[f.jsxs("header",{children:[f.jsxs("span",{children:[f.jsx("strong",{children:"Filter graph"}),f.jsx("small",{children:"Refine visible nodes and relationships"})]}),f.jsx("button",{type:"button",disabled:ie===0,onClick:Q,children:"Clear filters"})]}),f.jsx(Ws,{label:"Relationship",value:m,values:Ce.relations,onChange:b}),f.jsx(Ws,{label:"Evidence",value:w,values:Ce.evidence,onChange:S}),f.jsx(Ws,{label:"Node kind",value:x,values:Ce.kinds,onChange:O}),f.jsx(Ws,{label:"Language",value:E,values:Ce.languages,onChange:R}),f.jsx("footer",{role:"status",children:ee?"No nodes match these filters":`Showing ${M.nodes.length.toLocaleString()} of ${He.nodes.length.toLocaleString()} nodes`})]}):void 0,toolbarLeadingOpen:ne,onToolbarLeadingClose:K,stageOverlay:He.nodes.length===0?f.jsx(Y2,{title:"This view has no graph nodes",detail:"The exported graph lens did not contain any nodes to visualize."}):ee&&!ne?f.jsx(Y2,{title:"No nodes match these filters",detail:"Clear one or more filters to restore the graph.",onClear:Q}):void 0})})}function Y2({title:n,detail:e,onClear:t}){return f.jsxs("div",{className:"workbench-graph-empty",role:"status",children:[f.jsx(lc,{"aria-hidden":"true"}),f.jsx("strong",{children:n}),f.jsx("span",{children:e}),t?f.jsx("button",{type:"button",onClick:t,children:"Clear filters"}):null]})}function Ws({label:n,value:e,values:t,onChange:i}){return f.jsxs("label",{children:[f.jsx("span",{children:n}),f.jsxs("select",{value:e,onChange:o=>i(o.target.value),children:[f.jsx("option",{value:"",children:"All"}),t.map(o=>f.jsx("option",{value:o,children:Ah(o)},o))]})]})}function mte({model:n,host:e}){const[t,i]=Z.useState("production"),[o,r]=Z.useState("all"),A=Z.useMemo(()=>yte(n,t,o),[o,n,t]),I=A.sections.find(m=>m.nodeCount>0),[l,c]=Z.useState(I?{kind:"section",id:I.id}:void 0),h=l?.kind==="section"?n.sections.find(m=>m.id===l.id):void 0,p=l?.kind==="route"?A.routes.find(m=>m.id===l.id):void 0;return f.jsxs("div",{className:"workbench-architecture",children:[f.jsxs("div",{className:"workbench-filter-strip","aria-label":"Architecture filters",children:[f.jsx(Ws,{label:"Source scope",value:t,values:["production","all"],onChange:m=>i(m)}),f.jsx(Ws,{label:"Evidence",value:o,values:["all","extracted","inferred","ambiguous"],onChange:m=>r(m)}),f.jsxs("span",{role:"status",children:[A.statistics.visibleCalls.toLocaleString()," visible calls"]})]}),f.jsxs("div",{className:"workbench-architecture-body",children:[f.jsx(QJ,{overview:A,selection:l,onSelect:c}),f.jsx("aside",{"aria-label":"Architecture details",children:h?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:"Subsystem"}),f.jsx("h2",{children:h.name}),f.jsxs("p",{children:[h.nodes.length.toLocaleString()," symbols · ",h.edges.length.toLocaleString()," internal calls"]}),f.jsx("div",{className:"workbench-symbol-list",children:h.nodes.slice(0,100).map(m=>f.jsxs("button",{type:"button",disabled:!m.sourceFile,onClick:()=>m.sourceFile&&e.openSource({file:m.sourceFile}),children:[f.jsx("strong",{children:m.label}),f.jsxs("small",{children:[m.kind,m.sourceFile?` · ${m.sourceFile}`:""]})]},m.id))})]}):p?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:"Subsystem route"}),f.jsxs("h2",{children:[K2(A,p.sourceSection)," → ",K2(A,p.targetSection)]}),f.jsxs("p",{children:[p.calls.toLocaleString()," calls cross this boundary."]})]}):f.jsx("p",{children:"Select a subsystem or route."})})]})]})}function vte(n){const e=t=>[...new Set(t.filter(i=>!!i))].sort();return{relations:e(n.edges.map(t=>t.relation)),evidence:e(n.edges.map(t=>t.confidence)),kinds:e(n.nodes.map(t=>t.kind)),languages:e(n.nodes.map(t=>t.language))}}function bte(n,e){const t=n.nodes.filter(I=>(!e.kind||I.kind===e.kind)&&(!e.language||I.language===e.language));let i=new Set(t.map(I=>I.id));const o=n.edges.filter(I=>i.has(I.source)&&i.has(I.target)&&(!e.relation||I.relation===e.relation)&&(!e.evidence||I.confidence===e.evidence));if(e.relation||e.evidence){const I=new Set(o.flatMap(l=>[l.source,l.target]));for(const l of t)l.root&&I.add(l.id);i=I}const r=t.filter(I=>i.has(I.id)),A=new Set(r.map(I=>I.community));return{...n,stats:{...n.stats,nodes:r.length,edges:o.length,communities:A.size},nodes:r,edges:o,communities:n.communities.filter(I=>A.has(I.id))}}function yte(n,e,t){const i=n.sections.filter(S=>S.id!=="overview"),o=S=>e==="all"||S==="production",r=new Map(i.flatMap(S=>S.nodes).map(S=>[S.id,S])),A=S=>(t==="all"||S.confidence===t)&&o(r.get(S.source)?.scope??"unknown")&&o(r.get(S.target)?.scope??"unknown"),I=new Map;for(const S of n.crossSectionCalls.filter(A)){const x=`${S.sourceSection}->${S.targetSection}`,O=I.get(x)??[];O.push(S),I.set(x,O)}const l=[...I.entries()].map(([S,x])=>({id:S,sourceSection:x[0].sourceSection,targetSection:x[0].targetSection,calls:x.length,extracted:x.filter(O=>O.confidence==="extracted").length,inferred:x.filter(O=>O.confidence==="inferred").length,ambiguous:x.filter(O=>O.confidence==="ambiguous").length})).sort((S,x)=>x.calls-S.calls||S.id.localeCompare(x.id)),c=new Map,h=new Map;for(const S of l)h.set(S.sourceSection,(h.get(S.sourceSection)??0)+S.calls),c.set(S.targetSection,(c.get(S.targetSection)??0)+S.calls);const p=i.map(S=>{const x={production:0,test:0,generated:0,vendor:0,unknown:0};for(const O of S.nodes)x[O.scope]+=1;return{id:S.id,name:S.name,nodeCount:S.nodes.filter(O=>o(O.scope)).length,totalNodeCount:S.nodes.length,internalCallCount:S.edges.filter(A).length,incomingCalls:c.get(S.id)??0,outgoingCalls:h.get(S.id)??0,scopes:x}}),m=p.reduce((S,x)=>S+x.nodeCount,0),b=p.reduce((S,x)=>S+x.internalCallCount,0),w=l.reduce((S,x)=>S+x.calls,0);return{title:n.title,scope:e,evidence:t,sections:p,routes:l,statistics:{visibleNodes:m,totalNodes:n.statistics.nodes,visibleCalls:b+w,totalCalls:n.statistics.edges,communities:n.statistics.communities,extracted:n.statistics.extracted,inferred:n.statistics.inferred,ambiguous:n.statistics.ambiguous},coverage:n.coverage,provenance:n.provenance}}function wte({view:n}){const e=n.kind==="code"?lc:n.kind==="call"?Ic:n.kind==="impact"?qR:n.kind==="architecture"?XR:n.kind==="history"?Ym:n.kind==="affected"?d3:n.lens==="routes"?$m:n.lens==="provenance"?$R:l3;return f.jsx(e,{"aria-hidden":"true"})}function H2(n){const e=new URLSearchParams(window.location.hash.slice(1)).get("view");return e&&n.views.some(t=>t.id===e)?e:void 0}function xte(n){const e=n.startsWith("sha256:")?n.slice(7):n;return e.length>12?e.slice(0,12):e}function Ste(n){return n.kind==="artifact"?`${Ah(n.lens)} lens`:`${Ah(n.kind)} graph`}function Ete(n){return n.coverage.status==="complete"?"Complete":n.coverage.status==="summary"?"Community summary":"Bounded result"}function Ah(n){return n.replaceAll("_"," ").replace(/\b\w/g,e=>e.toUpperCase())}function K2(n,e){return n.sections.find(t=>t.id===e)?.name??e}const Tte=Se({provider:lt(["github","gitlab","bitbucket"]),repositoryUrl:Y().url(),revision:Y().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/i)});function Ote(n,e,t=n.revision){if(!Dte(t))return;const i=Mte(e.file);if(!i)return;const o=n.repositoryUrl.replace(/\/$/,""),r=zte(n.provider,e);return n.provider==="gitlab"?`${o}/-/blob/${t}/${i}${r}`:n.provider==="bitbucket"?`${o}/src/${t}/${i}${r}`:`${o}/blob/${t}/${i}${r}`}function Nte(n,e,t){if(window.dispatchEvent(new CustomEvent("compass:open-source",{detail:e})),!n)return{kind:"unavailable"};const i=Ote(n,e,t??n.revision);if(!i)return{kind:"unavailable"};const o=document.createElement("a");return o.href=i,o.target="_blank",o.rel="noopener noreferrer",o.click(),{kind:"opened",url:i}}function Dte(n){return/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/i.test(n)}function Mte(n){if(!n||n.startsWith("/")||n.startsWith("\\")||n.includes("\0"))return;const e=n.replaceAll("\\","/").split("/");if(!e.some(t=>!t||t==="."||t===".."))return e.map(encodeURIComponent).join("/")}function zte(n,e){const t=e.startLine;if(t===void 0)return"";const i=Math.max(t,e.endLine??t);return n==="gitlab"?i===t?`#L${t}`:`#L${t}-${i}`:n==="bitbucket"?i===t?`#lines-${t}`:`#lines-${t}:${i}`:i===t?`#L${t}`:`#L${t}-L${i}`}function W2(){const n=document.getElementById("compass-viewer-root"),e=document.getElementById("compass-viewer-model");if(!n||!e)throw new Error("Compass viewer root or model is missing");const t=JSON.parse(e.textContent??""),i=kte(),o=gN.createRoot(n),r=BR.safeParse(t);if(r.success){o.render(f.jsx(fte,{workbench:r.data,host:{openSource(m,b){Q2(i,m,b)}}}));return}const A=Eg.parse(t),I=new Map;let l,c=null,h;const p=()=>{o.render(f.jsx(Gu,{model:A,communityDetail:l,communityLoading:c,communityError:h,onBackToOverview:l?()=>{l=void 0,h=void 0,p()}:void 0,host:{openSource(m,b){Q2(i,m,b)},openCommunity(m){c===null&&(c=m,h=void 0,p(),window.setTimeout(()=>{try{let b=I.get(m);if(!b){const w=document.querySelector(`script[data-compass-community="${m}"]`);if(!w)throw new Error(`Community ${m} detail is unavailable in this export.`);b=Eg.parse(JSON.parse(w.textContent??"")),I.set(m,b)}l={communityId:m,model:b},window.dispatchEvent(new CustomEvent("compass:open-community",{detail:{communityId:m}}))}catch(b){h=b instanceof Error?b.message:String(b)}finally{c=null,p()}},0))}}}))};p()}function kte(){const n=document.getElementById("compass-source-navigation");if(!n?.textContent)return;const e=Tte.safeParse(JSON.parse(n.textContent));return e.success?e.data:void 0}function Q2(n,e,t){Nte(n,e,t).kind==="unavailable"&&Rte(e.file)}function Rte(n){const e=document.getElementById("compass-source-notice"),t=e??document.createElement("div");t.id="compass-source-notice",t.className="compass-source-notice",t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.textContent=["Source link unavailable.",`The exported revision for ${n} is not published by the configured remote.`,"Open this graph in VS Code to navigate to the local source."].join(" "),e||document.body.append(t)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",W2,{once:!0}):W2()})(); +`;yo(mJ);class vJ{constructor(e,t,i,o){var r,A;this.body=e,this.canvas=t,this.selectionHandler=i,this.interactionHandler=o,this.editMode=!1,this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0,this._domEventListenerCleanupQueue=[],this.temporaryUIFunctions={},this.temporaryEventFunctions=[],this.touchTime=0,this.temporaryIds={nodes:[],edges:[]},this.guiEnabled=!1,this.inMode=!1,this.selectedControlNode=void 0,this.options={},this.defaultOptions={enabled:!1,initiallyActive:!1,addNode:!0,addEdge:!0,editNode:void 0,editEdge:!0,deleteNode:!0,deleteEdge:!0,controlNodeStyle:{shape:"dot",size:6,color:{background:"#ff0000",border:"#3c3c3c",highlight:{background:"#07f968",border:"#3c3c3c"}},borderWidth:2,borderWidthSelected:2}},Yt(this.options,this.defaultOptions),this.body.emitter.on("destroy",()=>{this._clean()}),this.body.emitter.on("_dataChanged",oe(r=this._restore).call(r,this)),this.body.emitter.on("_resetData",oe(A=this._restore).call(A,this))}_restore(){this.inMode!==!1&&(this.options.initiallyActive===!0?this.enableEditMode():this.disableEditMode())}setOptions(e,t,i){t!==void 0&&(t.locale!==void 0?this.options.locale=t.locale:this.options.locale=i.locale,t.locales!==void 0?this.options.locales=t.locales:this.options.locales=i.locales),e!==void 0&&(typeof e=="boolean"?this.options.enabled=e:(this.options.enabled=!0,vt(this.options,e)),this.options.initiallyActive===!0&&(this.editMode=!0),this._setup())}toggleEditMode(){this.editMode===!0?this.disableEditMode():this.enableEditMode()}enableEditMode(){this.editMode=!0,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="block",this.closeDiv.style.display="block",this.editModeDiv.style.display="none",this.showManipulatorToolbar())}disableEditMode(){this.editMode=!1,this._clean(),this.guiEnabled===!0&&(this.manipulationDiv.style.display="none",this.closeDiv.style.display="none",this.editModeDiv.style.display="block",this._createEditButton())}showManipulatorToolbar(){if(this._clean(),this.manipulationDOM={},this.guiEnabled===!0){var e,t;this.editMode=!0,this.manipulationDiv.style.display="block",this.closeDiv.style.display="block";const i=this.selectionHandler.getSelectedNodeCount(),o=this.selectionHandler.getSelectedEdgeCount(),r=i+o,A=this.options.locales[this.options.locale];let I=!1;this.options.addNode!==!1&&(this._createAddNodeButton(A),I=!0),this.options.addEdge!==!1&&(I===!0?this._createSeperator(1):I=!0,this._createAddEdgeButton(A)),i===1&&typeof this.options.editNode=="function"?(I===!0?this._createSeperator(2):I=!0,this._createEditNodeButton(A)):o===1&&i===0&&this.options.editEdge!==!1&&(I===!0?this._createSeperator(3):I=!0,this._createEditEdgeButton(A)),r!==0&&(i>0&&this.options.deleteNode!==!1?(I===!0&&this._createSeperator(4),this._createDeleteButton(A)):i===0&&this.options.deleteEdge!==!1&&(I===!0&&this._createSeperator(4),this._createDeleteButton(A))),this._bindElementEvents(this.closeDiv,oe(e=this.toggleEditMode).call(e,this)),this._temporaryBindEvent("select",oe(t=this.showManipulatorToolbar).call(t,this))}this.body.emitter.emit("_redraw")}addNodeMode(){var e;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addNode",this.guiEnabled===!0){var t;const i=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(i),this._createSeperator(),this._createDescription(i.addDescription||this.options.locales.en.addDescription),this._bindElementEvents(this.closeDiv,oe(t=this.toggleEditMode).call(t,this))}this._temporaryBindEvent("click",oe(e=this._performAddNode).call(e,this))}editNode(){this.editMode!==!0&&this.enableEditMode(),this._clean();const e=this.selectionHandler.getSelectedNodes()[0];if(e!==void 0)if(this.inMode="editNode",typeof this.options.editNode=="function")if(e.isCluster!==!0){const t=vt({},e.options,!1);if(t.x=e.x,t.y=e.y,this.options.editNode.length===2)this.options.editNode(t,i=>{i!=null&&this.inMode==="editNode"&&this.body.data.nodes.getDataSet().update(i),this.showManipulatorToolbar()});else throw new Error("The function for edit does not support two arguments (data, callback)")}else alert(this.options.locales[this.options.locale].editClusterError||this.options.locales.en.editClusterError);else throw new Error("No function has been configured to handle the editing of nodes.");else this.showManipulatorToolbar()}addEdgeMode(){var e,t,i,o,r;if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="addEdge",this.guiEnabled===!0){var A;const I=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(I),this._createSeperator(),this._createDescription(I.edgeDescription||this.options.locales.en.edgeDescription),this._bindElementEvents(this.closeDiv,oe(A=this.toggleEditMode).call(A,this))}this._temporaryBindUI("onTouch",oe(e=this._handleConnect).call(e,this)),this._temporaryBindUI("onDragEnd",oe(t=this._finishConnect).call(t,this)),this._temporaryBindUI("onDrag",oe(i=this._dragControlNode).call(i,this)),this._temporaryBindUI("onRelease",oe(o=this._finishConnect).call(o,this)),this._temporaryBindUI("onDragStart",oe(r=this._dragStartEdge).call(r,this)),this._temporaryBindUI("onHold",()=>{})}editEdgeMode(){if(this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="editEdge",typeof this.options.editEdge=="object"&&typeof this.options.editEdge.editWithoutDrag=="function"&&(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0)){const A=this.body.edges[this.edgeBeingEditedId];this._performEditEdge(A.from.id,A.to.id);return}if(this.guiEnabled===!0){var e;const A=this.options.locales[this.options.locale];this.manipulationDOM={},this._createBackButton(A),this._createSeperator(),this._createDescription(A.editEdgeDescription||this.options.locales.en.editEdgeDescription),this._bindElementEvents(this.closeDiv,oe(e=this.toggleEditMode).call(e,this))}if(this.edgeBeingEditedId=this.selectionHandler.getSelectedEdgeIds()[0],this.edgeBeingEditedId!==void 0){var t,i,o,r;const A=this.body.edges[this.edgeBeingEditedId],I=this._getNewTargetNode(A.from.x,A.from.y),l=this._getNewTargetNode(A.to.x,A.to.y);this.temporaryIds.nodes.push(I.id),this.temporaryIds.nodes.push(l.id),this.body.nodes[I.id]=I,this.body.nodeIndices.push(I.id),this.body.nodes[l.id]=l,this.body.nodeIndices.push(l.id),this._temporaryBindUI("onTouch",oe(t=this._controlNodeTouch).call(t,this)),this._temporaryBindUI("onTap",()=>{}),this._temporaryBindUI("onHold",()=>{}),this._temporaryBindUI("onDragStart",oe(i=this._controlNodeDragStart).call(i,this)),this._temporaryBindUI("onDrag",oe(o=this._controlNodeDrag).call(o,this)),this._temporaryBindUI("onDragEnd",oe(r=this._controlNodeDragEnd).call(r,this)),this._temporaryBindUI("onMouseMove",()=>{}),this._temporaryBindEvent("beforeDrawing",c=>{const h=A.edgeType.findBorderPositions(c);I.selected===!1&&(I.x=h.from.x,I.y=h.from.y),l.selected===!1&&(l.x=h.to.x,l.y=h.to.y)}),this.body.emitter.emit("_redraw")}else this.showManipulatorToolbar()}deleteSelected(){this.editMode!==!0&&this.enableEditMode(),this._clean(),this.inMode="delete";const e=this.selectionHandler.getSelectedNodeIds(),t=this.selectionHandler.getSelectedEdgeIds();let i;if(e.length>0){for(let o=0;o0&&typeof this.options.deleteEdge=="function"&&(i=this.options.deleteEdge);if(typeof i=="function"){const o={nodes:e,edges:t};if(i.length===2)i(o,r=>{r!=null&&this.inMode==="delete"?(this.body.data.edges.getDataSet().remove(r.edges),this.body.data.nodes.getDataSet().remove(r.nodes),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()):(this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar())});else throw new Error("The function for delete does not support two arguments (data, callback)")}else this.body.data.edges.getDataSet().remove(t),this.body.data.nodes.getDataSet().remove(e),this.body.emitter.emit("startSimulation"),this.showManipulatorToolbar()}_setup(){this.options.enabled===!0?(this.guiEnabled=!0,this._createWrappers(),this.editMode===!1?this._createEditButton():this.showManipulatorToolbar()):(this._removeManipulationDOM(),this.guiEnabled=!1)}_createWrappers(){if(this.manipulationDiv===void 0&&(this.manipulationDiv=document.createElement("div"),this.manipulationDiv.className="vis-manipulation",this.editMode===!0?this.manipulationDiv.style.display="block":this.manipulationDiv.style.display="none",this.canvas.frame.appendChild(this.manipulationDiv)),this.editModeDiv===void 0&&(this.editModeDiv=document.createElement("div"),this.editModeDiv.className="vis-edit-mode",this.editMode===!0?this.editModeDiv.style.display="none":this.editModeDiv.style.display="block",this.canvas.frame.appendChild(this.editModeDiv)),this.closeDiv===void 0){var e,t;this.closeDiv=document.createElement("button"),this.closeDiv.className="vis-close",this.closeDiv.setAttribute("aria-label",(e=(t=this.options.locales[this.options.locale])===null||t===void 0?void 0:t.close)!==null&&e!==void 0?e:this.options.locales.en.close),this.closeDiv.style.display=this.manipulationDiv.style.display,this.canvas.frame.appendChild(this.closeDiv)}}_getNewTargetNode(e,t){const i=vt({},this.options.controlNodeStyle);i.id="targetNode"+Fs(),i.hidden=!1,i.physics=!1,i.x=e,i.y=t;const o=this.body.functions.createNode(i);return o.shape.boundingBox={left:e,right:e,top:t,bottom:t},o}_createEditButton(){var e;this._clean(),this.manipulationDOM={},zg(this.editModeDiv);const t=this.options.locales[this.options.locale],i=this._createButton("editMode","vis-edit vis-edit-mode",t.edit||this.options.locales.en.edit);this.editModeDiv.appendChild(i),this._bindElementEvents(i,oe(e=this.toggleEditMode).call(e,this))}_clean(){this.inMode=!1,this.guiEnabled===!0&&(zg(this.editModeDiv),zg(this.manipulationDiv),this._cleanupDOMEventListeners()),this._cleanupTemporaryNodesAndEdges(),this._unbindTemporaryUIs(),this._unbindTemporaryEvents(),this.body.emitter.emit("restorePhysics")}_cleanupDOMEventListeners(){for(const t of ki(e=this._domEventListenerCleanupQueue).call(e,0)){var e;t()}}_removeManipulationDOM(){this._clean(),zg(this.manipulationDiv),zg(this.editModeDiv),zg(this.closeDiv),this.manipulationDiv&&this.canvas.frame.removeChild(this.manipulationDiv),this.editModeDiv&&this.canvas.frame.removeChild(this.editModeDiv),this.closeDiv&&this.canvas.frame.removeChild(this.closeDiv),this.manipulationDiv=void 0,this.editModeDiv=void 0,this.closeDiv=void 0}_createSeperator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.manipulationDOM["seperatorLineDiv"+e]=document.createElement("div"),this.manipulationDOM["seperatorLineDiv"+e].className="vis-separator-line",this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv"+e])}_createAddNodeButton(e){var t;const i=this._createButton("addNode","vis-add",e.addNode||this.options.locales.en.addNode);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,oe(t=this.addNodeMode).call(t,this))}_createAddEdgeButton(e){var t;const i=this._createButton("addEdge","vis-connect",e.addEdge||this.options.locales.en.addEdge);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,oe(t=this.addEdgeMode).call(t,this))}_createEditNodeButton(e){var t;const i=this._createButton("editNode","vis-edit",e.editNode||this.options.locales.en.editNode);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,oe(t=this.editNode).call(t,this))}_createEditEdgeButton(e){var t;const i=this._createButton("editEdge","vis-edit",e.editEdge||this.options.locales.en.editEdge);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,oe(t=this.editEdgeMode).call(t,this))}_createDeleteButton(e){var t;let i;this.options.rtl?i="vis-delete-rtl":i="vis-delete";const o=this._createButton("delete",i,e.del||this.options.locales.en.del);this.manipulationDiv.appendChild(o),this._bindElementEvents(o,oe(t=this.deleteSelected).call(t,this))}_createBackButton(e){var t;const i=this._createButton("back","vis-back",e.back||this.options.locales.en.back);this.manipulationDiv.appendChild(i),this._bindElementEvents(i,oe(t=this.showManipulatorToolbar).call(t,this))}_createButton(e,t,i){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"vis-label";return this.manipulationDOM[e+"Div"]=document.createElement("button"),this.manipulationDOM[e+"Div"].className="vis-button "+t,this.manipulationDOM[e+"Label"]=document.createElement("div"),this.manipulationDOM[e+"Label"].className=o,this.manipulationDOM[e+"Label"].innerText=i,this.manipulationDOM[e+"Div"].appendChild(this.manipulationDOM[e+"Label"]),this.manipulationDOM[e+"Div"]}_createDescription(e){this.manipulationDOM.descriptionLabel=document.createElement("div"),this.manipulationDOM.descriptionLabel.className="vis-none",this.manipulationDOM.descriptionLabel.innerText=e,this.manipulationDiv.appendChild(this.manipulationDOM.descriptionLabel)}_temporaryBindEvent(e,t){this.temporaryEventFunctions.push({event:e,boundFunction:t}),this.body.emitter.on(e,t)}_temporaryBindUI(e,t){if(this.body.eventListeners[e]!==void 0)this.temporaryUIFunctions[e]=this.body.eventListeners[e],this.body.eventListeners[e]=t;else throw new Error("This UI function does not exist. Typo? You tried: "+e+" possible are: "+Os(xt(this.body.eventListeners)))}_unbindTemporaryUIs(){for(const e in this.temporaryUIFunctions)Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions,e)&&(this.body.eventListeners[e]=this.temporaryUIFunctions[e],delete this.temporaryUIFunctions[e]);this.temporaryUIFunctions={}}_unbindTemporaryEvents(){for(let e=0;e{i.destroy()});const o=r=>{let{keyCode:A,key:I}=r;(I==="Enter"||I===" "||A===13||A===32)&&t()};e.addEventListener("keyup",o,!1),this._domEventListenerCleanupQueue.push(()=>{e.removeEventListener("keyup",o,!1)})}_cleanupTemporaryNodesAndEdges(){for(let r=0;r=0;I--)if(r[I]!==this.selectedControlNode.id){A=this.body.nodes[r[I]];break}if(A!==void 0&&this.selectedControlNode!==void 0)if(A.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{const I=this.body.nodes[this.temporaryIds.nodes[0]];this.selectedControlNode.id===I.id?this._performEditEdge(A.id,o.to.id):this._performEditEdge(o.from.id,A.id)}else o.updateEdgeType(),this.body.emitter.emit("restorePhysics");this.body.emitter.emit("_redraw")}_handleConnect(e){if(new Date().valueOf()-this.touchTime>100){this.lastTouch=this.body.functions.getPointer(e.center),this.lastTouch.translation=Yt({},this.body.view.translation),this.interactionHandler.drag.pointer=this.lastTouch,this.interactionHandler.drag.translation=this.lastTouch.translation;const t=this.lastTouch,i=this.selectionHandler.getNodeAt(t);if(i!==void 0)if(i.isCluster===!0)alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError);else{const o=this._getNewTargetNode(i.x,i.y);this.body.nodes[o.id]=o,this.body.nodeIndices.push(o.id);const r=this.body.functions.createEdge({id:"connectionEdge"+Fs(),from:i.id,to:o.id,physics:!1,smooth:{enabled:!0,type:"continuous",roundness:.5}});this.body.edges[r.id]=r,this.body.edgeIndices.push(r.id),this.temporaryIds.nodes.push(o.id),this.temporaryIds.edges.push(r.id)}this.touchTime=new Date().valueOf()}}_dragControlNode(e){const t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t);let o;this.temporaryIds.edges[0]!==void 0&&(o=this.body.edges[this.temporaryIds.edges[0]].fromId);const r=this.selectionHandler._getAllNodesOverlappingWith(i);let A;for(let l=r.length-1;l>=0;l--){var I;if(It(I=this.temporaryIds.nodes).call(I,r[l])===-1){A=this.body.nodes[r[l]];break}}if(e.controlEdge={from:o,to:A?A.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragging",e,t),this.temporaryIds.nodes[0]!==void 0){const l=this.body.nodes[this.temporaryIds.nodes[0]];l.x=this.canvas._XconvertDOMtoCanvas(t.x),l.y=this.canvas._YconvertDOMtoCanvas(t.y),this.body.emitter.emit("_redraw")}else this.interactionHandler.onDrag(e)}_finishConnect(e){const t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t);let o;this.temporaryIds.edges[0]!==void 0&&(o=this.body.edges[this.temporaryIds.edges[0]].fromId);const r=this.selectionHandler._getAllNodesOverlappingWith(i);let A;for(let l=r.length-1;l>=0;l--){var I;if(It(I=this.temporaryIds.nodes).call(I,r[l])===-1){A=this.body.nodes[r[l]];break}}this._cleanupTemporaryNodesAndEdges(),A!==void 0&&(A.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):this.body.nodes[o]!==void 0&&this.body.nodes[A.id]!==void 0&&this._performAddEdge(o,A.id)),e.controlEdge={from:o,to:A?A.id:void 0},this.selectionHandler.generateClickEvent("controlNodeDragEnd",e,t),this.body.emitter.emit("_redraw")}_dragStartEdge(e){const t=this.lastTouch;this.selectionHandler.generateClickEvent("dragStart",e,t,void 0,!0)}_performAddNode(e){const t={id:Fs(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if(typeof this.options.addNode=="function")if(this.options.addNode.length===2)this.options.addNode(t,i=>{i!=null&&this.inMode==="addNode"&&this.body.data.nodes.getDataSet().add(i),this.showManipulatorToolbar()});else throw this.showManipulatorToolbar(),new Error("The function for add does not support two arguments (data,callback)");else this.body.data.nodes.getDataSet().add(t),this.showManipulatorToolbar()}_performAddEdge(e,t){const i={from:e,to:t};if(typeof this.options.addEdge=="function")if(this.options.addEdge.length===2)this.options.addEdge(i,o=>{o!=null&&this.inMode==="addEdge"&&(this.body.data.edges.getDataSet().add(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for connect does not support two arguments (data,callback)");else this.body.data.edges.getDataSet().add(i),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}_performEditEdge(e,t){const i={id:this.edgeBeingEditedId,from:e,to:t,label:this.body.data.edges.get(this.edgeBeingEditedId).label};let o=this.options.editEdge;if(typeof o=="object"&&(o=o.editWithoutDrag),typeof o=="function")if(o.length===2)o(i,r=>{r==null||this.inMode!=="editEdge"?(this.body.edges[i.id].updateEdgeType(),this.body.emitter.emit("_redraw"),this.showManipulatorToolbar()):(this.body.data.edges.getDataSet().update(r),this.selectionHandler.unselectAll(),this.showManipulatorToolbar())});else throw new Error("The function for edit does not support two arguments (data, callback)");else this.body.data.edges.getDataSet().update(i),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}const Ce="string",se="boolean",K="number",Fa="array",we="object",Yx="dom",bJ="any",Zu=["arrow","bar","box","circle","crow","curve","diamond","image","inv_curve","inv_triangle","triangle","vee"],Pu={borderWidth:{number:K},borderWidthSelected:{number:K,undefined:"undefined"},brokenImage:{string:Ce,undefined:"undefined"},chosen:{label:{boolean:se,function:"function"},node:{boolean:se,function:"function"},__type__:{object:we,boolean:se}},color:{border:{string:Ce},background:{string:Ce},highlight:{border:{string:Ce},background:{string:Ce},__type__:{object:we,string:Ce}},hover:{border:{string:Ce},background:{string:Ce},__type__:{object:we,string:Ce}},__type__:{object:we,string:Ce}},opacity:{number:K,undefined:"undefined"},fixed:{x:{boolean:se},y:{boolean:se},__type__:{object:we,boolean:se}},font:{align:{string:Ce},color:{string:Ce},size:{number:K},face:{string:Ce},background:{string:Ce},strokeWidth:{number:K},strokeColor:{string:Ce},vadjust:{number:K},multi:{boolean:se,string:Ce},bold:{color:{string:Ce},size:{number:K},face:{string:Ce},mod:{string:Ce},vadjust:{number:K},__type__:{object:we,string:Ce}},boldital:{color:{string:Ce},size:{number:K},face:{string:Ce},mod:{string:Ce},vadjust:{number:K},__type__:{object:we,string:Ce}},ital:{color:{string:Ce},size:{number:K},face:{string:Ce},mod:{string:Ce},vadjust:{number:K},__type__:{object:we,string:Ce}},mono:{color:{string:Ce},size:{number:K},face:{string:Ce},mod:{string:Ce},vadjust:{number:K},__type__:{object:we,string:Ce}},__type__:{object:we,string:Ce}},group:{string:Ce,number:K,undefined:"undefined"},heightConstraint:{minimum:{number:K},valign:{string:Ce},__type__:{object:we,boolean:se,number:K}},hidden:{boolean:se},icon:{face:{string:Ce},code:{string:Ce},size:{number:K},color:{string:Ce},weight:{string:Ce,number:K},__type__:{object:we}},id:{string:Ce,number:K},image:{selected:{string:Ce,undefined:"undefined"},unselected:{string:Ce,undefined:"undefined"},__type__:{object:we,string:Ce}},imagePadding:{top:{number:K},right:{number:K},bottom:{number:K},left:{number:K},__type__:{object:we,number:K}},label:{string:Ce,undefined:"undefined"},labelHighlightBold:{boolean:se},level:{number:K,undefined:"undefined"},margin:{top:{number:K},right:{number:K},bottom:{number:K},left:{number:K},__type__:{object:we,number:K}},mass:{number:K},physics:{boolean:se},scaling:{min:{number:K},max:{number:K},label:{enabled:{boolean:se},min:{number:K},max:{number:K},maxVisible:{number:K},drawThreshold:{number:K},__type__:{object:we,boolean:se}},customScalingFunction:{function:"function"},__type__:{object:we}},shadow:{enabled:{boolean:se},color:{string:Ce},size:{number:K},x:{number:K},y:{number:K},__type__:{object:we,boolean:se}},shape:{string:["custom","ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon","hexagon"]},ctxRenderer:{function:"function"},shapeProperties:{borderDashes:{boolean:se,array:Fa},borderRadius:{number:K},interpolation:{boolean:se},useImageSize:{boolean:se},useBorderWithImage:{boolean:se},coordinateOrigin:{string:["center","top-left"]},__type__:{object:we}},size:{number:K},title:{string:Ce,dom:Yx,undefined:"undefined"},value:{number:K,undefined:"undefined"},widthConstraint:{minimum:{number:K},maximum:{number:K},__type__:{object:we,boolean:se,number:K}},x:{number:K},y:{number:K},__type__:{object:we}},yJ={configure:{enabled:{boolean:se},filter:{boolean:se,string:Ce,array:Fa,function:"function"},container:{dom:Yx},showButton:{boolean:se},__type__:{object:we,boolean:se,string:Ce,array:Fa,function:"function"}},edges:{arrows:{to:{enabled:{boolean:se},scaleFactor:{number:K},type:{string:Zu},imageHeight:{number:K},imageWidth:{number:K},src:{string:Ce},__type__:{object:we,boolean:se}},middle:{enabled:{boolean:se},scaleFactor:{number:K},type:{string:Zu},imageWidth:{number:K},imageHeight:{number:K},src:{string:Ce},__type__:{object:we,boolean:se}},from:{enabled:{boolean:se},scaleFactor:{number:K},type:{string:Zu},imageWidth:{number:K},imageHeight:{number:K},src:{string:Ce},__type__:{object:we,boolean:se}},__type__:{string:["from","to","middle"],object:we}},endPointOffset:{from:{number:K},to:{number:K},__type__:{object:we,number:K}},arrowStrikethrough:{boolean:se},background:{enabled:{boolean:se},color:{string:Ce},size:{number:K},dashes:{boolean:se,array:Fa},__type__:{object:we,boolean:se}},chosen:{label:{boolean:se,function:"function"},edge:{boolean:se,function:"function"},__type__:{object:we,boolean:se}},color:{color:{string:Ce},highlight:{string:Ce},hover:{string:Ce},inherit:{string:["from","to","both"],boolean:se},opacity:{number:K},__type__:{object:we,string:Ce}},dashes:{boolean:se,array:Fa},font:{color:{string:Ce},size:{number:K},face:{string:Ce},background:{string:Ce},strokeWidth:{number:K},strokeColor:{string:Ce},align:{string:["horizontal","top","middle","bottom"]},vadjust:{number:K},multi:{boolean:se,string:Ce},bold:{color:{string:Ce},size:{number:K},face:{string:Ce},mod:{string:Ce},vadjust:{number:K},__type__:{object:we,string:Ce}},boldital:{color:{string:Ce},size:{number:K},face:{string:Ce},mod:{string:Ce},vadjust:{number:K},__type__:{object:we,string:Ce}},ital:{color:{string:Ce},size:{number:K},face:{string:Ce},mod:{string:Ce},vadjust:{number:K},__type__:{object:we,string:Ce}},mono:{color:{string:Ce},size:{number:K},face:{string:Ce},mod:{string:Ce},vadjust:{number:K},__type__:{object:we,string:Ce}},__type__:{object:we,string:Ce}},hidden:{boolean:se},hoverWidth:{function:"function",number:K},label:{string:Ce,undefined:"undefined"},labelHighlightBold:{boolean:se},length:{number:K,undefined:"undefined"},physics:{boolean:se},scaling:{min:{number:K},max:{number:K},label:{enabled:{boolean:se},min:{number:K},max:{number:K},maxVisible:{number:K},drawThreshold:{number:K},__type__:{object:we,boolean:se}},customScalingFunction:{function:"function"},__type__:{object:we}},selectionWidth:{function:"function",number:K},selfReferenceSize:{number:K},selfReference:{size:{number:K},angle:{number:K},renderBehindTheNode:{boolean:se},__type__:{object:we}},shadow:{enabled:{boolean:se},color:{string:Ce},size:{number:K},x:{number:K},y:{number:K},__type__:{object:we,boolean:se}},smooth:{enabled:{boolean:se},type:{string:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"]},roundness:{number:K},forceDirection:{string:["horizontal","vertical","none"],boolean:se},__type__:{object:we,boolean:se}},title:{string:Ce,undefined:"undefined"},width:{number:K},widthConstraint:{maximum:{number:K},__type__:{object:we,boolean:se,number:K}},value:{number:K,undefined:"undefined"},__type__:{object:we}},groups:{useDefaultGroups:{boolean:se},__any__:Pu,__type__:{object:we}},interaction:{dragNodes:{boolean:se},dragView:{boolean:se},hideEdgesOnDrag:{boolean:se},hideEdgesOnZoom:{boolean:se},hideNodesOnDrag:{boolean:se},hover:{boolean:se},keyboard:{enabled:{boolean:se},speed:{x:{number:K},y:{number:K},zoom:{number:K},__type__:{object:we}},bindToWindow:{boolean:se},autoFocus:{boolean:se},__type__:{object:we,boolean:se}},multiselect:{boolean:se},navigationButtons:{boolean:se},selectable:{boolean:se},selectConnectedEdges:{boolean:se},hoverConnectedEdges:{boolean:se},tooltipDelay:{number:K},zoomView:{boolean:se},zoomSpeed:{number:K},__type__:{object:we}},layout:{randomSeed:{undefined:"undefined",number:K,string:Ce},improvedLayout:{boolean:se},clusterThreshold:{number:K},hierarchical:{enabled:{boolean:se},levelSeparation:{number:K},nodeSpacing:{number:K},treeSpacing:{number:K},blockShifting:{boolean:se},edgeMinimization:{boolean:se},parentCentralization:{boolean:se},direction:{string:["UD","DU","LR","RL"]},sortMethod:{string:["hubsize","directed"]},shakeTowards:{string:["leaves","roots"]},__type__:{object:we,boolean:se}},__type__:{object:we}},manipulation:{enabled:{boolean:se},initiallyActive:{boolean:se},addNode:{boolean:se,function:"function"},addEdge:{boolean:se,function:"function"},editNode:{function:"function"},editEdge:{editWithoutDrag:{function:"function"},__type__:{object:we,boolean:se,function:"function"}},deleteNode:{boolean:se,function:"function"},deleteEdge:{boolean:se,function:"function"},controlNodeStyle:Pu,__type__:{object:we,boolean:se}},nodes:Pu,physics:{enabled:{boolean:se},barnesHut:{theta:{number:K},gravitationalConstant:{number:K},centralGravity:{number:K},springLength:{number:K},springConstant:{number:K},damping:{number:K},avoidOverlap:{number:K},__type__:{object:we}},forceAtlas2Based:{theta:{number:K},gravitationalConstant:{number:K},centralGravity:{number:K},springLength:{number:K},springConstant:{number:K},damping:{number:K},avoidOverlap:{number:K},__type__:{object:we}},repulsion:{centralGravity:{number:K},springLength:{number:K},springConstant:{number:K},nodeDistance:{number:K},damping:{number:K},__type__:{object:we}},hierarchicalRepulsion:{centralGravity:{number:K},springLength:{number:K},springConstant:{number:K},nodeDistance:{number:K},damping:{number:K},avoidOverlap:{number:K},__type__:{object:we}},maxVelocity:{number:K},minVelocity:{number:K},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{boolean:se},iterations:{number:K},updateInterval:{number:K},onlyDynamicEdges:{boolean:se},fit:{boolean:se},__type__:{object:we,boolean:se}},timestep:{number:K},adaptiveTimestep:{boolean:se},wind:{x:{number:K},y:{number:K},__type__:{object:we}},__type__:{object:we,boolean:se}},autoResize:{boolean:se},clickToUse:{boolean:se},locale:{string:Ce},locales:{__any__:{any:bJ},__type__:{object:we}},height:{string:Ce},width:{string:Ce},__type__:{object:we}},Hx={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},opacity:[0,0,1,.1],fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown","hexagon"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},middle:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"},from:{enabled:!1,scaleFactor:[1,0,3,.05],type:"arrow"}},endPointOffset:{from:[0,-10,10,1],to:[0,-10,10,1]},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,physics:!0,scaling:{min:[1,0,100,1],max:[15,0,100,1],label:{enabled:!0,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},selectionWidth:[1.5,0,5,.1],selfReferenceSize:[20,0,200,1],selfReference:{size:[20,0,200,1],angle:[Math.PI/2,-6*Math.PI,6*Math.PI,Math.PI/8],renderBehindTheNode:!0},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},smooth:{enabled:!0,type:["dynamic","continuous","discrete","diagonalCross","straightCross","horizontal","vertical","curvedCW","curvedCCW","cubicBezier"],forceDirection:["horizontal","vertical","none"],roundness:[.5,0,1,.05]},width:[1,0,30,1]},layout:{hierarchical:{enabled:!1,levelSeparation:[150,20,500,5],nodeSpacing:[100,20,500,5],treeSpacing:[200,20,500,5],blockShifting:!0,edgeMinimization:!0,parentCentralization:!0,direction:["UD","DU","LR","RL"],sortMethod:["hubsize","directed"],shakeTowards:["leaves","roots"]}},interaction:{dragNodes:!0,dragView:!0,hideEdgesOnDrag:!1,hideEdgesOnZoom:!1,hideNodesOnDrag:!1,hover:!1,keyboard:{enabled:!1,speed:{x:[10,0,40,1],y:[10,0,40,1],zoom:[.02,0,.1,.005]},bindToWindow:!0,autoFocus:!0},multiselect:!1,navigationButtons:!1,selectable:!0,selectConnectedEdges:!0,hoverConnectedEdges:!0,tooltipDelay:[300,0,1e3,25],zoomView:!0,zoomSpeed:[1,.1,2,.1]},manipulation:{enabled:!1,initiallyActive:!1},physics:{enabled:!0,barnesHut:{theta:[.5,.1,1,.05],gravitationalConstant:[-2e3,-3e4,0,50],centralGravity:[.3,0,10,.05],springLength:[95,0,500,5],springConstant:[.04,0,1.2,.005],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},forceAtlas2Based:{theta:[.5,.1,1,.05],gravitationalConstant:[-50,-500,0,1],centralGravity:[.01,0,1,.005],springLength:[95,0,500,5],springConstant:[.08,0,1.2,.005],damping:[.4,0,1,.01],avoidOverlap:[0,0,1,.01]},repulsion:{centralGravity:[.2,0,10,.05],springLength:[200,0,500,5],springConstant:[.05,0,1.2,.005],nodeDistance:[100,0,500,5],damping:[.09,0,1,.01]},hierarchicalRepulsion:{centralGravity:[.2,0,10,.05],springLength:[100,0,500,5],springConstant:[.01,0,1.2,.005],nodeDistance:[120,0,500,5],damping:[.09,0,1,.01],avoidOverlap:[0,0,1,.01]},maxVelocity:[50,0,150,1],minVelocity:[.1,.01,.5,.01],solver:["barnesHut","forceAtlas2Based","repulsion","hierarchicalRepulsion"],timestep:[.5,.01,1,.01],wind:{x:[0,-10,10,.1],y:[0,-10,10,.1]}}},wJ=(n,e,t)=>{var i;return!!(Dg(n).call(n,"physics")&&Dg(i=Hx.physics.solver).call(i,e)&&t.physics.solver!==e&&e!=="wind")};class xJ{constructor(){}getDistances(e,t,i){const o={},r=e.edges;for(let I=0;I2&&arguments[2]!==void 0?arguments[2]:!1;const o=this.distanceSolver.getDistances(this.body,e,t);this._createL_matrix(o),this._createK_matrix(o),this._createE_matrix();const r=.01,A=1;let I=0;const l=Math.max(1e3,Math.min(10*this.body.nodeIndices.length,6e3)),c=5;let h=1e9,p=0,m=0,b=0,w=0,O=0;for(;h>r&&IA&&Othis.body.emitter.emit("_requestRedraw")),this.groups=new r7,this.canvas=new mq(this.body),this.selectionHandler=new Jq(this.body,this.canvas),this.interactionHandler=new xq(this.body,this.canvas,this.selectionHandler),this.view=new bq(this.body,this.canvas),this.renderer=new dq(this.body,this.canvas),this.physics=new Iq(this.body),this.layoutEngine=new pJ(this.body),this.clustering=new cq(this.body),this.manipulation=new vJ(this.body,this.canvas,this.selectionHandler,this.interactionHandler),this.nodesHandler=new _$(this.body,this.images,this.groups,this.layoutEngine),this.edgesHandler=new oq(this.body,this.images,this.groups),this.body.modules.kamadaKawai=new EJ(this.body,150,.05),this.body.modules.clustering=this.clustering,this.canvas._create(),this.setOptions(t),this.setData(e)}Mb(ve.prototype),ve.prototype.setOptions=function(n){if(n===null&&(n=void 0),n!==void 0){if(qU.validate(n,yJ)===!0&&console.error("%cErrors have been found in the supplied options object.",R1),js(["locale","locales","clickToUse"],this.options,n),n.locale!==void 0&&(n.locale=IY(n.locales||this.options.locales,n.locale)),n=this.layoutEngine.setOptions(n.layout,n),this.canvas.setOptions(n),this.groups.setOptions(n.groups),this.nodesHandler.setOptions(n.nodes),this.edgesHandler.setOptions(n.edges),this.physics.setOptions(n.physics),this.manipulation.setOptions(n.manipulation,n,this.options),this.interactionHandler.setOptions(n.interaction),this.renderer.setOptions(n.interaction),this.selectionHandler.setOptions(n.interaction),n.groups!==void 0&&this.body.emitter.emit("refreshNodes"),"configure"in n&&(this.configurator||(this.configurator=new XU(this,this.body.container,Hx,this.canvas.pixelRatio,wJ)),this.configurator.setOptions(n.configure)),this.configurator&&this.configurator.options.enabled===!0){const i={nodes:{},edges:{},layout:{},interaction:{},manipulation:{},physics:{},global:{}};vt(i.nodes,this.nodesHandler.options),vt(i.edges,this.edgesHandler.options),vt(i.layout,this.layoutEngine.options),vt(i.interaction,this.selectionHandler.options),vt(i.interaction,this.renderer.options),vt(i.interaction,this.interactionHandler.options),vt(i.manipulation,this.manipulation.options),vt(i.physics,this.physics.options),vt(i.global,this.canvas.options),vt(i.global,this.options),this.configurator.setModuleOptions(i)}n.clickToUse!==void 0?n.clickToUse===!0?this.activator===void 0&&(this.activator=new QU(this.canvas.frame),this.activator.on("change",()=>{this.body.emitter.emit("activate")})):(this.activator!==void 0&&(this.activator.destroy(),delete this.activator),this.body.emitter.emit("activate")):this.body.emitter.emit("activate"),this.canvas.setSize(),this.body.emitter.emit("startSimulation")}},ve.prototype._updateVisibleIndices=function(){const n=this.body.nodes,e=this.body.edges;this.body.nodeIndices=[],this.body.edgeIndices=[];for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&!this.clustering._isClusteredNode(t)&&n[t].options.hidden===!1&&this.body.nodeIndices.push(n[t].id);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const i=e[t],o=n[i.fromId],r=n[i.toId],A=o!==void 0&&r!==void 0;!this.clustering._isClusteredEdge(t)&&i.options.hidden===!1&&A&&o.options.hidden===!1&&r.options.hidden===!1&&this.body.edgeIndices.push(i.id)}},ve.prototype.bindEventListeners=function(){this.body.emitter.on("_dataChanged",()=>{this.edgesHandler._updateState(),this.body.emitter.emit("_dataUpdated")}),this.body.emitter.on("_dataUpdated",()=>{this.clustering._updateState(),this._updateVisibleIndices(),this._updateValueRange(this.body.nodes),this._updateValueRange(this.body.edges),this.body.emitter.emit("startSimulation"),this.body.emitter.emit("_requestRedraw")})},ve.prototype.setData=function(n){if(this.body.emitter.emit("resetPhysics"),this.body.emitter.emit("_resetData"),this.selectionHandler.unselectAll(),n&&n.dot&&(n.nodes||n.edges))throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.');if(this.setOptions(n&&n.options),n&&n.dot){console.warn("The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);");const e=aY(n.dot);this.setData(e);return}else if(n&&n.gephi){console.warn("The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);");const e=AY(n.gephi);this.setData(e);return}else this.nodesHandler.setData(n&&n.nodes,!0),this.edgesHandler.setData(n&&n.edges,!0);this.body.emitter.emit("_dataChanged"),this.body.emitter.emit("_dataLoaded"),this.body.emitter.emit("initPhysics")},ve.prototype.destroy=function(){this.body.emitter.emit("destroy"),this.body.emitter.off(),this.off(),delete this.groups,delete this.canvas,delete this.selectionHandler,delete this.interactionHandler,delete this.view,delete this.renderer,delete this.physics,delete this.layoutEngine,delete this.clustering,delete this.manipulation,delete this.nodesHandler,delete this.edgesHandler,delete this.configurator,delete this.images;for(const n in this.body.nodes)Object.prototype.hasOwnProperty.call(this.body.nodes,n)&&delete this.body.nodes[n];for(const n in this.body.edges)Object.prototype.hasOwnProperty.call(this.body.edges,n)&&delete this.body.edges[n];zg(this.body.container)},ve.prototype._updateValueRange=function(n){let e,t,i,o=0;for(e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const r=n[e].getValue();r!==void 0&&(t=t===void 0?r:Math.min(r,t),i=i===void 0?r:Math.max(r,i),o+=r)}if(t!==void 0&&i!==void 0)for(e in n)Object.prototype.hasOwnProperty.call(n,e)&&n[e].setValueRange(t,i,o)},ve.prototype.isActive=function(){return!this.activator||this.activator.active},ve.prototype.setSize=function(){return this.canvas.setSize.apply(this.canvas,arguments)},ve.prototype.canvasToDOM=function(){return this.canvas.canvasToDOM.apply(this.canvas,arguments)},ve.prototype.DOMtoCanvas=function(){return this.canvas.DOMtoCanvas.apply(this.canvas,arguments)},ve.prototype.findNode=function(){return this.clustering.findNode.apply(this.clustering,arguments)},ve.prototype.isCluster=function(){return this.clustering.isCluster.apply(this.clustering,arguments)},ve.prototype.openCluster=function(){return this.clustering.openCluster.apply(this.clustering,arguments)},ve.prototype.cluster=function(){return this.clustering.cluster.apply(this.clustering,arguments)},ve.prototype.getNodesInCluster=function(){return this.clustering.getNodesInCluster.apply(this.clustering,arguments)},ve.prototype.clusterByConnection=function(){return this.clustering.clusterByConnection.apply(this.clustering,arguments)},ve.prototype.clusterByHubsize=function(){return this.clustering.clusterByHubsize.apply(this.clustering,arguments)},ve.prototype.updateClusteredNode=function(){return this.clustering.updateClusteredNode.apply(this.clustering,arguments)},ve.prototype.getClusteredEdges=function(){return this.clustering.getClusteredEdges.apply(this.clustering,arguments)},ve.prototype.getBaseEdge=function(){return this.clustering.getBaseEdge.apply(this.clustering,arguments)},ve.prototype.getBaseEdges=function(){return this.clustering.getBaseEdges.apply(this.clustering,arguments)},ve.prototype.updateEdge=function(){return this.clustering.updateEdge.apply(this.clustering,arguments)},ve.prototype.clusterOutliers=function(){return this.clustering.clusterOutliers.apply(this.clustering,arguments)},ve.prototype.getSeed=function(){return this.layoutEngine.getSeed.apply(this.layoutEngine,arguments)},ve.prototype.enableEditMode=function(){return this.manipulation.enableEditMode.apply(this.manipulation,arguments)},ve.prototype.disableEditMode=function(){return this.manipulation.disableEditMode.apply(this.manipulation,arguments)},ve.prototype.addNodeMode=function(){return this.manipulation.addNodeMode.apply(this.manipulation,arguments)},ve.prototype.editNode=function(){return this.manipulation.editNode.apply(this.manipulation,arguments)},ve.prototype.editNodeMode=function(){return console.warn("Deprecated: Please use editNode instead of editNodeMode."),this.manipulation.editNode.apply(this.manipulation,arguments)},ve.prototype.addEdgeMode=function(){return this.manipulation.addEdgeMode.apply(this.manipulation,arguments)},ve.prototype.editEdgeMode=function(){return this.manipulation.editEdgeMode.apply(this.manipulation,arguments)},ve.prototype.deleteSelected=function(){return this.manipulation.deleteSelected.apply(this.manipulation,arguments)},ve.prototype.getPositions=function(){return this.nodesHandler.getPositions.apply(this.nodesHandler,arguments)},ve.prototype.getPosition=function(){return this.nodesHandler.getPosition.apply(this.nodesHandler,arguments)},ve.prototype.storePositions=function(){return this.nodesHandler.storePositions.apply(this.nodesHandler,arguments)},ve.prototype.moveNode=function(){return this.nodesHandler.moveNode.apply(this.nodesHandler,arguments)},ve.prototype.getBoundingBox=function(){return this.nodesHandler.getBoundingBox.apply(this.nodesHandler,arguments)},ve.prototype.getConnectedNodes=function(n){return this.body.nodes[n]!==void 0?this.nodesHandler.getConnectedNodes.apply(this.nodesHandler,arguments):this.edgesHandler.getConnectedNodes.apply(this.edgesHandler,arguments)},ve.prototype.getConnectedEdges=function(){return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler,arguments)},ve.prototype.startSimulation=function(){return this.physics.startSimulation.apply(this.physics,arguments)},ve.prototype.stopSimulation=function(){return this.physics.stopSimulation.apply(this.physics,arguments)},ve.prototype.stabilize=function(){return this.physics.stabilize.apply(this.physics,arguments)},ve.prototype.getSelection=function(){return this.selectionHandler.getSelection.apply(this.selectionHandler,arguments)},ve.prototype.setSelection=function(){return this.selectionHandler.setSelection.apply(this.selectionHandler,arguments)},ve.prototype.getSelectedNodes=function(){return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler,arguments)},ve.prototype.getSelectedEdges=function(){return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler,arguments)},ve.prototype.getNodeAt=function(){const n=this.selectionHandler.getNodeAt.apply(this.selectionHandler,arguments);return n!==void 0&&n.id!==void 0?n.id:n},ve.prototype.getEdgeAt=function(){const n=this.selectionHandler.getEdgeAt.apply(this.selectionHandler,arguments);return n!==void 0&&n.id!==void 0?n.id:n},ve.prototype.selectNodes=function(){return this.selectionHandler.selectNodes.apply(this.selectionHandler,arguments)},ve.prototype.selectEdges=function(){return this.selectionHandler.selectEdges.apply(this.selectionHandler,arguments)},ve.prototype.unselectAll=function(){this.selectionHandler.unselectAll.apply(this.selectionHandler,arguments),this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler),this.redraw()},ve.prototype.redraw=function(){return this.renderer.redraw.apply(this.renderer,arguments)},ve.prototype.getScale=function(){return this.view.getScale.apply(this.view,arguments)},ve.prototype.getViewPosition=function(){return this.view.getViewPosition.apply(this.view,arguments)},ve.prototype.fit=function(){return this.view.fit.apply(this.view,arguments)},ve.prototype.moveTo=function(){return this.view.moveTo.apply(this.view,arguments)},ve.prototype.focus=function(){return this.view.focus.apply(this.view,arguments)},ve.prototype.releaseNode=function(){return this.view.releaseNode.apply(this.view,arguments)},ve.prototype.getOptionsFromConfigurator=function(){let n={};return this.configurator&&(n=this.configurator.getOptions.apply(this.configurator)),n};function SJ(n,e){n.on("click",t=>{e.onHover(null),t.edges.length===0&&e.onHoverEdge(null);const i=t.nodes[0];i!==void 0?e.onFocus(String(i)):e.onClear()}),n.on("doubleClick",t=>{const i=t.nodes[0];if(i!==void 0){e.onOpenSource(String(i));return}const o=t.edges[0];o!==void 0&&e.onOpenRelationshipSource(String(o))}),n.on("hoverNode",t=>{t.node!==void 0&&(e.onInteractionStart(),e.onHoverEdge(null),e.onHover({nodeId:String(t.node),x:t.pointer.DOM.x,y:t.pointer.DOM.y}))}),n.on("blurNode",()=>e.onHover(null)),n.on("hoverEdge",t=>{t.edge!==void 0&&(e.onHover(null),e.onHoverEdge({edgeId:String(t.edge),x:t.pointer.DOM.x,y:t.pointer.DOM.y}))}),n.on("blurEdge",()=>e.onHoverEdge(null)),n.on("dragStart",()=>{e.onInteractionStart(),e.onHover(null),e.onHoverEdge(null)}),n.on("zoom",()=>{e.onHover(null),e.onHoverEdge(null)})}const TJ=1e3,OJ=4e3,Bu=4e3;function NJ(n){return n.nodes.length>=TJ||n.edges.length>=OJ?"static":"interactive"}function DJ(n,e=!1){if(e)return jJ(n);const t=new Map;for(const h of n){const p=t.get(h.community)??[];p.push(h),t.set(h.community,p)}const i=[...t.entries()].sort(([h],[p])=>h-p).map(([h,p])=>({community:h,members:p.sort((m,b)=>m.id.localeCompare(b.id))})),o=i.reduce((h,p)=>Math.max(h,p.members.length),1),r=Math.max(1,Math.ceil(Math.sqrt(i.length))),A=Math.max(1,Math.ceil(i.length/r)),I=Math.max(280,Math.ceil(Math.sqrt(o))*48),l=Math.PI*(3-Math.sqrt(5)),c=new Map;return i.forEach((h,p)=>{const m=p%r,b=Math.floor(p/r),w=(m-(r-1)/2)*I,O=(b-(A-1)/2)*I;h.members.forEach((x,S)=>{if(S===0){c.set(x.id,{x:w,y:O});return}const E=24*Math.sqrt(S),_=S*l;c.set(x.id,{x:w+Math.cos(_)*E,y:O+Math.sin(_)*E})})}),c}function MJ(n,e,t=!1){const i=[...n].sort((o,r)=>o.community-r.community||(r.degree??0)-(o.degree??0)||o.id.localeCompare(r.id));if(e==="circle"){const o=Math.max(160,i.length*44/(2*Math.PI));return new Map(i.map((r,A)=>{const I=-Math.PI/2+A*2*Math.PI/Math.max(1,i.length);return[r.id,{x:Math.cos(I)*o,y:Math.sin(I)*o}]}))}if(e==="concentric"){const o=[...n].sort((r,A)=>(A.degree??0)-(r.degree??0)||(A.memberCount??0)-(r.memberCount??0)||r.community-A.community||r.id.localeCompare(A.id));return zJ(o)}return e==="hierarchical"?RJ(i):e==="spiral"?kJ(i):_J(i,t)}function RJ(n){const e=new Map;for(const o of n){const r=o.depth??(o.root?0:1),A=e.get(r)??[];A.push(o),e.set(r,A)}const t=[...e.entries()].sort(([o],[r])=>o-r),i=new Map;for(const[o,r]of t){r.sort((I,l)=>Number(l.root??!1)-Number(I.root??!1)||(l.degree??0)-(I.degree??0)||I.id.localeCompare(l.id));const A=148;r.forEach((I,l)=>i.set(I.id,{x:(l-(r.length-1)/2)*A,y:o*168}))}return i}function zJ(n){const e=new Map,t=n[0];if(!t)return e;e.set(t.id,{x:0,y:0});let i=1,o=1;for(;i{if(o===0)return[i.id,{x:0,y:0}];const r=36*Math.sqrt(o),A=o*.52;return[i.id,{x:Math.cos(A)*r,y:Math.sin(A)*r}]}))}function _J(n,e){const r=new Map;n.forEach((w,O)=>{const x=e?Math.floor(O/16):w.community,S=r.get(x)??[];S.push(w),r.set(x,S)});const A=[...r.entries()].sort(([w],[O])=>w-O).map(([w,O])=>{const x=Math.max(1,Math.ceil(Math.sqrt(O.length))),S=Math.max(1,Math.ceil(O.length/x));return{key:w,members:O,columns:x,rows:S,width:(x-1)*56,height:(S-1)*56}}),I=Math.max(1,Math.ceil(Math.sqrt(A.length))),l=Math.max(1,Math.ceil(A.length/I)),c=Array.from({length:I},()=>0),h=Array.from({length:l},()=>0);A.forEach((w,O)=>{const x=O%I,S=Math.floor(O/I);c[x]=Math.max(c[x]??0,w.width),h[S]=Math.max(h[S]??0,w.height)});const p=Kx(c,112),m=Kx(h,112),b=new Map;return A.forEach((w,O)=>{const x=O%I,S=Math.floor(O/I);w.members.forEach((E,_)=>{const j=Math.floor(_/w.columns),X=Math.min(w.columns,w.members.length-j*w.columns),ne=_%w.columns;b.set(E.id,{x:(p[x]??0)+(ne-(X-1)/2)*56,y:(m[S]??0)+(j-(w.rows-1)/2)*56})})}),b}function Kx(n,e){let i=-(n.reduce((o,r)=>o+r,0)+Math.max(0,n.length-1)*e)/2;return n.map(o=>{const r=i+o/2;return i+=o+e,r})}function Wx(n){if(!n.stats.aggregated||n.edges.length<=Bu)return n.edges;const e=[...n.edges].sort((A,I)=>(I.weight??Qx(I.relation))-(A.weight??Qx(A.relation))||A.source.localeCompare(I.source)||A.target.localeCompare(I.target)||A.id.localeCompare(I.id)),t=new Map(n.nodes.map(A=>[A.id,A.id])),i=A=>{let I=t.get(A)??A;for(;t.get(I)!==void 0&&t.get(I)!==I;)I=t.get(I);let l=A;for(;t.get(l)!==void 0&&t.get(l)!==I;){const c=t.get(l);t.set(l,I),l=c}return I},o=[],r=new Set;for(const A of e){const I=i(A.source),l=i(A.target);if(I!==l&&(t.set(l,I),o.push(A),r.add(A.id),o.length===Bu))return o}for(const A of e)if(!r.has(A.id)&&(o.push(A),o.length===Bu))break;return o}function Qx(n){const e=Number.parseInt(n,10);return Number.isFinite(e)&&e>0?e:1}function jJ(n){const e=[...n].sort((o,r)=>(r.degree??0)-(o.degree??0)||(r.memberCount??0)-(o.memberCount??0)||o.id.localeCompare(r.id)),t=Math.PI*(3-Math.sqrt(5)),i=34;return new Map(e.map((o,r)=>{if(r===0)return[o.id,{x:0,y:0}];const A=i*Math.sqrt(r),I=r*t;return[o.id,{x:Math.cos(I)*A,y:Math.sin(I)*A}]}))}const hI=176,fI=108,Xx=8,ZJ=1500,PJ=2e3;function BJ(n){const e=[...n.positions.values()],t=n.viewport.left+n.viewport.width,i=n.viewport.top+n.viewport.height,o=[...e.map(F=>F.x),n.viewport.left,t],r=[...e.map(F=>F.y),n.viewport.top,i],A=Math.min(...o),I=Math.max(...o),l=Math.min(...r),c=Math.max(...r),h=Math.max(1,I-A),p=Math.max(1,c-l),m=hI-Xx*2,b=fI-Xx*2,w=Math.min(m/h,b/p),O=h*w,x=p*w,S=(hI-O)/2,E=(fI-x)/2,_=({x:F,y:V})=>({x:S+(F-A)*w,y:E+(V-l)*w}),j=({x:F,y:V})=>({x:A+(F-S)/w,y:l+(V-E)/w}),X=_({x:n.viewport.left,y:n.viewport.top}),ne=_({x:t,y:i});return{project:_,unproject:j,viewport:{x:X.x,y:X.y,width:ne.x-X.x,height:ne.y-X.y}}}function LJ({model:n,snapshot:e,visibleNodeIds:t,visibleEdgeIds:i,focusedNodeId:o,semanticDetail:r=!1,onNavigate:A}){const I=B.useMemo(()=>BJ(e),[e]),l=B.useMemo(()=>n.nodes.filter(b=>!t||t.has(b.id)).sort((b,w)=>b.id.localeCompare(w.id)),[n.nodes,t]),c=l.slice(0,ZJ),h=B.useMemo(()=>n.edges.filter(b=>(!i||i.has(b.id))&&(!t||t.has(b.source)&&t.has(b.target))).sort((b,w)=>b.id.localeCompare(w.id)).slice(0,PJ),[n.edges,i,t]),p=B.useMemo(()=>new Map(n.communities.map(b=>[b.id,b.color])),[n.communities]),m=b=>{const w=b.currentTarget.getBoundingClientRect();w.width<=0||w.height<=0||A(I.unproject({x:(b.clientX-w.left)/w.width*hI,y:(b.clientY-w.top)/w.height*fI}))};return f.jsxs("aside",{className:"compass-minimap compass-glass-panel","aria-label":"Graph overview",children:[f.jsxs("header",{children:[f.jsx("span",{children:"Map"}),f.jsx("small",{children:c.length{const w=e.positions.get(b.source),O=e.positions.get(b.target);if(!w||!O)return null;const x=I.project(w),S=I.project(O);return f.jsx("line",{x1:x.x,y1:x.y,x2:S.x,y2:S.y},b.id)})}),f.jsx("g",{className:"compass-minimap-nodes",children:c.map(b=>{const w=e.positions.get(b.id);if(!w)return null;const O=I.project(w);return f.jsx("circle",{cx:O.x,cy:O.y,r:b.id===o?3:1.65,fill:r?M_(cs(b.kind)):b.color?.background??p.get(b.community)??"currentColor","data-node-category":r?cs(b.kind):void 0,"data-focused":b.id===o?"true":void 0},b.id)})}),f.jsx("rect",{className:"compass-minimap-viewport",x:I.viewport.x,y:I.viewport.y,width:I.viewport.width,height:I.viewport.height,rx:"2"})]})})]})}const $x={added:{background:"#163d24",border:"#56d364"},removed:{background:"#4b1f24",border:"#ff7b72"},changed:{background:"#3d3015",border:"#d7a72b"},unchanged:{background:"#29313b",border:"#8b949e"}},GJ={callable:{background:"#193652",border:"#5fa8ff"},type:{background:"#3d341b",border:"#e3b341"},module:{background:"#193b38",border:"#56d4b4"},boundary:{background:"#432b29",border:"#ff9b87"},other:{background:"#29313b",border:"#8b949e"}},FJ={execution:"#5fa8ff",dependency:"#56d4b4",structure:"#e3b341",flow:"#ff9b87",other:"#60728b"},VJ=200,UJ=1500,qx=.1,YJ=3,HJ=18,KJ=96,WJ=1500;function QJ(n,e){const t=[...e].sort().slice(0,WJ),i=n.getPositions(t),o=Object.values(i),r=o.length===0?0:Math.max(Math.max(...o.map(({x:l})=>l))-Math.min(...o.map(({x:l})=>l)),Math.max(...o.map(({y:l})=>l))-Math.min(...o.map(({y:l})=>l))),A=Math.min(KJ,Math.max(HJ,r*.012)),I=Math.PI*(3-Math.sqrt(5));t.forEach((l,c)=>{const h=i[l];if(!h)return;const p=c*I;n.moveNode(l,h.x+Math.cos(p)*A,h.y+Math.sin(p)*A)})}function Hs(n){return window.matchMedia("(prefers-reduced-motion: reduce)").matches?!1:{duration:n,easingFunction:"easeInOutQuad"}}const XJ={autoResize:!0,interaction:{hover:!0,tooltipDelay:100,hideEdgesOnDrag:!0,navigationButtons:!1,keyboard:{enabled:!0}},layout:{improvedLayout:!0},nodes:{borderWidth:1.5,shape:"dot"},edges:{arrows:{to:{enabled:!0,scaleFactor:.5}},smooth:{enabled:!0,type:"continuous",roundness:.2},selectionWidth:3},physics:{enabled:!0,solver:"forceAtlas2Based",stabilization:{enabled:!0,iterations:200,fit:!0,updateInterval:20},forceAtlas2Based:{gravitationalConstant:-60,centralGravity:.005,springLength:120,springConstant:.08,damping:.4,avoidOverlap:.8}}},$J={autoResize:!0,interaction:{hover:!0,tooltipDelay:100,hideEdgesOnDrag:!0,navigationButtons:!1,keyboard:{enabled:!0}},layout:{improvedLayout:!0,randomSeed:17},nodes:{borderWidth:2,shape:"dot"},edges:{arrows:{to:{enabled:!0,scaleFactor:.38}},smooth:{enabled:!0,type:"continuous",roundness:.14},selectionWidth:3},physics:{enabled:!0,solver:"barnesHut",stabilization:{enabled:!0,iterations:520,fit:!0,updateInterval:25},maxVelocity:35,minVelocity:.55,barnesHut:{theta:.45,gravitationalConstant:-12e3,centralGravity:.12,springLength:180,springConstant:.025,damping:.3,avoidOverlap:.85}}},qJ={autoResize:!0,interaction:{hover:!0,tooltipDelay:100,hideEdgesOnDrag:!0,hideEdgesOnZoom:!0,hoverConnectedEdges:!1,selectConnectedEdges:!1,navigationButtons:!1,keyboard:{enabled:!0}},layout:{improvedLayout:!1,randomSeed:17},nodes:{borderWidth:1.5,shape:"dot"},edges:{arrows:{to:{enabled:!1}},chosen:!1,smooth:!1,selectionWidth:3},physics:{enabled:!1,solver:"barnesHut"}};function Jx(n,e,t,i,o,r){const A=e.change&&i?i[e.change]:void 0,I=r?.[cs(e.kind)],l=A?A.background:I?.background??e.color?.background??o?.get(e.community)??n.communities.find(c=>c.id===e.community)?.color??"#6688aa";return{background:l,border:t??A?.border??I?.border??e.color?.border??l}}function _t(n,e){return typeof window>"u"?e:getComputedStyle(document.documentElement).getPropertyValue(n).trim()||e}function JJ(n){return n==="extracted"?{dashes:!1,width:2,opacity:.7}:n==="ambiguous"?{dashes:[3,4],width:2,opacity:.62}:n==="aggregated"?{dashes:!1,width:1,opacity:.2}:{dashes:!0,width:1,opacity:.35}}function e2(n,e,t,i){if(n==="added")return{color:i.added.border,dashes:!1,width:1.7,opacity:.6};if(n==="removed")return{color:i.removed.border,dashes:[6,5],width:1.6,opacity:.56};if(n==="changed")return{color:i.changed.border,dashes:!1,width:1.65,opacity:.48};if(n==="unchanged")return{color:i.unchanged.border,dashes:!0,width:1,opacity:.2};const o=JJ(e);return{color:t,...o}}function eee(n){return n==="added"?{enabled:!0,type:"curvedCW",roundness:.13}:n==="removed"?{enabled:!0,type:"curvedCCW",roundness:.13}:{enabled:!0,type:"continuous",roundness:.1}}function tee(n){const e=new Map;for(const r of[...n].sort((A,I)=>A.id.localeCompare(I.id))){const A=r.change??"unchanged",I=e.get(A)??[];I.push(r),e.set(A,I)}const t={added:-300,changed:0,removed:300,unchanged:0},i=new Map,o=Math.PI*(3-Math.sqrt(5));for(const[r,A]of e)A.forEach((I,l)=>{const c=l*o,h=r==="unchanged"?210+Math.sqrt(l)*34:42+Math.sqrt(l)*40;i.set(I.id,{x:t[r]+Math.cos(c)*h,y:Math.sin(c)*h})});return i}function nee(){const[n,e]=B.useState(0);return B.useEffect(()=>{const t=()=>e(r=>r+1),i=new MutationObserver(t);i.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style"]}),i.observe(document.body,{attributes:!0,attributeFilter:["class","style"]});const o=window.matchMedia("(prefers-color-scheme: dark)");return o.addEventListener("change",t),()=>{i.disconnect(),o.removeEventListener("change",t)}},[]),n}function Lu(n){const e=n.match(/^#([\da-f]{3}|[\da-f]{6})$/i)?.[1];if(e){const i=e.length===3?[...e].map(o=>`${o}${o}`).join(""):e;return[Number.parseInt(i.slice(0,2),16),Number.parseInt(i.slice(2,4),16),Number.parseInt(i.slice(4,6),16)]}const t=n.match(/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)/i);if(t)return[Number.parseFloat(t[1]??"0"),Number.parseFloat(t[2]??"0"),Number.parseFloat(t[3]??"0")]}function iee(n,e,t){const i=Lu(n),o=Lu(e);if(!i||!o)return e;const r=i.map((A,I)=>Math.round(A*(1-t)+o[I]*t));return`rgb(${r[0]}, ${r[1]}, ${r[2]})`}function t2(n){const e=Lu(n);return e?(e[0]*299+e[1]*587+e[2]*114)/1e3<145:!0}function Ks(n,e,t,i=!1){return{background:iee(n,e,i?t?.18:.1:t?.26:.14),border:e}}const gee=B.forwardRef(function({model:e,focusedNodeId:t,physicsRunning:i,layoutStyle:o="automatic",initialPositions:r,forceLabels:A,showEdgeLabels:I=!1,isolatedNodeIds:l,isolatedEdgeIds:c,layoutSpacing:h=1,showMinimap:p=!1,semanticDetail:m=!1,hiddenCommunities:b,hiddenChanges:w,onFocus:O,onOpenSource:x,onOpenRelationshipSource:S,onInteractionStart:E=()=>{},onHover:_,onHoverEdge:j,onClear:X,onStabilized:ne},F){const V=B.useRef(null),Ie=B.useRef(null),[Ee,Ze]=B.useState(null),xe=B.useRef(i);xe.current=i;const He=B.useRef(i),Fe=B.useRef({onFocus:O,onOpenSource:x,onOpenRelationshipSource:S,onInteractionStart:E,onHover:_,onHoverEdge:j,onClear:X});Fe.current={onFocus:O,onOpenSource:x,onOpenRelationshipSource:S,onInteractionStart:E,onHover:_,onHoverEdge:j,onClear:X};const le=B.useRef(ne);le.current=ne;const M=B.useRef(null),Q=B.useRef(h),W=nee(),ge=B.useMemo(()=>NJ(e),[e.edges.length,e.nodes.length]),ee=B.useMemo(()=>Wx(e),[e]),T=B.useMemo(()=>new Set(e.nodes.filter(Y=>!b.has(Y.community)&&!w.has(Y.change??"unchanged")&&(!l||l.has(Y.id))).map(Y=>Y.id)),[w,b,l,e.nodes]),U=B.useMemo(()=>new Set(ee.filter(Y=>T.has(Y.source)&&T.has(Y.target)&&(!c||c.has(Y.id))).map(Y=>Y.id)),[c,ee,T]),ie=B.useRef(T);ie.current=T;const ae=B.useCallback(()=>{const Y=Ie.current,Ae=V.current;if(!Y||!Ae)return;const Xe=Y.getPositions([...ie.current].sort().slice(0,UJ)),Et=Y.getViewPosition(),wt=Math.max(qx,Y.getScale()),Mn=Math.max(1,Ae.clientWidth)/wt,EI=Math.max(1,Ae.clientHeight)/wt;Ze({positions:new Map(Object.entries(Xe)),viewport:{left:Et.x-Mn/2,top:Et.y-EI/2,width:Mn,height:EI}})},[]),ue=B.useMemo(()=>{let Y=1;for(const Ae of e.nodes)Y=Math.max(Y,Ae.degree??1);return Y},[e.nodes]),me=B.useMemo(()=>new Map(e.communities.map(Y=>[Y.id,Y.color])),[e.communities]),Be=B.useMemo(()=>_t("--vscode-editor-foreground",_t("--foreground","#eef5ff")),[W]),ut=B.useMemo(()=>_t("--vscode-descriptionForeground",_t("--muted-foreground","#60728b")),[W]),_e=B.useMemo(()=>_t("--vscode-editor-foreground",_t("--foreground","#d8e4f2")),[W]),en=B.useMemo(()=>{const Y=_t("--vscode-editor-background",_t("--background","#08111f")),Ae=t2(Y);return{added:Ks(Y,_t("--vscode-gitDecoration-addedResourceForeground",Ae?"#56d364":"#1a7f37"),Ae),removed:Ks(Y,_t("--vscode-gitDecoration-deletedResourceForeground",Ae?"#ff7b72":"#cf222e"),Ae),changed:Ks(Y,_t("--vscode-gitDecoration-modifiedResourceForeground",Ae?"#d7a72b":"#9a6700"),Ae),unchanged:Ks(Y,_t("--vscode-descriptionForeground",Ae?"#8b949e":"#656d76"),Ae,!0)}},[W]),fn=B.useMemo(()=>{const Y=_t("--vscode-editor-background",_t("--background","#08111f")),Ae=t2(Y),Xe=(Et,wt,Mn)=>Ks(Y,_t(Et,Ae?wt:Mn),Ae);return{callable:Xe("--vscode-symbolIcon-functionForeground","#5fa8ff","#0969da"),type:Xe("--vscode-symbolIcon-classForeground","#e3b341","#9a6700"),module:Xe("--vscode-symbolIcon-moduleForeground","#56d4b4","#168b76"),boundary:Xe("--vscode-symbolIcon-eventForeground","#ff9b87","#cf4c35"),other:Ks(Y,_t("--vscode-descriptionForeground",Ae?"#8b949e":"#656d76"),Ae,!0)}},[W]),R=B.useMemo(()=>({execution:_t("--vscode-symbolIcon-functionForeground","#5fa8ff"),dependency:_t("--vscode-symbolIcon-moduleForeground","#56d4b4"),structure:_t("--vscode-symbolIcon-classForeground","#e3b341"),flow:_t("--vscode-symbolIcon-eventForeground","#ff9b87"),other:ut}),[ut,W]),de=B.useMemo(()=>e.nodes.some(Y=>Y.change!==void 0)||e.edges.some(Y=>Y.change!==void 0),[e.edges,e.nodes]),Te=B.useMemo(()=>new Set(de?e.nodes.filter(Y=>Y.change!=="unchanged").sort((Y,Ae)=>(Ae.degree??0)-(Y.degree??0)||Y.id.localeCompare(Ae.id)).slice(0,12).map(Y=>Y.id):ge==="static"?[...e.nodes].sort((Y,Ae)=>(Ae.degree??0)-(Y.degree??0)||Y.id.localeCompare(Ae.id)).slice(0,20).map(Y=>Y.id):[]),[de,e.nodes,ge]),Je=B.useMemo(()=>ge==="static"?new Set([...e.nodes].sort((Y,Ae)=>(Ae.degree??0)-(Y.degree??0)||Y.id.localeCompare(Ae.id)).slice(0,VJ).map(Y=>Y.id)):new Set,[e.nodes,ge]),Dt=B.useMemo(()=>de?tee(e.nodes):new Map,[de,e.nodes]),Bt=o==="automatic"?1:h,re=B.useMemo(()=>o==="automatic"?new Map:MJ(e.nodes,o,e.stats.aggregated),[o,e.nodes,e.stats.aggregated]),Me=B.useMemo(()=>ge==="static"&&!de?DJ(e.nodes,e.stats.aggregated):new Map,[de,e.nodes,e.stats.aggregated,ge]),ke=B.useMemo(()=>typeof document>"u"?void 0:document.body.classList.contains("vscode-high-contrast")||document.body.classList.contains("vscode-high-contrast-light")?_t("--vscode-contrastBorder","#ffffff"):void 0,[W]),Lt=B.useMemo(()=>new Vs(e.nodes.map(Y=>{const Ae=Y.size??Math.min(40,10+30*(Y.degree??1)/ue),Xe=de?Y.change==="unchanged"?7+5*Math.sqrt((Y.degree??1)/ue):11+12*Math.sqrt((Y.degree??1)/ue):Ae,Et=re.get(Y.id)??Dt.get(Y.id)??r?.get(Y.id)??Me.get(Y.id),wt=Et?{x:Et.x*Bt,y:Et.y*Bt}:void 0;return{id:Y.id,label:Y.label,color:Jx(e,Y,void 0,$x,me,m?GJ:void 0),shape:m?D_(cs(Y.kind)):"dot",size:Xe,...wt??{},opacity:Y.change==="unchanged"?.58:1,font:{color:"#eef5ff",face:"system-ui",size:de||ge==="static"?Te.has(Y.id)?12:0:(Y.degree??1)>=ue*.15?12:0}}})),[Te,de,Dt,me,r,Bt,ue,e,ge,m,re,Me]),En=B.useMemo(()=>new Vs(ee.map(Y=>{const Ae=e2(Y.change,Y.confidence,m?FJ[hc(Y.relation)]:"#60728b",$x);return{id:Y.id,from:Y.source,to:Y.target,dashes:Ae.dashes,width:Ae.width,...de&&ge!=="static"?{smooth:eee(Y.change)}:{},color:{color:Ae.color,opacity:Ae.opacity}}})),[de,ee,ge,m]);return B.useEffect(()=>{const Y=V.current;if(!Y)return;M.current=null;const Ae=new ve(Y,{nodes:Lt,edges:En},ge==="static"?qJ:de?$J:XJ);Ae.setOptions({physics:{enabled:xe.current}}),xe.current||Ae.stopSimulation(),Ie.current=Ae,SJ(Ae,{onFocus:wt=>Fe.current.onFocus(wt),onOpenSource:wt=>Fe.current.onOpenSource(wt),onOpenRelationshipSource:wt=>Fe.current.onOpenRelationshipSource(wt),onInteractionStart:()=>{xe.current&&Ae.stopSimulation(),Fe.current.onInteractionStart()},onHover:wt=>Fe.current.onHover(wt),onHoverEdge:wt=>Fe.current.onHoverEdge(wt),onClear:()=>Fe.current.onClear()}),Ae.on("stabilizationIterationsDone",()=>{Ae.stopSimulation(),M.current={position:Ae.getViewPosition(),scale:Ae.getScale()},le.current(),ae()}),Ae.on("stabilized",ae),Ae.on("dragEnd",ae),Ae.on("zoom",ae),Ae.on("resize",ae),Ae.on("animationFinished",ae);const Xe=Dt.size>0||re.size>0||(r?.size??0)>0||Me.size>0;!xe.current&&Xe&&(Ae.stopSimulation(),Ae.fit({animation:!1}),M.current={position:Ae.getViewPosition(),scale:Ae.getScale()});const Et=window.setTimeout(ae,0);return()=>{window.clearTimeout(Et),Ae.destroy(),Ie.current=null}},[En,Lt,de,Dt,r,ge,re,Me,ae]),B.useEffect(()=>{const Y=Ie.current;if(!Y)return;const Ae=He.current;He.current=i,Y.setOptions({physics:{enabled:i}}),i?(Ae||QJ(Y,ie.current),Y.startSimulation()):Y.stopSimulation()},[En,Lt,i]),B.useEffect(()=>{const Y=Ie.current;if(!Y||o!=="automatic"||ge==="static")return;const Ae=Q.current;if(Q.current=h,Y.setOptions({physics:de?{barnesHut:{springLength:180*h}}:{forceAtlas2Based:{springLength:120*h}}}),!i&&Ae!==h){const Xe=h/Ae,Et=Y.getPositions();Lt.update(Object.entries(Et).map(([wt,Mn])=>({id:wt,x:Mn.x*Xe,y:Mn.y*Xe}))),Y.redraw(),ae()}},[de,h,o,Lt,i,ae,ge]),B.useEffect(()=>{Lt.update(e.nodes.map(Y=>({id:Y.id,hidden:!T.has(Y.id)}))),En.update(ee.map(Y=>({id:Y.id,hidden:!U.has(Y.id)}))),ae()},[En,ae,ee,e.nodes,Lt,U,T]),B.useEffect(()=>{const Y=Ie.current;if(!Y)return;const Ae=t?new Set(Y.getConnectedNodes(t).map(String)):new Set;if(Lt.update(e.nodes.map(Xe=>{const Et=Xe.id===t,wt=!t||Et||Ae.has(Xe.id),Mn=Xe.change==="unchanged"?.58:1;return{id:Xe.id,opacity:t?wt?Math.max(Mn,.72):.08:Mn,borderWidth:Et?4:ke?2.5:1.5,color:Jx(e,Xe,ke,en,me,m?fn:void 0),shadow:Et?{enabled:!0,color:Xe.change?en[Xe.change].border:m?fn[cs(Xe.kind)].border:Xe.color?.background??me.get(Xe.community)??"#76b7ff",size:24,x:0,y:0}:{enabled:!1}}})),En.update(ee.map(Xe=>{const Et=e2(Xe.change,Xe.confidence,m?R[hc(Xe.relation)]:ut,en),wt=Xe.source===t||Xe.target===t;return{id:Xe.id,dashes:Et.dashes,color:{color:Et.color,opacity:t?wt?.92:.05:Et.opacity},width:wt?Math.max(3,Et.width):Et.width}})),t)if(Y.selectNodes([t]),xe.current)Y.focus(t,{scale:1.35,animation:window.matchMedia("(prefers-reduced-motion: reduce)").matches?!1:{duration:260,easingFunction:"easeInOutQuad"}});else{const Xe=Y.getPositions([t])[t];Xe&&Y.moveTo({position:Xe,scale:1.35,animation:!1})}else Y.unselectAll()},[ke,en,me,ut,En,t,e,Lt,ee,m,R,fn]),B.useEffect(()=>{Lt.update(e.nodes.map(Y=>({id:Y.id,font:{color:Be,size:A&&(ge!=="static"||Je.has(Y.id))||Y.id===t||(de||ge==="static"?Te.has(Y.id):(Y.degree??1)>=ue*.15)?12:0}})))},[Te,de,Je,t,A,Be,ue,e.nodes,Lt,ge]),B.useEffect(()=>{En.update(ee.map(Y=>({id:Y.id,label:I?Y.relation:"",font:{align:"middle",color:_e,face:"system-ui",size:10,strokeWidth:3,strokeColor:_t("--vscode-editor-background",_t("--background","#08111f"))}})))},[En,_e,ee,I]),B.useImperativeHandle(F,()=>({fit(){Ie.current?.fit({animation:Hs(280)})},fitSelection(Y){const Ae=Ie.current;!Ae||Y.length===0||Ae.fit({nodes:[...new Set(Y)],animation:Hs(240)})},reset(){const Y=Ie.current,Ae=M.current;if(Y){if(!Ae){Y.fit({animation:!1});return}Y.moveTo({position:Ae.position,scale:Ae.scale,animation:!1})}},resetZoom(){Ie.current?.moveTo({scale:1,animation:Hs(180)})},zoomIn(){const Y=Ie.current;Y&&Y.moveTo({scale:Math.min(YJ,Y.getScale()*1.25),animation:Hs(160)})},zoomOut(){const Y=Ie.current;Y&&Y.moveTo({scale:Math.max(qx,Y.getScale()/1.25),animation:Hs(160)})}}),[]),f.jsxs(f.Fragment,{children:[f.jsx("div",{ref:V,className:"compass-canvas","data-rendering-profile":ge,"data-layout-style":o,"data-physics-running":i?"true":"false","data-isolated":l?"true":"false","data-layout-spacing":h,role:"region","aria-label":"Interactive Compass code graph",onMouseLeave:()=>{_(null),j(null)}}),p&&Ee?f.jsx(LJ,{model:e,snapshot:Ee,visibleNodeIds:T,visibleEdgeIds:U,focusedNodeId:t,semanticDetail:m,onNavigate:Y=>Ie.current?.moveTo({position:Y,animation:Hs(180)})}):null]})}),n2=1,i2=4;function oee(n){return Math.max(n2,Math.min(i2,Math.trunc(n)))}function see(n,e,t,i){const o=oee(t),r=new Map,A=new Map;for(const h of n.edges){const p=r.get(h.source)??[];p.push(h),r.set(h.source,p);const m=A.get(h.target)??[];m.push(h),A.set(h.target,m)}for(const h of[...r.values(),...A.values()])h.sort((p,m)=>p.id.localeCompare(m.id));const I=new Set([e]),l=new Set;let c=[e];for(let h=0;h0;h+=1){const p=new Set;for(const m of c.sort()){if(i!=="incoming")for(const b of r.get(m)??[])l.add(b.id),I.has(b.target)||p.add(b.target);if(i!=="outgoing")for(const b of A.get(m)??[])l.add(b.id),I.has(b.source)||p.add(b.source)}c=[...p];for(const m of c)I.add(m)}return{nodeIds:I,edgeIds:l}}const g2={focusedNodeId:null,physicsRunning:!1,layoutStyle:"automatic",initialLayoutPending:!1,forceLabels:!1,showEdgeLabels:!1,isolateSelection:!1,neighborhoodDepth:1,edgeDirection:"both",layoutSpacing:1,showMinimap:!0,hiddenCommunities:new Set,hiddenChanges:new Set,query:""};function ree(n,e="automatic"){return e!=="automatic"?{...g2,layoutStyle:e,physicsRunning:!1,initialLayoutPending:!1}:{...g2,physicsRunning:!1,initialLayoutPending:!1}}function aee(n,e){switch(e.type){case"focus":return{...n,focusedNodeId:e.nodeId,physicsRunning:!1};case"clearFocus":return{...n,focusedNodeId:null,isolateSelection:!1};case"stabilized":return n.physicsRunning||n.initialLayoutPending?{...n,physicsRunning:!1,initialLayoutPending:!1}:n;case"revealLayout":return{...n,physicsRunning:!1,initialLayoutPending:!1};case"setPhysics":return{...n,physicsRunning:e.running};case"setLayout":return{...n,layoutStyle:e.layout,physicsRunning:e.runPhysics,initialLayoutPending:!1};case"setLabels":return{...n,forceLabels:e.visible};case"setEdgeLabels":return{...n,showEdgeLabels:e.visible};case"setIsolation":return{...n,isolateSelection:e.isolated};case"setNeighborhoodDepth":return{...n,neighborhoodDepth:Math.max(1,Math.min(4,Math.trunc(e.depth)))};case"setEdgeDirection":return{...n,edgeDirection:e.direction};case"setLayoutSpacing":return{...n,layoutSpacing:e.spacing};case"setMinimap":return{...n,showMinimap:e.visible};case"search":return{...n,query:e.query};case"toggleCommunity":{const t=new Set(n.hiddenCommunities);return t.has(e.communityId)?t.delete(e.communityId):t.add(e.communityId),{...n,hiddenCommunities:t}}case"setHiddenCommunities":return{...n,hiddenCommunities:new Set(e.communityIds)};case"toggleChange":{const t=new Set(n.hiddenChanges);return t.has(e.change)?t.delete(e.change):t.add(e.change),{...n,hiddenChanges:t}}}}const Aee=[{value:"added",label:"Added"},{value:"removed",label:"Removed"},{value:"changed",label:"Changed"},{value:"unchanged",label:"Context"}],Cee={hierarchical:"Depth-layer layout",circle:"Circle layout",concentric:"Concentric layout",spiral:"Spiral layout",grid:"Square grid layout"},Gu=["both","outgoing","incoming"];function Iee(n){return n instanceof HTMLElement&&(n.isContentEditable||n.tagName==="INPUT"||n.tagName==="TEXTAREA"||n.tagName==="SELECT")}function Fu({model:n,host:e,communityDetail:t,communityLoading:i,communityError:o,onBackToOverview:r,sourceRevisions:A,queryResult:I,initialInspectorLayout:l,onInspectorLayoutChange:c,preferredLayout:h="automatic",toolbarLeading:p,toolbarLeadingPanel:m,toolbarLeadingOpen:b,onToolbarLeadingClose:w,stageOverlay:O,showInspectorHeader:x=!0}){const[S,E]=B.useState(()=>zv(l)),_=B.useCallback(ne=>{const F=zv(ne);E(F),c?.(F)},[c]),j=t?.model??n,X=t?`community-${t.communityId}`:"overview";return f.jsx(lee,{model:j,host:e,detailCommunityId:t?.communityId,communityLoading:i,communityError:o,onBackToOverview:t?r:void 0,bounded:t?.bounded,sourceRevisions:A,queryResult:I,inspectorLayout:S,onInspectorLayoutChange:_,preferredLayout:h,toolbarLeading:p,toolbarLeadingPanel:m,toolbarLeadingOpen:b,onToolbarLeadingClose:w,stageOverlay:O,showInspectorHeader:x},X)}function lee({model:n,host:e,detailCommunityId:t,communityLoading:i,communityError:o,onBackToOverview:r,bounded:A,sourceRevisions:I,queryResult:l,inspectorLayout:c,onInspectorLayoutChange:h,preferredLayout:p,toolbarLeading:m,toolbarLeadingPanel:b,toolbarLeadingOpen:w,onToolbarLeadingClose:O,stageOverlay:x,showInspectorHeader:S}){const[E,_]=B.useReducer(aee,n,re=>ree(re,p)),[j,X]=B.useState(null),[ne,F]=B.useState(null),V=B.useRef(null),Ie=B.useRef(e);Ie.current=e;const Ee=B.useMemo(()=>new Map(n.nodes.map(re=>[re.id,re])),[n.nodes]),Ze=B.useMemo(()=>new Map(n.edges.map(re=>[re.id,re])),[n.edges]),xe=B.useMemo(()=>{const re=new Map,Me=new Map;for(const ke of n.edges){const Lt=re.get(ke.source)??new Set;Lt.add(ke.target),re.set(ke.source,Lt);const En=re.get(ke.target)??new Set;En.add(ke.source),re.set(ke.target,En);const Y=Me.get(ke.source)??[];Y.push(ke),Me.set(ke.source,Y);const Ae=Me.get(ke.target)??[];Ae.push(ke),Me.set(ke.target,Ae)}return{neighborIds:re,edges:Me}},[n.edges]),He=B.useMemo(()=>n.nodes.map(re=>({node:re,text:[re.label,re.source?.file,re.kind].filter(Me=>Me!==void 0).join(` +`).toLocaleLowerCase()})),[n.nodes]),Fe=B.useMemo(()=>Wx(n).length,[n]),le=E.focusedNodeId?Ee.get(E.focusedNodeId):void 0,M=B.useMemo(()=>le?see(n,le.id,E.neighborhoodDepth,E.edgeDirection):null,[n,le,E.edgeDirection,E.neighborhoodDepth]),Q=j?Ee.get(j.nodeId):void 0,W=Q?kv(n,Q,t):void 0,ge=ne?Ze.get(ne.edgeId):void 0,ee=ge?Ee.get(ge.source):void 0,T=ge?Ee.get(ge.target):void 0,U=B.useMemo(()=>n.nodes.some(re=>re.change!==void 0)||n.edges.some(re=>re.change!==void 0),[n.edges,n.nodes]),ie=B.useMemo(()=>{const re=new Map;for(const Me of n.nodes){const ke=Me.change??"unchanged";re.set(ke,(re.get(ke)??0)+1)}return re},[n.nodes]),ae=B.useMemo(()=>le?[...xe.neighborIds.get(le.id)??[]].map(re=>Ee.get(re)).filter(re=>re!==void 0).sort((re,Me)=>re.label.localeCompare(Me.label)):[],[xe.neighborIds,Ee,le]),ue=B.useMemo(()=>le?xe.edges.get(le.id)??[]:[],[xe.edges,le]),me=B.useDeferredValue(E.query),Be=B.useMemo(()=>{const re=me.trim().toLocaleLowerCase();if(!re)return[];const Me=[];for(const ke of He)if(ke.text.includes(re)&&Me.push(ke.node),Me.length===20)break;return Me},[me,He]),ut=B.useCallback(re=>{X(null),F(null),_({type:"focus",nodeId:re})},[]),_e=B.useCallback(()=>{E.physicsRunning&&_({type:"setPhysics",running:!1})},[E.physicsRunning]),en=B.useCallback(()=>{X(null),F(null),_({type:"clearFocus"})},[]);B.useEffect(()=>{E.focusedNodeId&&!Ee.has(E.focusedNodeId)&&en()},[en,Ee,E.focusedNodeId]),B.useEffect(()=>{const re=Me=>{if(Me.metaKey||Me.ctrlKey||Me.altKey||Iee(Me.target))return;const ke=Me.key.toLocaleLowerCase();let Lt=!0;if(ke==="f")Me.shiftKey&&M?V.current?.fitSelection([...M.nodeIds]):Me.shiftKey?Lt=!1:V.current?.fit();else if(ke==="+"||ke==="=")V.current?.zoomIn();else if(ke==="-"||ke==="_")V.current?.zoomOut();else if(ke==="0")V.current?.resetZoom();else if(ke==="i"&&le)_({type:"setIsolation",isolated:!E.isolateSelection});else if(ke==="[")_({type:"setNeighborhoodDepth",depth:Math.max(n2,E.neighborhoodDepth-1)});else if(ke==="]")_({type:"setNeighborhoodDepth",depth:Math.min(i2,E.neighborhoodDepth+1)});else if(ke==="d"){const En=Gu.indexOf(E.edgeDirection);_({type:"setEdgeDirection",direction:Gu[(En+1)%Gu.length]??"both"})}else ke==="m"?_({type:"setMinimap",visible:!E.showMinimap}):Lt=!1;Lt&&Me.preventDefault()};return document.addEventListener("keydown",re,{capture:!0}),()=>document.removeEventListener("keydown",re,{capture:!0})},[le,M,E.edgeDirection,E.isolateSelection,E.neighborhoodDepth,E.showMinimap]);const fn=B.useCallback(()=>{_({type:"stabilized"})},[]),R=B.useCallback(()=>{_({type:"revealLayout"})},[]),de=B.useCallback(re=>{const Me=Ee.get(re);if(!Me)return;const ke=kv(n,Me,t);ke.type==="community"&&Ie.current.openCommunity?.(ke.communityId),ke.type==="source"&&Ie.current.openSource(ke.source,Me.change==="removed"?I?.before:I?.after)},[t,Ee,n.stats.aggregated,I?.after,I?.before]),Te=B.useCallback(re=>{const Me=Ze.get(re);if(!Me)return;const ke=bv(Me);ke&&Ie.current.openSource(ke,Me.change==="removed"?I?.before:I?.after)},[Ze,I?.after,I?.before]),Je=le&&E.isolateSelection&&M?`Isolated ${M.nodeIds.size} nodes · ${E.neighborhoodDepth} hop${E.neighborhoodDepth===1?"":"s"}`:le?`Inspecting ${le.label}`:E.layoutStyle!=="automatic"?Cee[E.layoutStyle]:E.physicsRunning?"Layout running":"Layout static",Dt=i!=null?n.communities.find(re=>re.id===i):void 0,Bt=i!=null?{kind:"community",communityLabel:Dt?.label??`Community ${i}`}:E.initialLayoutPending?{kind:"layout"}:null;return f.jsxs("div",{className:"compass-workspace",style:{"--compass-inspector-width":`${c.width}px`},children:[f.jsxs("div",{className:"compass-workspace-content","data-inspector-collapsed":c.collapsed,inert:Bt?!0:void 0,"aria-hidden":Bt?!0:void 0,children:[f.jsxs("main",{className:"compass-graph-stage","data-comparison":U?"true":"false",children:[f.jsx(gee,{ref:V,model:n,focusedNodeId:le?.id??null,physicsRunning:E.physicsRunning,layoutStyle:E.layoutStyle,forceLabels:E.forceLabels,showEdgeLabels:E.showEdgeLabels,isolatedNodeIds:E.isolateSelection?M?.nodeIds:void 0,isolatedEdgeIds:E.isolateSelection?M?.edgeIds:void 0,layoutSpacing:E.layoutSpacing,showMinimap:E.showMinimap,semanticDetail:t!==void 0&&!U,hiddenCommunities:E.hiddenCommunities,hiddenChanges:E.hiddenChanges,onFocus:ut,onOpenSource:de,onOpenRelationshipSource:Te,onInteractionStart:_e,onHover:X,onHoverEdge:F,onClear:en,onStabilized:fn}),x,f.jsx(m_,{status:Je,physicsRunning:E.physicsRunning,layoutStyle:E.layoutStyle,forceLabels:E.forceLabels,showEdgeLabels:E.showEdgeLabels,hasSelection:le!==void 0,isolateSelection:E.isolateSelection,neighborhoodDepth:E.neighborhoodDepth,edgeDirection:E.edgeDirection,layoutSpacing:E.layoutSpacing,showMinimap:E.showMinimap,leadingControls:m,leadingPanel:b,leadingPanelOpen:w,onLeadingPanelClose:O,onTogglePhysics:()=>_({type:"setPhysics",running:!E.physicsRunning}),onLayoutChange:re=>_({type:"setLayout",layout:re,runPhysics:!1}),onZoomOut:()=>V.current?.zoomOut(),onResetZoom:()=>V.current?.resetZoom(),onZoomIn:()=>V.current?.zoomIn(),onFit:()=>V.current?.fit(),onFitSelection:()=>{M&&V.current?.fitSelection([...M.nodeIds])},onReset:()=>{en(),_({type:"setIsolation",isolated:!1}),V.current?.reset()},onToggleLabels:()=>_({type:"setLabels",visible:!E.forceLabels}),onToggleEdgeLabels:()=>_({type:"setEdgeLabels",visible:!E.showEdgeLabels}),onToggleIsolation:()=>{const re=!E.isolateSelection;_({type:"setIsolation",isolated:re}),re&&M&&window.requestAnimationFrame(()=>{V.current?.fitSelection([...M.nodeIds])})},onNeighborhoodDepthChange:re=>_({type:"setNeighborhoodDepth",depth:re}),onEdgeDirectionChange:re=>_({type:"setEdgeDirection",direction:re}),onLayoutSpacingChange:re=>_({type:"setLayoutSpacing",spacing:re}),onToggleMinimap:()=>_({type:"setMinimap",visible:!E.showMinimap}),onBack:r}),U&&f.jsx("div",{className:"compass-change-legend","aria-label":"Graph change filters",children:Aee.filter(({value:re})=>(ie.get(re)??0)>0).map(({value:re,label:Me})=>{const ke=!E.hiddenChanges.has(re);return f.jsxs("button",{type:"button","data-change":re,"aria-pressed":ke,onClick:()=>_({type:"toggleChange",change:re}),children:[f.jsx("span",{"aria-hidden":"true"}),Me,f.jsx("small",{children:ie.get(re)??0})]},re)})}),t!==void 0&&!U?f.jsx(k_,{model:n}):null,o&&f.jsx("div",{className:"absolute bottom-4 left-4 z-20 max-w-md rounded-md border border-destructive/50 bg-background/95 px-3 py-2 text-sm text-destructive shadow-lg",role:"alert",children:o}),A&&f.jsxs("div",{className:"compass-bounded-notice",role:"status",children:[f.jsx("strong",{children:"Partial community comparison"}),f.jsxs("span",{children:["This view is limited to ",A.limit.toLocaleString()," nodes. Increase"," ",f.jsx("code",{children:"compass.graphNodeLimit"})," to inspect all"," ",Math.max(A.parentMembers,A.currentMembers).toLocaleString()," symbols."]})]}),j&&Q&&W&&f.jsx(B_,{node:Q,hover:j,activation:W}),ne&&ge&&ee&&T&&f.jsx(Y_,{edge:ge,sourceNode:ee,targetNode:T,hover:ne})]}),!c.collapsed&&f.jsx(Z_,{width:c.width,onResize:re=>h({...c,width:re})}),f.jsx(u_,{model:n,selected:le,neighbors:ae,connectedEdges:ue,query:E.query,matches:Be,hiddenCommunities:E.hiddenCommunities,comparisonMode:U,sourceRevisions:I,queryResult:l,renderedEdgeCount:Fe,showHeader:S,onQueryChange:re=>_({type:"search",query:re}),onFocus:ut,onOpenSource:e.openSource,onOpenCommunity:t===void 0?e.openCommunity:void 0,onQueryNode:e.queryNode,onToggleCommunity:re=>_({type:"toggleCommunity",communityId:re}),onSetAllVisible:re=>_({type:"setHiddenCommunities",communityIds:re?[]:n.communities.map(Me=>Me.id)}),collapsed:c.collapsed,onToggleCollapsed:()=>h({...c,collapsed:!c.collapsed})})]}),Bt?.kind==="community"?f.jsx(Ov,{kind:"community",communityLabel:Bt.communityLabel}):Bt?.kind==="layout"?f.jsx(Ov,{kind:"layout",onShowGraph:R}):null]})}const Vu=224,cee=76,pI=124,Uu=96,Ws=96,dee=288,uee=112,Yu=12;function hee(n,e,t={width:1280,height:620},i={},o){const r=n.filter(F=>F.nodeCount>0||F.incomingRelationships>0||F.outgoingRelationships>0);if(r.length===0)return{width:t.width,height:t.height,nodes:[],routes:[],lanes:[]};const A=new Set(r.map(F=>F.id)),I=e.filter(F=>A.has(F.sourceGroup)&&A.has(F.targetGroup)),l=fee(r,I),c=l.length,h=Math.max(t.width,Ws*2+dee*c),p=(h-Ws*2)/c;vee(l,I);const m=Math.max(...l.map(F=>F.length)),b=Math.max(t.height,pI+Uu+m*uee),w=l.findIndex(F=>F.some(V=>V.id===o)),O=Array.from({length:c},(F,V)=>({index:V,x:Ws+p*V,width:p,label:Eee(V,c,w<0?void 0:w)})),x=b-pI-Uu,S=l.flatMap((F,V)=>{const Ie=x/Math.max(1,F.length);return F.map((Ee,Ze)=>{const xe={x:Ws+p*V+p/2,y:pI+Ie*Ze+Ie/2},He=i[Ee.id]??xe;return{...Ee,x:Hu(He.x,Ws+Vu/2,h-Ws-Vu/2),y:Hu(He.y,pI,b-Uu),width:Math.min(Vu,p-40),height:cee,column:xee(He.x,O)}})}),E=new Map(S.map(F=>[F.id,F])),_=yee(I,E),j=a2(I,E,"source"),X=a2(I,E,"target"),ne=I.flatMap(F=>{const V=E.get(F.sourceGroup),Ie=E.get(F.targetGroup);if(!V||!Ie)return[];const Ee=A2(V,Ie);return[{...F,direction:Ee,path:bee(V,Ie,Ee,_.get(F.id)??0,{height:b},j.get(F.id)??0,X.get(F.id)??0),width:1+Math.min(4.4,Math.log10(F.relationships+1)*1.35)}]});return{width:h,height:b,nodes:S,routes:ne,lanes:O}}function fee(n,e){if(n.length===1)return[[n[0]]];if(e.length===0)return o2(n);const t=pee(n,e),i=new Map(t.map((c,h)=>[c.id,h])),o=new Map;for(const c of n)o.set(c.id,[]);for(const c of e)(i.get(c.sourceGroup)??0)<(i.get(c.targetGroup)??0)&&c.sourceGroup!==c.targetGroup&&o.get(c.targetGroup)?.push(c);const r=new Map;for(const c of t){const h=(o.get(c.id)??[]).map(p=>(r.get(p.sourceGroup)??0)+1);r.set(c.id,h.length>0?Math.max(...h):0)}const A=Math.max(0,...r.values()),I=Math.min(Yu,A+1);if(I===1)return o2(n);const l=Array.from({length:I},()=>[]);for(const c of t){const h=r.get(c.id)??0,p=Ac.length>0)}function pee(n,e){const t=new Map(n.map(A=>[A.id,A])),i=new Set(t.keys()),o=[],r=[];for(;i.size>0;){const A=mee(i,e),I=[...i].map(p=>({section:t.get(p),incoming:A.incoming.get(p)??0,outgoing:A.outgoing.get(p)??0})),l=I.filter(p=>p.incoming===0),c=I.filter(p=>p.outgoing===0);if(l.length>0){const p=l.sort((m,b)=>b.outgoing-m.outgoing||Va(m.section,b.section))[0];o.push(p.section),i.delete(p.section.id);continue}if(c.length>0){const p=c.sort((m,b)=>b.incoming-m.incoming||Va(m.section,b.section))[0];r.unshift(p.section),i.delete(p.section.id);continue}const h=I.sort((p,m)=>m.outgoing-m.incoming-(p.outgoing-p.incoming)||m.outgoing+m.incoming-(p.outgoing+p.incoming)||Va(p.section,m.section))[0];o.push(h.section),i.delete(h.section.id)}return[...o,...r]}function mee(n,e){const t=new Map,i=new Map;for(const o of e){if(o.sourceGroup===o.targetGroup||!n.has(o.sourceGroup)||!n.has(o.targetGroup))continue;const r=1+Math.log10(o.relationships+1);i.set(o.sourceGroup,(i.get(o.sourceGroup)??0)+r),t.set(o.targetGroup,(t.get(o.targetGroup)??0)+r)}return{incoming:t,outgoing:i}}function o2(n){const e=Math.min(6,Math.max(2,Math.ceil(Math.sqrt(n.length)))),t=Array.from({length:e},()=>[]);return[...n].sort(Va).forEach((i,o)=>{t[Math.floor(o*e/n.length)].push(i)}),t}function vee(n,e){const t=new Map;for(const i of e)s2(t,i.sourceGroup,i.targetGroup,i.relationships),s2(t,i.targetGroup,i.sourceGroup,i.relationships);for(let i=0;i<8;i+=1)for(const o of[1,-1]){const r=o===1?1:n.length-2,A=o===1?n.length:-1;for(let I=r;I!==A;I+=o){const l=new Map,c=o===1?n.slice(0,I):n.slice(I+1);for(const p of c)p.forEach((m,b)=>{l.set(m.id,p.length===1?.5:b/(p.length-1))});const h=new Map(n[I].map((p,m,b)=>[p.id,b.length===1?.5:m/(b.length-1)]));n[I].sort((p,m)=>{const b=r2(p.id,t,l),w=r2(m.id,t,l);return(b??h.get(p.id)??.5)-(w??h.get(m.id)??.5)||Va(p,m)})}}}function s2(n,e,t,i){const o=n.get(e)??new Map;o.set(t,(o.get(t)??0)+i),n.set(e,o)}function r2(n,e,t){let i=0,o=0;for(const[r,A]of e.get(n)??[]){const I=t.get(r);I!==void 0&&(i+=I*A,o+=A)}return o>0?i/o:void 0}function bee(n,e,t,i,o,r,A){const I=n.y+r,l=e.y+A;if(t==="forward"){const w=n.x+n.width/2,O=e.x-e.width/2,x=Math.max(1,O-w),S=Hu(x*.42,42,168),E=See(i%9,1.5);return[`M ${w} ${I}`,`C ${w+S} ${I+E}`,`${O-S} ${l+E}`,`${O} ${l}`].join(" ")}if(t==="backward"){const w=n.x-n.width/2,O=e.x+e.width/2,x=(I+l)/2{const I=e.get(r.sourceGroup),l=e.get(A.sourceGroup),c=e.get(r.targetGroup),h=e.get(A.targetGroup);return(I?.column??0)-(l?.column??0)||(c?.column??0)-(h?.column??0)||(I?.y??0)-(l?.y??0)||(c?.y??0)-(h?.y??0)||A.relationships-r.relationships||r.id.localeCompare(A.id)});for(const r of o){const A=e.get(r.sourceGroup),I=e.get(r.targetGroup);if(!A||!I)continue;const l=A2(A,I),c=`${Math.min(A.column,I.column)}:${Math.max(A.column,I.column)}:${l}`,h=i.get(c)??0;t.set(r.id,h),i.set(c,h+1)}return t}function a2(n,e,t){const i=new Map;for(const r of n){const A=t==="source"?r.sourceGroup:r.targetGroup,I=i.get(A)??[];I.push(r),i.set(A,I)}const o=new Map;for(const r of i.values()){r.sort((I,l)=>{const c=e.get(t==="source"?I.targetGroup:I.sourceGroup),h=e.get(t==="source"?l.targetGroup:l.sourceGroup);return(c?.y??0)-(h?.y??0)||(c?.x??0)-(h?.x??0)||I.id.localeCompare(l.id)});const A=Math.min(8,38/Math.max(1,r.length-1));r.forEach((I,l)=>{o.set(I.id,(l-(r.length-1)/2)*A)})}return o}function wee(n,e,t,i,o){const r=Math.sign(i-e)||1,A=Math.sign(o-t)||1,I=Math.min(12,Math.abs(i-e)/2,Math.abs(t-n)/2);return[`M ${n} ${e}`,`H ${t-Math.sign(t-n)*I}`,`Q ${t} ${e} ${t} ${e+r*I}`,`V ${i-r*I}`,`Q ${t} ${i} ${t+A*I} ${i}`,`H ${o}`].join(" ")}function A2(n,e){return e.column>n.column?"forward":e.columnI2(o)),I=B.useRef(r),[l,c]=B.useState(1),[h,p]=B.useState("none"),m=B.useRef("none"),b=B.useRef(0),[w,O]=B.useState(Oee),[x,S]=B.useState("key"),[E,_]=B.useState(),j=B.useRef(null),X=B.useRef(void 0),ne=B.useRef(void 0);B.useEffect(()=>{const R=I2(o);I.current=R,A(R),c(1),m.current="start",b.current=0,p("start"),j.current?.scrollTo?.({left:0,top:0}),S("key")},[o]);const F=B.useMemo(()=>Mee(n.routes,e),[n.routes,e]),V=B.useMemo(()=>x==="complete"?{routes:n.routes,reciprocals:new Map}:Ree(n.routes.filter(R=>F.has(R.id)),e?.kind==="route"?e.id:void 0),[F,n.routes,x,e]),Ie=V.routes,Ee=B.useMemo(()=>{if(x==="complete"||e===void 0)return n.groups;const R=new Set;e.kind==="group"&&R.add(e.id);for(const de of Ie)R.add(de.sourceGroup),R.add(de.targetGroup);return n.groups.filter(de=>R.has(de.id))},[n.groups,x,Ie,e]),Ze=B.useMemo(()=>hee(Ee,Ie,w,r,x==="key"&&e?.kind==="group"?e.id:void 0),[Ee,r,x,Ie,e,w]),xe=Ze.routes,He=B.useMemo(()=>e?.kind!=="group"?new Set:new Set(xe.filter(R=>R.sourceGroup===e.id||R.targetGroup===e.id).flatMap(R=>[R.id,R.sourceGroup,R.targetGroup])),[xe,e]),Fe=Math.max(1,...xe.map(R=>R.relationships)),le=n.routes.length-xe.length,M={width:Math.round(Ze.width*l),height:Math.round(Ze.height*l)},Q=R=>{t(R)},W=(R,de)=>{(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),Q(de))},ge=(R,de)=>{const Te={...I.current,[R]:de};I.current=Te,A(Te)},ee=()=>{try{window.localStorage.setItem(o,JSON.stringify(I.current))}catch{}},T=()=>{I.current={},A({});try{window.localStorage.removeItem(o)}catch{}},U=()=>{c(1),m.current="start",b.current=0,p("start");const R=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;j.current?.scrollTo?.({left:0,top:0,behavior:R?"auto":"smooth"})},ie=R=>{const de=Math.max(0,R.scrollWidth-R.clientWidth),Te=de<=1?"none":R.scrollLeft<=1?"start":R.scrollLeft>=de-1?"end":"middle";b.current=de,m.current=Te,p(Je=>Je===Te?Je:Te)},ae=R=>{ie(R.currentTarget)},ue=R=>{R.target!==R.currentTarget||!j.current||(X.current={x:R.clientX,y:R.clientY,scrollLeft:j.current.scrollLeft,scrollTop:j.current.scrollTop,pointerId:R.pointerId},R.currentTarget.setPointerCapture(R.pointerId))},me=R=>{const de=X.current,Te=j.current;!de||!Te||de.pointerId!==R.pointerId||(Te.scrollLeft=de.scrollLeft-(R.clientX-de.x),Te.scrollTop=de.scrollTop-(R.clientY-de.y))},Be=R=>{X.current?.pointerId===R.pointerId&&(X.current=void 0,R.currentTarget.hasPointerCapture(R.pointerId)&&R.currentTarget.releasePointerCapture(R.pointerId))},ut=(R,de)=>{R.stopPropagation();const Te=C2(R.currentTarget.ownerSVGElement,R);Te&&(ne.current={id:de.id,pointerId:R.pointerId,offsetX:Te.x-de.x,offsetY:Te.y-de.y,startClientX:R.clientX,startClientY:R.clientY,moved:!1},_(de.id),R.currentTarget.setPointerCapture(R.pointerId))},_e=(R,de)=>{const Te=ne.current;!Te||Te.id!==de.id||Te.pointerId!==R.pointerId||(R.currentTarget.hasPointerCapture(R.pointerId)&&R.currentTarget.releasePointerCapture(R.pointerId),ne.current=void 0,_(void 0),Te.moved?ee():Q({kind:"group",id:de.id}))},en=R=>{ne.current?.pointerId===R.pointerId&&(ne.current=void 0,_(void 0))},fn=(R,de)=>{if(R.key==="Enter"||R.key===" "){R.preventDefault(),Q({kind:"group",id:de.id});return}if(!R.altKey||!R.key.startsWith("Arrow"))return;R.preventDefault();const Te=R.shiftKey?24:8;ge(de.id,{x:de.x+(R.key==="ArrowRight"?Te:R.key==="ArrowLeft"?-Te:0),y:de.y+(R.key==="ArrowDown"?Te:R.key==="ArrowUp"?-Te:0)}),ee()};return B.useEffect(()=>{const R=j.current;if(!R)return;const de=()=>{const Je=b.current,Dt=Math.max(0,R.scrollWidth-R.clientWidth),Bt=Je>1&&R.scrollLeft>=Je-1;if(Dt>Je&&(m.current==="end"||Bt)&&(R.scrollLeft=Dt),ie(R),R.clientWidth<=0||R.clientHeight<=0)return;const re={width:Math.round(R.clientWidth),height:Math.round(R.clientHeight)};O(Me=>Me.width===re.width&&Me.height===re.height?Me:re)};if(de(),typeof ResizeObserver>"u")return;const Te=new ResizeObserver(de);return Te.observe(R),()=>Te.disconnect()},[M.height,M.width]),f.jsxs("section",{className:"architecture-map-panel","aria-labelledby":"architecture-map-title","data-route-mode":x,children:[f.jsxs("header",{className:"architecture-map-header",children:[f.jsxs("div",{className:"architecture-map-intro",children:[f.jsx("span",{children:"Flow canvas"}),f.jsx("strong",{id:"architecture-map-title",children:"Subsystem relationship direction"}),f.jsx("small",{id:"architecture-map-help",children:"Scroll sideways or drag open canvas space to follow the complete architecture."})]}),f.jsxs("div",{className:"architecture-map-actions",children:[f.jsxs("div",{className:"architecture-route-mode",role:"group","aria-label":"Route visibility",children:[f.jsx("button",{type:"button","aria-pressed":x==="key",onClick:()=>S("key"),children:e?.kind==="group"?"Neighbors":"Key routes"}),f.jsxs("button",{type:"button","aria-pressed":x==="complete",onClick:()=>S("complete"),children:["All routes · ",n.routes.length]})]}),f.jsxs("div",{className:"architecture-map-toolbar","aria-label":"Map controls",children:[f.jsx("button",{type:"button","aria-label":"Zoom out",onClick:()=>c(R=>Math.max(.75,R-.25)),children:f.jsx(L3,{"aria-hidden":"true"})}),f.jsxs("span",{"aria-live":"polite",children:[Math.round(l*100),"%"]}),f.jsx("button",{type:"button","aria-label":"Zoom in",onClick:()=>c(R=>Math.min(2,R+.25)),children:f.jsx(nv,{"aria-hidden":"true"})}),f.jsx("button",{type:"button","aria-label":"Reset zoom and scroll position",title:"Reset zoom and scroll position",onClick:U,children:f.jsx(Jm,{"aria-hidden":"true"})}),f.jsx("button",{type:"button","aria-label":"Reset subsystem positions",title:"Reset subsystem positions",disabled:Object.keys(r).length===0,onClick:T,children:f.jsx(iv,{"aria-hidden":"true"})})]})]})]}),f.jsx("div",{ref:j,className:"architecture-map-viewport",role:"region","aria-label":"Scrollable architecture flow diagram","aria-describedby":"architecture-map-help",tabIndex:0,"data-scroll-position":h,onScroll:ae,children:Ze.nodes.length>0?f.jsx("div",{className:"architecture-map-canvas",style:{width:M.width,height:M.height},children:f.jsxs("svg",{className:"architecture-map",viewBox:`0 0 ${Ze.width} ${Ze.height}`,role:"group","aria-label":kee(Ze.nodes.length,xe.length,n.routes.length),onPointerDown:ue,onPointerMove:me,onPointerUp:Be,onPointerCancel:()=>{X.current=void 0},children:[f.jsxs("defs",{children:[f.jsx("marker",{id:"architecture-arrow",className:"architecture-arrow architecture-arrow-default",markerWidth:"8",markerHeight:"8",refX:"7",refY:"4",orient:"auto-start-reverse",markerUnits:"userSpaceOnUse",children:f.jsx("path",{d:"M 0 0 L 8 4 L 0 8 z"})}),f.jsx("marker",{id:"architecture-arrow-incoming",className:"architecture-arrow architecture-arrow-incoming",markerWidth:"8",markerHeight:"8",refX:"7",refY:"4",orient:"auto-start-reverse",markerUnits:"userSpaceOnUse",children:f.jsx("path",{d:"M 0 0 L 8 4 L 0 8 z"})}),f.jsx("marker",{id:"architecture-arrow-outgoing",className:"architecture-arrow architecture-arrow-outgoing",markerWidth:"8",markerHeight:"8",refX:"7",refY:"4",orient:"auto-start-reverse",markerUnits:"userSpaceOnUse",children:f.jsx("path",{d:"M 0 0 L 8 4 L 0 8 z"})})]}),f.jsxs("g",{className:"architecture-map-lanes","aria-hidden":"true",children:[Ze.lanes.map(R=>f.jsxs("g",{children:[f.jsx("rect",{x:R.x+8,y:34,width:R.width-16,height:Ze.height-76,rx:"12"}),f.jsx("text",{x:R.x+R.width/2,y:61,children:R.label})]},R.index)),f.jsx("text",{className:"architecture-map-direction",x:96,y:24,children:"PRIMARY CALL DIRECTION →"})]}),f.jsx("g",{className:"architecture-routes",children:xe.map(R=>{const de=V.reciprocals.get(R.id),Te=e?.kind==="route"&&e.id===R.id,Je=Te||e===void 0||e.kind==="group"&&He.has(R.id),Dt=R.inferred>R.extracted?"inferred":"extracted",Bt=e?.kind==="group"?R.targetGroup===e.id?"incoming":R.sourceGroup===e.id?"outgoing":void 0:void 0,re=x==="key"?.3+Math.sqrt(R.relationships/Fe)*.28:.1+Math.sqrt(R.relationships/Fe)*.2;return f.jsxs("g",{role:"button",tabIndex:0,"aria-label":`${R.sourceGroup} to ${R.targetGroup}, ${R.relationships} ${i}${de?`; bidirectional, ${de.relationships} reverse ${i}`:""}${R.direction==="backward"?", feedback route":""}`,"data-direction":R.direction,"data-evidence":Dt,"data-reciprocal":de?"true":void 0,"data-focus-direction":Bt,"data-selected":Te||void 0,"data-dimmed":!Je||void 0,onClick:()=>Q({kind:"route",id:R.id}),onKeyDown:Me=>W(Me,{kind:"route",id:R.id}),children:[f.jsx("path",{className:"architecture-route-hit",d:R.path}),f.jsx("path",{className:"architecture-route-line",d:R.path,style:{strokeWidth:R.width,"--architecture-route-opacity":re},markerStart:de?zee(Bt):void 0,markerEnd:Bt==="incoming"?"url(#architecture-arrow-incoming)":Bt==="outgoing"?"url(#architecture-arrow-outgoing)":"url(#architecture-arrow)"}),f.jsxs("title",{children:[R.sourceGroup," → ",R.targetGroup,": ",R.relationships," ",i,de&&` · ${de.sourceGroup} → ${de.targetGroup}: ${de.relationships} ${i}`]})]},R.id)})}),f.jsx("g",{className:"architecture-map-nodes",children:Ze.nodes.map(R=>{const de=e?.kind==="group"&&e.id===R.id,Te=de||e===void 0||e.kind==="group"&&He.has(R.id)||e.kind==="route"&&n.routes.some(Je=>Je.id===e.id&&(Je.sourceGroup===R.id||Je.targetGroup===R.id));return f.jsxs("g",{role:"button",tabIndex:0,"aria-label":`${R.name}, ${R.nodeCount} visible symbols, ${R.incomingRelationships} incoming and ${R.outgoingRelationships} outgoing ${i}; drag to reposition`,transform:`translate(${R.x-R.width/2} ${R.y-R.height/2})`,"data-selected":de||void 0,"data-dimmed":!Te||void 0,"data-dragging":E===R.id||void 0,onPointerDown:Je=>ut(Je,R),onPointerMove:Je=>{const Dt=ne.current;if(!Dt||Dt.id!==R.id||Dt.pointerId!==Je.pointerId)return;const Bt=C2(Je.currentTarget.ownerSVGElement,Je);Bt&&((Math.abs(Je.clientX-Dt.startClientX)>3||Math.abs(Je.clientY-Dt.startClientY)>3)&&(Dt.moved=!0),ge(R.id,{x:Bt.x-Dt.offsetX,y:Bt.y-Dt.offsetY}))},onPointerUp:Je=>_e(Je,R),onPointerCancel:Je=>en(Je),onKeyDown:Je=>fn(Je,R),children:[f.jsx("rect",{className:"architecture-map-node-shadow",width:R.width,height:R.height,rx:"9"}),f.jsx("rect",{className:"architecture-map-node-card",width:R.width,height:R.height,rx:"9"}),f.jsx("rect",{className:"architecture-map-node-accent",width:"4",height:R.height-16,x:"8",y:"8",rx:"2"}),f.jsx("text",{x:"20",y:"27",className:"architecture-map-node-name",children:Dee(R.name,24)}),f.jsxs("text",{x:"20",y:"48",className:"architecture-map-node-meta",children:[R.nodeCount.toLocaleString()," symbols"," · ","↓",R.incomingRelationships.toLocaleString()," ↑",R.outgoingRelationships.toLocaleString()]}),f.jsxs("g",{className:"architecture-map-node-grip","aria-hidden":"true",children:[f.jsx("circle",{cx:R.width-18,cy:"26",r:"1.2"}),f.jsx("circle",{cx:R.width-13,cy:"26",r:"1.2"}),f.jsx("circle",{cx:R.width-18,cy:"31",r:"1.2"}),f.jsx("circle",{cx:R.width-13,cy:"31",r:"1.2"}),f.jsx("circle",{cx:R.width-18,cy:"36",r:"1.2"}),f.jsx("circle",{cx:R.width-13,cy:"36",r:"1.2"})]}),f.jsxs("title",{children:[R.name," — drag to reposition"]})]},R.id)})})]})}):f.jsxs("div",{className:"architecture-map-empty",children:[f.jsx("strong",{children:"No architecture to draw"}),f.jsx("span",{children:"No subsystems match the current scope and evidence filters."})]})}),f.jsxs("footer",{className:"architecture-map-footer",children:[f.jsxs("div",{className:"architecture-map-legend","aria-label":"Map legend",children:[f.jsxs("span",{children:[f.jsx("i",{"data-evidence":"extracted"})," Extracted"]}),f.jsxs("span",{children:[f.jsx("i",{"data-evidence":"inferred"})," Inferred"]}),f.jsxs("span",{children:[f.jsx("i",{"data-direction":"incoming"})," Incoming"]}),f.jsxs("span",{children:[f.jsx("i",{"data-direction":"outgoing"})," Outgoing"]}),f.jsxs("span",{children:[f.jsx("i",{"data-direction":"bidirectional","aria-hidden":"true",children:"↔"})," Bidirectional"]}),f.jsxs("span",{children:[f.jsx("i",{"data-direction":"feedback"})," Feedback"]}),f.jsxs("span",{children:[f.jsx(G3,{"aria-hidden":"true"})," Drag cards to arrange"]}),le>0&&f.jsxs("button",{type:"button",onClick:()=>S("complete"),children:[xe.length," of ",n.routes.length," routes · Show all"]})]}),f.jsxs("details",{className:"architecture-map-table",children:[f.jsx("summary",{children:"View routes as a table"}),f.jsx("div",{children:f.jsxs("table",{children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:"From"}),f.jsx("th",{children:"To"}),f.jsx("th",{children:"Relationships"}),f.jsx("th",{children:"Evidence"})]})}),f.jsx("tbody",{children:n.routes.map(R=>f.jsxs("tr",{children:[f.jsx("td",{children:l2(n,R.sourceGroup)}),f.jsx("td",{children:l2(n,R.targetGroup)}),f.jsx("td",{children:R.relationships.toLocaleString()}),f.jsxs("td",{children:[R.extracted," extracted · ",R.inferred," inferred"]})]},R.id))})]})})]})]})]})}function C2(n,e){if(!n)return;const t=n.getScreenCTM();if(!t)return;const i=n.createSVGPoint();i.x=e.clientX,i.y=e.clientY;const o=i.matrixTransform(t.inverse());return{x:o.x,y:o.y}}function I2(n){try{const e=JSON.parse(window.localStorage.getItem(n)??"{}");return!e||typeof e!="object"||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).flatMap(([t,i])=>i&&typeof i=="object"&&"x"in i&&"y"in i&&typeof i.x=="number"&&typeof i.y=="number"&&Number.isFinite(i.x)&&Number.isFinite(i.y)?[[t,{x:i.x,y:i.y}]]:[]))}catch{return{}}}function l2(n,e){return n.groups.find(t=>t.id===e)?.name??e}function Dee(n,e){return n.length<=e?n:`${n.slice(0,e-1)}…`}function Mee(n,e){const t=o=>[...o].sort((r,A)=>A.relationships-r.relationships||r.id.localeCompare(A.id)),i=new Set;if(e?.kind==="route"){const o=n.find(r=>r.id===e.id);if(o){i.add(o.id);const r=n.find(A=>A.sourceGroup===o.targetGroup&&A.targetGroup===o.sourceGroup);r&&i.add(r.id)}return i}else if(e?.kind==="group"){const o=t(n.filter(A=>A.targetGroup===e.id)).slice(0,6),r=t(n.filter(A=>A.sourceGroup===e.id)).slice(0,6);for(const A of t([...o,...r]))i.add(A.id);return i}for(const o of t(n)){if(i.size>=Tee)break;i.add(o.id)}return i}function Ree(n,e){const t=new Map(n.map(A=>[c2(A.sourceGroup,A.targetGroup),A])),i=new Set,o=[],r=new Map;for(const A of n){if(i.has(A.id))continue;const I=t.get(c2(A.targetGroup,A.sourceGroup));if(!I||I.id===A.id||i.has(I.id)){o.push(A),i.add(A.id);continue}const l=A.id===e?A:I.id===e?I:A.relationships>I.relationships||A.relationships===I.relationships&&A.id.localeCompare(I.id)<=0?A:I,c=l.id===A.id?I:A;o.push(l),r.set(l.id,c),i.add(A.id),i.add(I.id)}return o.sort((A,I)=>I.relationships-A.relationships||A.id.localeCompare(I.id)),{routes:o,reciprocals:r}}function c2(n,e){return`${n}\0${e}`}function zee(n){return n==="incoming"?"url(#architecture-arrow-outgoing)":n==="outgoing"?"url(#architecture-arrow-incoming)":"url(#architecture-arrow)"}function kee(n,e,t){return e===t?`${n} subsystems and ${t} directed routes`:`${n} subsystems and ${e} of ${t} directed routes visible`}function _ee(n,e){const t=n.projections.find(x=>x.scope===(e.scope==="all"?"all_code":"production"));if(!t)throw new Error(`Architecture projection is missing scope '${e.scope}'`);const i=new Map(t.groups.map(x=>[x.id,x])),o=new Set(t.overviewGroupIds),r=new Map(t.memberships.map(x=>[n.nodes[x.nodeIndex].id,t.groups[x.groupIndex].id])),A=x=>{const S=r.get(x);return S?i.get(S)?.parentId??S:void 0},I=n.relationships.filter(x=>jee(e.evidence,x.confidence)&&Zee(e.lens,x.relationClass)&&A(x.source)&&A(x.target)),l=new Map,c=new Map;for(const x of I){const S=A(x.source),E=A(x.target);if(S===E){l.set(S,(l.get(S)??0)+1);continue}if(!o.has(S)||!o.has(E))continue;const _=`${S}->${E}`,j=c.get(_)??[];j.push(x),c.set(_,j)}const h=[...c.entries()].map(([x,S])=>({id:x,sourceGroup:A(S[0].source),targetGroup:A(S[0].target),relationships:S.length,extracted:S.filter(E=>E.confidence==="extracted").length,inferred:S.filter(E=>E.confidence==="inferred").length,ambiguous:S.filter(E=>E.confidence==="ambiguous").length})).sort((x,S)=>S.relationships-x.relationships||x.id.localeCompare(S.id)),p=new Map,m=new Map;for(const x of h)m.set(x.sourceGroup,(m.get(x.sourceGroup)??0)+x.relationships),p.set(x.targetGroup,(p.get(x.targetGroup)??0)+x.relationships);const b=t.overviewGroupIds.flatMap(x=>{const S=i.get(x);return S?[{id:S.id,name:S.name.value,nodeCount:S.nodeCount,totalNodeCount:S.nodeCount,internalRelationshipCount:l.get(S.id)??0,incomingRelationships:p.get(S.id)??0,outgoingRelationships:m.get(S.id)??0,scopes:S.sourceScopes}]:[]}),w=b.reduce((x,S)=>x+S.nodeCount,0),O=b.reduce((x,S)=>x+S.internalRelationshipCount,0)+h.reduce((x,S)=>x+S.relationships,0);return{title:n.title,scope:e.scope,evidence:e.evidence,lens:e.lens,groups:b,routes:h,statistics:{visibleNodes:w,totalNodes:t.quality.metrics.sourceScopes.production+t.quality.metrics.sourceScopes.test+t.quality.metrics.sourceScopes.generated+t.quality.metrics.sourceScopes.vendor+t.quality.metrics.sourceScopes.unknown,visibleRelationships:O,totalRelationships:I.length,communities:n.statistics.communities,extracted:n.statistics.extracted,inferred:n.statistics.inferred,ambiguous:n.statistics.ambiguous},coverage:{internal:t.coverage.internal,crossGroup:t.coverage.crossGroup,unassigned:t.coverage.unassigned},omissions:t.omissions,quality:t.quality,provenance:n.provenance}}function jee(n,e){return n==="all"||n===e}function Zee(n,e){return n==="all"?e!=="unknown":n==="architecture"?e==="execution"||e==="dependency":n===e}function d2(n){var e,t,i="";if(typeof n=="string"||typeof n=="number")i+=n;else if(typeof n=="object")if(Array.isArray(n)){var o=n.length;for(e=0;etypeof n=="boolean"?`${n}`:n===0?"0":n,f2=u2,Ku=(n,e)=>t=>{var i;if(e?.variants==null)return f2(n,t?.class,t?.className);const{variants:o,defaultVariants:r}=e,A=Object.keys(o).map(c=>{const h=t?.[c],p=r?.[c];if(h===null)return null;const m=h2(h)||h2(p);return o[c][m]}),I=t&&Object.entries(t).reduce((c,h)=>{let[p,m]=h;return m===void 0||(c[p]=m),c},{}),l=e==null||(i=e.compoundVariants)===null||i===void 0?void 0:i.reduce((c,h)=>{let{class:p,className:m,...b}=h;return Object.entries(b).every(w=>{let[O,x]=w;return Array.isArray(x)?x.includes({...r,...I}[O]):{...r,...I}[O]===x})?[...c,p,m]:c},[]);return f2(n,A,l,t?.class,t?.className)},Pee=(n,e)=>{const t=new Array(n.length+e.length);for(let i=0;i({classGroupId:n,validator:e}),p2=(n=new Map,e=null,t)=>({nextPart:n,validators:e,classGroupId:t}),mI="-",m2=[],Lee="arbitrary..",Gee=n=>{const e=Vee(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:i}=n;return{getClassGroupId:A=>{if(A.startsWith("[")&&A.endsWith("]"))return Fee(A);const I=A.split(mI),l=I[0]===""&&I.length>1?1:0;return v2(I,l,e)},getConflictingClassGroupIds:(A,I)=>{if(I){const l=i[A],c=t[A];return l?c?Pee(c,l):l:c||m2}return t[A]||m2}}},v2=(n,e,t)=>{if(n.length-e===0)return t.classGroupId;const o=n[e],r=t.nextPart.get(o);if(r){const c=v2(n,e+1,r);if(c)return c}const A=t.validators;if(A===null)return;const I=e===0?n.join(mI):n.slice(e).join(mI),l=A.length;for(let c=0;cn.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=n.slice(1,-1),t=e.indexOf(":"),i=e.slice(0,t);return i?Lee+i:void 0})(),Vee=n=>{const{theme:e,classGroups:t}=n;return Uee(t,e)},Uee=(n,e)=>{const t=p2();for(const i in n){const o=n[i];Wu(o,t,i,e)}return t},Wu=(n,e,t,i)=>{const o=n.length;for(let r=0;r{if(typeof n=="string"){Hee(n,e,t);return}if(typeof n=="function"){Kee(n,e,t,i);return}Wee(n,e,t,i)},Hee=(n,e,t)=>{const i=n===""?e:b2(e,n);i.classGroupId=t},Kee=(n,e,t,i)=>{if(Qee(n)){Wu(n(i),e,t,i);return}e.validators===null&&(e.validators=[]),e.validators.push(Bee(t,n))},Wee=(n,e,t,i)=>{const o=Object.entries(n),r=o.length;for(let A=0;A{let t=n;const i=e.split(mI),o=i.length;for(let r=0;r"isThemeGetter"in n&&n.isThemeGetter===!0,Xee=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=Object.create(null),i=Object.create(null);const o=(r,A)=>{t[r]=A,e++,e>n&&(e=0,i=t,t=Object.create(null))};return{get(r){let A=t[r];if(A!==void 0)return A;if((A=i[r])!==void 0)return o(r,A),A},set(r,A){r in t?t[r]=A:o(r,A)}}},Qu="!",y2=":",$ee=[],w2=(n,e,t,i,o)=>({modifiers:n,hasImportantModifier:e,baseClassName:t,maybePostfixModifierPosition:i,isExternal:o}),qee=n=>{const{prefix:e,experimentalParseClassName:t}=n;let i=o=>{const r=[];let A=0,I=0,l=0,c;const h=o.length;for(let O=0;Ol?c-l:void 0;return w2(r,b,m,w)};if(e){const o=e+y2,r=i;i=A=>A.startsWith(o)?r(A.slice(o.length)):w2($ee,!1,A,void 0,!0)}if(t){const o=i;i=r=>t({className:r,parseClassName:o})}return i},Jee=n=>{const e=new Map;return n.orderSensitiveModifiers.forEach((t,i)=>{e.set(t,1e6+i)}),t=>{const i=[];let o=[];for(let r=0;r0&&(o.sort(),i.push(...o),o=[]),i.push(A)):o.push(A)}return o.length>0&&(o.sort(),i.push(...o)),i}},ete=n=>({cache:Xee(n.cacheSize),parseClassName:qee(n),sortModifiers:Jee(n),postfixLookupClassGroupIds:tte(n),...Gee(n)}),tte=n=>{const e=Object.create(null),t=n.postfixLookupClassGroups;if(t)for(let i=0;i{const{parseClassName:t,getClassGroupId:i,getConflictingClassGroupIds:o,sortModifiers:r,postfixLookupClassGroupIds:A}=e,I=[],l=n.trim().split(nte);let c="";for(let h=l.length-1;h>=0;h-=1){const p=l[h],{isExternal:m,modifiers:b,hasImportantModifier:w,baseClassName:O,maybePostfixModifierPosition:x}=t(p);if(m){c=p+(c.length>0?" "+c:c);continue}let S=!!x,E;if(S){const F=O.substring(0,x);E=i(F);const V=E&&A[E]?i(O):void 0;V&&V!==E&&(E=V,S=!1)}else E=i(O);if(!E){if(!S){c=p+(c.length>0?" "+c:c);continue}if(E=i(O),!E){c=p+(c.length>0?" "+c:c);continue}S=!1}const _=b.length===0?"":b.length===1?b[0]:r(b).join(":"),j=w?_+Qu:_,X=j+E;if(I.indexOf(X)>-1)continue;I.push(X);const ne=o(E,S);for(let F=0;F0?" "+c:c)}return c},gte=(...n)=>{let e=0,t,i,o="";for(;e{if(typeof n=="string")return n;let e,t="";for(let i=0;i{let t,i,o,r;const A=l=>{const c=e.reduce((h,p)=>p(h),n());return t=ete(c),i=t.cache.get,o=t.cache.set,r=I,I(l)},I=l=>{const c=i(l);if(c)return c;const h=ite(l,t);return o(l,h),h};return r=A,(...l)=>r(gte(...l))},ste=[],an=n=>{const e=t=>t[n]||ste;return e.isThemeGetter=!0,e},E2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,S2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rte=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ate=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ate=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Cte=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ite=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lte=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vg=n=>rte.test(n),Ye=n=>!!n&&!Number.isNaN(Number(n)),Fi=n=>!!n&&Number.isInteger(Number(n)),Xu=n=>n.endsWith("%")&&Ye(n.slice(0,-1)),og=n=>ate.test(n),T2=()=>!0,cte=n=>Ate.test(n)&&!Cte.test(n),$u=()=>!1,dte=n=>Ite.test(n),ute=n=>lte.test(n),hte=n=>!he(n)&&!fe(n),fte=n=>n.startsWith("@container")&&(n[10]==="/"&&n[11]!==void 0||n[11]==="s"&&n[16]!==void 0&&n.startsWith("-size/",10)||n[11]==="n"&&n[18]!==void 0&&n.startsWith("-normal/",10)),pte=n=>Ug(n,z2,$u),he=n=>E2.test(n),Lo=n=>Ug(n,k2,cte),O2=n=>Ug(n,Ste,Ye),mte=n=>Ug(n,j2,T2),vte=n=>Ug(n,_2,$u),N2=n=>Ug(n,M2,$u),bte=n=>Ug(n,R2,ute),vI=n=>Ug(n,Z2,dte),fe=n=>S2.test(n),Ua=n=>Go(n,k2),yte=n=>Go(n,_2),D2=n=>Go(n,M2),wte=n=>Go(n,z2),xte=n=>Go(n,R2),bI=n=>Go(n,Z2,!0),Ete=n=>Go(n,j2,!0),Ug=(n,e,t)=>{const i=E2.exec(n);return i?i[1]?e(i[1]):t(i[2]):!1},Go=(n,e,t=!1)=>{const i=S2.exec(n);return i?i[1]?e(i[1]):t:!1},M2=n=>n==="position"||n==="percentage",R2=n=>n==="image"||n==="url",z2=n=>n==="length"||n==="size"||n==="bg-size",k2=n=>n==="length",Ste=n=>n==="number",_2=n=>n==="family-name",j2=n=>n==="number"||n==="weight",Z2=n=>n==="shadow",Tte=ote(()=>{const n=an("color"),e=an("font"),t=an("text"),i=an("font-weight"),o=an("tracking"),r=an("leading"),A=an("breakpoint"),I=an("container"),l=an("spacing"),c=an("radius"),h=an("shadow"),p=an("inset-shadow"),m=an("text-shadow"),b=an("drop-shadow"),w=an("blur"),O=an("perspective"),x=an("aspect"),S=an("ease"),E=an("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],X=()=>[...j(),fe,he],ne=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto","contain","none"],V=()=>[fe,he,l],Ie=()=>[Vg,"full","auto",...V()],Ee=()=>[Fi,"none","subgrid",fe,he],Ze=()=>["auto",{span:["full",Fi,fe,he]},Fi,fe,he],xe=()=>[Fi,"auto",fe,he],He=()=>["auto","min","max","fr",fe,he],Fe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],le=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...V()],Q=()=>[Vg,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...V()],W=()=>[Vg,"screen","full","dvw","lvw","svw","min","max","fit",...V()],ge=()=>[Vg,"screen","full","lh","dvh","lvh","svh","min","max","fit",...V()],ee=()=>[n,fe,he],T=()=>[...j(),D2,N2,{position:[fe,he]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ie=()=>["auto","cover","contain",wte,pte,{size:[fe,he]}],ae=()=>[Xu,Ua,Lo],ue=()=>["","none","full",c,fe,he],me=()=>["",Ye,Ua,Lo],Be=()=>["solid","dashed","dotted","double"],ut=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_e=()=>[Ye,Xu,D2,N2],en=()=>["","none",w,fe,he],fn=()=>["none",Ye,fe,he],R=()=>["none",Ye,fe,he],de=()=>[Ye,fe,he],Te=()=>[Vg,"full",...V()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[og],breakpoint:[og],color:[T2],container:[og],"drop-shadow":[og],ease:["in","out","in-out"],font:[hte],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[og],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[og],shadow:[og],spacing:["px",Ye],text:[og],"text-shadow":[og],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Vg,he,fe,x]}],container:["container"],"container-type":[{"@container":["","normal","size",fe,he]}],"container-named":[fte],columns:[{columns:[Ye,he,fe,I]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:X()}],overflow:[{overflow:ne()}],"overflow-x":[{"overflow-x":ne()}],"overflow-y":[{"overflow-y":ne()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Ie()}],"inset-x":[{"inset-x":Ie()}],"inset-y":[{"inset-y":Ie()}],start:[{"inset-s":Ie(),start:Ie()}],end:[{"inset-e":Ie(),end:Ie()}],"inset-bs":[{"inset-bs":Ie()}],"inset-be":[{"inset-be":Ie()}],top:[{top:Ie()}],right:[{right:Ie()}],bottom:[{bottom:Ie()}],left:[{left:Ie()}],visibility:["visible","invisible","collapse"],z:[{z:[Fi,"auto",fe,he]}],basis:[{basis:[Vg,"full","auto",I,...V()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ye,Vg,"auto","initial","none",he]}],grow:[{grow:["",Ye,fe,he]}],shrink:[{shrink:["",Ye,fe,he]}],order:[{order:[Fi,"first","last","none",fe,he]}],"grid-cols":[{"grid-cols":Ee()}],"col-start-end":[{col:Ze()}],"col-start":[{"col-start":xe()}],"col-end":[{"col-end":xe()}],"grid-rows":[{"grid-rows":Ee()}],"row-start-end":[{row:Ze()}],"row-start":[{"row-start":xe()}],"row-end":[{"row-end":xe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":He()}],"auto-rows":[{"auto-rows":He()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...Fe(),"normal"]}],"justify-items":[{"justify-items":[...le(),"normal"]}],"justify-self":[{"justify-self":["auto",...le()]}],"align-content":[{content:["normal",...Fe()]}],"align-items":[{items:[...le(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...le(),{baseline:["","last"]}]}],"place-content":[{"place-content":Fe()}],"place-items":[{"place-items":[...le(),"baseline"]}],"place-self":[{"place-self":["auto",...le()]}],p:[{p:V()}],px:[{px:V()}],py:[{py:V()}],ps:[{ps:V()}],pe:[{pe:V()}],pbs:[{pbs:V()}],pbe:[{pbe:V()}],pt:[{pt:V()}],pr:[{pr:V()}],pb:[{pb:V()}],pl:[{pl:V()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":V()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":V()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],"inline-size":[{inline:["auto",...W()]}],"min-inline-size":[{"min-inline":["auto",...W()]}],"max-inline-size":[{"max-inline":["none",...W()]}],"block-size":[{block:["auto",...ge()]}],"min-block-size":[{"min-block":["auto",...ge()]}],"max-block-size":[{"max-block":["none",...ge()]}],w:[{w:[I,"screen",...Q()]}],"min-w":[{"min-w":[I,"screen","none",...Q()]}],"max-w":[{"max-w":[I,"screen","none","prose",{screen:[A]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh",...Q()]}],"font-size":[{text:["base",t,Ua,Lo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,Ete,mte]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Xu,he]}],"font-family":[{font:[yte,vte,e]}],"font-features":[{"font-features":[he]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,fe,he]}],"line-clamp":[{"line-clamp":[Ye,"none",fe,O2]}],leading:[{leading:[r,...V()]}],"list-image":[{"list-image":["none",fe,he]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",fe,he]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ee()}],"text-color":[{text:ee()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Be(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ye,"from-font","auto",fe,Lo]}],"text-decoration-color":[{decoration:ee()}],"underline-offset":[{"underline-offset":[Ye,"auto",fe,he]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:V()}],"tab-size":[{tab:[Fi,fe,he]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fe,he]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",fe,he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:T()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Fi,fe,he],radial:["",fe,he],conic:[Fi,fe,he]},xte,bte]}],"bg-color":[{bg:ee()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:ee()}],"gradient-via":[{via:ee()}],"gradient-to":[{to:ee()}],rounded:[{rounded:ue()}],"rounded-s":[{"rounded-s":ue()}],"rounded-e":[{"rounded-e":ue()}],"rounded-t":[{"rounded-t":ue()}],"rounded-r":[{"rounded-r":ue()}],"rounded-b":[{"rounded-b":ue()}],"rounded-l":[{"rounded-l":ue()}],"rounded-ss":[{"rounded-ss":ue()}],"rounded-se":[{"rounded-se":ue()}],"rounded-ee":[{"rounded-ee":ue()}],"rounded-es":[{"rounded-es":ue()}],"rounded-tl":[{"rounded-tl":ue()}],"rounded-tr":[{"rounded-tr":ue()}],"rounded-br":[{"rounded-br":ue()}],"rounded-bl":[{"rounded-bl":ue()}],"border-w":[{border:me()}],"border-w-x":[{"border-x":me()}],"border-w-y":[{"border-y":me()}],"border-w-s":[{"border-s":me()}],"border-w-e":[{"border-e":me()}],"border-w-bs":[{"border-bs":me()}],"border-w-be":[{"border-be":me()}],"border-w-t":[{"border-t":me()}],"border-w-r":[{"border-r":me()}],"border-w-b":[{"border-b":me()}],"border-w-l":[{"border-l":me()}],"divide-x":[{"divide-x":me()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":me()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Be(),"hidden","none"]}],"divide-style":[{divide:[...Be(),"hidden","none"]}],"border-color":[{border:ee()}],"border-color-x":[{"border-x":ee()}],"border-color-y":[{"border-y":ee()}],"border-color-s":[{"border-s":ee()}],"border-color-e":[{"border-e":ee()}],"border-color-bs":[{"border-bs":ee()}],"border-color-be":[{"border-be":ee()}],"border-color-t":[{"border-t":ee()}],"border-color-r":[{"border-r":ee()}],"border-color-b":[{"border-b":ee()}],"border-color-l":[{"border-l":ee()}],"divide-color":[{divide:ee()}],"outline-style":[{outline:[...Be(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ye,fe,he]}],"outline-w":[{outline:["",Ye,Ua,Lo]}],"outline-color":[{outline:ee()}],shadow:[{shadow:["","none",h,bI,vI]}],"shadow-color":[{shadow:ee()}],"inset-shadow":[{"inset-shadow":["none",p,bI,vI]}],"inset-shadow-color":[{"inset-shadow":ee()}],"ring-w":[{ring:me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ee()}],"ring-offset-w":[{"ring-offset":[Ye,Lo]}],"ring-offset-color":[{"ring-offset":ee()}],"inset-ring-w":[{"inset-ring":me()}],"inset-ring-color":[{"inset-ring":ee()}],"text-shadow":[{"text-shadow":["none",m,bI,vI]}],"text-shadow-color":[{"text-shadow":ee()}],opacity:[{opacity:[Ye,fe,he]}],"mix-blend":[{"mix-blend":[...ut(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ut()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ye]}],"mask-image-linear-from-pos":[{"mask-linear-from":_e()}],"mask-image-linear-to-pos":[{"mask-linear-to":_e()}],"mask-image-linear-from-color":[{"mask-linear-from":ee()}],"mask-image-linear-to-color":[{"mask-linear-to":ee()}],"mask-image-t-from-pos":[{"mask-t-from":_e()}],"mask-image-t-to-pos":[{"mask-t-to":_e()}],"mask-image-t-from-color":[{"mask-t-from":ee()}],"mask-image-t-to-color":[{"mask-t-to":ee()}],"mask-image-r-from-pos":[{"mask-r-from":_e()}],"mask-image-r-to-pos":[{"mask-r-to":_e()}],"mask-image-r-from-color":[{"mask-r-from":ee()}],"mask-image-r-to-color":[{"mask-r-to":ee()}],"mask-image-b-from-pos":[{"mask-b-from":_e()}],"mask-image-b-to-pos":[{"mask-b-to":_e()}],"mask-image-b-from-color":[{"mask-b-from":ee()}],"mask-image-b-to-color":[{"mask-b-to":ee()}],"mask-image-l-from-pos":[{"mask-l-from":_e()}],"mask-image-l-to-pos":[{"mask-l-to":_e()}],"mask-image-l-from-color":[{"mask-l-from":ee()}],"mask-image-l-to-color":[{"mask-l-to":ee()}],"mask-image-x-from-pos":[{"mask-x-from":_e()}],"mask-image-x-to-pos":[{"mask-x-to":_e()}],"mask-image-x-from-color":[{"mask-x-from":ee()}],"mask-image-x-to-color":[{"mask-x-to":ee()}],"mask-image-y-from-pos":[{"mask-y-from":_e()}],"mask-image-y-to-pos":[{"mask-y-to":_e()}],"mask-image-y-from-color":[{"mask-y-from":ee()}],"mask-image-y-to-color":[{"mask-y-to":ee()}],"mask-image-radial":[{"mask-radial":[fe,he]}],"mask-image-radial-from-pos":[{"mask-radial-from":_e()}],"mask-image-radial-to-pos":[{"mask-radial-to":_e()}],"mask-image-radial-from-color":[{"mask-radial-from":ee()}],"mask-image-radial-to-color":[{"mask-radial-to":ee()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":j()}],"mask-image-conic-pos":[{"mask-conic":[Ye]}],"mask-image-conic-from-pos":[{"mask-conic-from":_e()}],"mask-image-conic-to-pos":[{"mask-conic-to":_e()}],"mask-image-conic-from-color":[{"mask-conic-from":ee()}],"mask-image-conic-to-color":[{"mask-conic-to":ee()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:T()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",fe,he]}],filter:[{filter:["","none",fe,he]}],blur:[{blur:en()}],brightness:[{brightness:[Ye,fe,he]}],contrast:[{contrast:[Ye,fe,he]}],"drop-shadow":[{"drop-shadow":["","none",b,bI,vI]}],"drop-shadow-color":[{"drop-shadow":ee()}],grayscale:[{grayscale:["",Ye,fe,he]}],"hue-rotate":[{"hue-rotate":[Ye,fe,he]}],invert:[{invert:["",Ye,fe,he]}],saturate:[{saturate:[Ye,fe,he]}],sepia:[{sepia:["",Ye,fe,he]}],"backdrop-filter":[{"backdrop-filter":["","none",fe,he]}],"backdrop-blur":[{"backdrop-blur":en()}],"backdrop-brightness":[{"backdrop-brightness":[Ye,fe,he]}],"backdrop-contrast":[{"backdrop-contrast":[Ye,fe,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ye,fe,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ye,fe,he]}],"backdrop-invert":[{"backdrop-invert":["",Ye,fe,he]}],"backdrop-opacity":[{"backdrop-opacity":[Ye,fe,he]}],"backdrop-saturate":[{"backdrop-saturate":[Ye,fe,he]}],"backdrop-sepia":[{"backdrop-sepia":["",Ye,fe,he]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":V()}],"border-spacing-x":[{"border-spacing-x":V()}],"border-spacing-y":[{"border-spacing-y":V()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",fe,he]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ye,"initial",fe,he]}],ease:[{ease:["linear","initial",S,fe,he]}],delay:[{delay:[Ye,fe,he]}],animate:[{animate:["none",E,fe,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[O,fe,he]}],"perspective-origin":[{"perspective-origin":X()}],rotate:[{rotate:fn()}],"rotate-x":[{"rotate-x":fn()}],"rotate-y":[{"rotate-y":fn()}],"rotate-z":[{"rotate-z":fn()}],scale:[{scale:R()}],"scale-x":[{"scale-x":R()}],"scale-y":[{"scale-y":R()}],"scale-z":[{"scale-z":R()}],"scale-3d":["scale-3d"],skew:[{skew:de()}],"skew-x":[{"skew-x":de()}],"skew-y":[{"skew-y":de()}],transform:[{transform:[fe,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:X()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Te()}],"translate-x":[{"translate-x":Te()}],"translate-y":[{"translate-y":Te()}],"translate-z":[{"translate-z":Te()}],"translate-none":["translate-none"],zoom:[{zoom:[Fi,fe,he]}],accent:[{accent:ee()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ee()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",fe,he]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":ee()}],"scrollbar-track-color":[{"scrollbar-track":ee()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mbs":[{"scroll-mbs":V()}],"scroll-mbe":[{"scroll-mbe":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pbs":[{"scroll-pbs":V()}],"scroll-pbe":[{"scroll-pbe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",fe,he]}],fill:[{fill:["none",...ee()]}],"stroke-w":[{stroke:[Ye,Ua,Lo,O2]}],stroke:[{stroke:["none",...ee()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Ya(...n){return Tte(u2(n))}const Ote=Ku("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"}},defaultVariants:{variant:"default"}});function qu({className:n,variant:e,...t}){return f.jsx("div",{"data-slot":"alert",role:"alert",className:Ya(Ote({variant:e}),n),...t})}function Ju({className:n,...e}){return f.jsx("div",{"data-slot":"alert-title",className:Ya("font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",n),...e})}function eh({className:n,...e}){return f.jsx("div",{"data-slot":"alert-description",className:Ya("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",n),...e})}var Nte=Object.defineProperty,th=(n,e)=>Nte(n,"name",{value:e,configurable:!0});function nh(n,e){if(typeof n=="function")return n(e);n!=null&&(n.current=e)}th(nh,"setRef");function P2(...n){return e=>{let t=!1;const i=n.map(o=>{const r=nh(o,e);return!t&&typeof r=="function"&&(t=!0),r});if(t)return()=>{for(let o=0;oDte(n,"name",{value:e,configurable:!0});function L2(n){const e=B.forwardRef((t,i)=>{let{children:o,...r}=t,A=null,I=!1;const l=[];ih(o)&&typeof yI=="function"&&(o=yI(o._payload)),B.Children.forEach(o,m=>{if(Y2(m)){I=!0;const b=m;let w="child"in b.props?b.props.child:b.props.children;ih(w)&&typeof yI=="function"&&(w=yI(w._payload)),A=Rte(b,w),l.push(A?.props?.children)}else l.push(m)}),A?A=B.cloneElement(A,void 0,l):!I&&B.Children.count(o)===1&&B.isValidElement(o)&&(A=o);const c=A?U2(A):void 0,h=B2(i,c);if(!A){if(o||o===0)throw new Error(I?_te(n):kte(n));return o}const p=V2(r,A.props??{});return A.type!==B.Fragment&&(p.ref=i?h:c),B.cloneElement(A,p)});return e.displayName=`${n}.Slot`,e}Oi(L2,"createSlot");var G2=L2("Slot"),F2=Symbol.for("radix.slottable");function Mte(n){const e=Oi(t=>"child"in t?t.children(t.child):t.children,"Slottable");return e.displayName=`${n}.Slottable`,e.__radixId=F2,e}Oi(Mte,"createSlottable");var Rte=Oi((n,e)=>{if("child"in n.props){const t=n.props.child;return B.isValidElement(t)?B.cloneElement(t,void 0,n.props.children(t.props.children)):null}return B.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function V2(n,e){const t={...e};for(const i in e){const o=n[i],r=e[i];/^on[A-Z]/.test(i)?o&&r?t[i]=(...I)=>{const l=r(...I);return o(...I),l}:o&&(t[i]=o):i==="style"?t[i]={...o,...r}:i==="className"&&(t[i]=[o,r].filter(Boolean).join(" "))}return{...n,...t}}Oi(V2,"mergeProps");function U2(n){let e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}Oi(U2,"getElementRef");function Y2(n){return B.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===F2}Oi(Y2,"isSlottable");var zte=Symbol.for("react.lazy");function ih(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===zte&&"_payload"in n&&H2(n._payload)}Oi(ih,"isLazyComponent");function H2(n){return typeof n=="object"&&n!==null&&"then"in n}Oi(H2,"isPromiseLike");var kte=Oi(n=>`${n} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),_te=Oi(n=>`${n} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),yI=m3[" use ".trim().toString()];const jte=Ku("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function Yg({className:n,variant:e="default",asChild:t=!1,...i}){const o=t?G2:"span";return f.jsx(o,{"data-slot":"badge","data-variant":e,className:Ya(jte({variant:e}),n),...i})}const Zte=Ku("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function gh({className:n,variant:e="default",size:t="default",asChild:i=!1,...o}){const r=i?G2:"button";return f.jsx(r,{"data-slot":"button","data-variant":e,"data-size":t,className:Ya(Zte({variant:e,size:t,className:n})),...o})}const oh={resolved:0,inferred:1,ambiguous:2,unresolved:3};function Pte({graph:n,host:e}){const t=new Map,i=Bte(n);for(const r of n.edges){const A=t.get(r.target);(!A||oh[r.resolution]>oh[A])&&t.set(r.target,r.resolution)}const o={schema:"compass.viewer.graph/1",title:`Calls from ${n.nodes.find(r=>r.id===n.rootSymbol)?.name??n.rootSymbol}`,stats:{nodes:n.nodes.length,edges:n.edges.length,communities:4,aggregated:!1},nodes:n.nodes.map(r=>({id:r.id,label:r.name,kind:r.unresolved?"Unresolved call":"Function",community:oh[t.get(r.id)??"resolved"],communityName:t.get(r.id)??"resolved",depth:i.get(r.id),root:r.id===n.rootSymbol,source:Lte(r)})),edges:n.edges.map(r=>({id:r.id,source:r.source,target:r.target,relation:`${r.callee} · ${r.resolution}`,confidence:r.resolution==="resolved"?"extracted":r.resolution==="inferred"?"inferred":"ambiguous"})),communities:[{id:0,label:"Resolved",color:"#59A14F",hidden:!1},{id:1,label:"Inferred",color:"#4E79A7",hidden:!1},{id:2,label:"Ambiguous",color:"#F28E2B",hidden:!1},{id:3,label:"Unresolved",color:"#E15759",hidden:!1}],hyperedges:[]};return f.jsx(Fu,{model:o,host:e,preferredLayout:"hierarchical"})}function Bte(n){const e=new Map;for(const o of n.edges){const r=e.get(o.source)??[];r.push(o.target),e.set(o.source,r);const A=e.get(o.target)??[];A.push(o.source),e.set(o.target,A)}const t=new Map([[n.rootSymbol,0]]),i=[n.rootSymbol];for(;i.length>0;){const o=i.shift();if(o===void 0)break;const r=t.get(o)??0;for(const A of e.get(o)??[])t.has(A)||(t.set(A,r+1),i.push(A))}return t}function Lte(n){if(n.anchor)return{file:n.anchor.source_file,startByte:n.anchor.start_byte,endByte:n.anchor.end_byte};if(n.file)return{file:n.file,...n.startLine!=null?{startLine:n.startLine}:{},...n.endLine!=null?{endLine:n.endLine}:{},...n.startByte!=null?{startByte:n.startByte}:{},...n.endByte!=null?{endByte:n.endByte}:{}}}function Gte({coverage:n}){return!n.partial&&n.unresolved===0&&n.ambiguous===0?null:f.jsxs(qu,{children:[f.jsx(Ju,{children:"Partial call coverage"}),f.jsx(eh,{children:n.warning})]})}function Fte({graph:n,host:e}){const[t,i]=B.useState(!1),o=t?n.continuations:n.continuations.slice(0,20),r=n.direction==="callers"?"No callers found":n.direction==="callees"?"No callees found":"No calls found";return f.jsxs("div",{className:"call-graph-view relative h-screen",children:[f.jsx(Pte,{graph:n,host:e}),f.jsx("div",{className:"call-graph-direction absolute top-2 left-1/2 z-20 flex -translate-x-1/2 gap-1 rounded-md border bg-popover/95 p-1 shadow-lg backdrop-blur",role:"group","aria-label":"Call graph direction",children:[["callers","Callers"],["both","Both"],["callees","Callees"]].map(([A,I])=>f.jsx(gh,{size:"sm",variant:n.direction===A?"secondary":"ghost","aria-pressed":n.direction===A,disabled:!e.changeDirection,onClick:()=>{n.direction!==A&&e.changeDirection?.(A)},children:I},A))}),f.jsxs("section",{className:"call-graph-summary absolute bottom-3 left-3 z-20 flex max-w-[min(44rem,calc(100%-1.5rem))] flex-col gap-2 rounded-md border bg-popover/95 p-3 text-popover-foreground shadow-xl backdrop-blur",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsxs(Yg,{variant:"outline",children:[f.jsx(lc,{})," depth ",n.depth]}),f.jsxs(Yg,{variant:"outline",children:[n.nodes.length," ",n.nodes.length===1?"node":"nodes"]}),f.jsxs(Yg,{variant:"outline",children:[n.edges.length," ",n.edges.length===1?"edge":"edges"]}),f.jsxs(Yg,{variant:"secondary",children:[n.coverage.resolved," resolved"]}),f.jsxs(Yg,{variant:"outline",children:[n.coverage.inferred," inferred"]}),f.jsxs(Yg,{variant:"outline",children:[n.coverage.ambiguous," ambiguous"]}),f.jsxs(Yg,{variant:"destructive",children:[n.coverage.unresolved," unresolved"]}),n.coverage.evidenceLayer&&f.jsx(Yg,{variant:"outline",children:Vte(n.coverage.evidenceLayer)})]}),n.edges.length===0&&f.jsxs(qu,{children:[f.jsx(Ju,{children:r}),f.jsx(eh,{children:"Compass found the root function but no represented relationships in this direction."})]}),n.truncated&&f.jsxs(qu,{children:[f.jsx(qA,{}),f.jsx(Ju,{children:"Partial call graph"}),f.jsx(eh,{children:"Compass reached the configured graph limit. Counts and paths may be incomplete."})]}),f.jsx(Gte,{coverage:n.coverage}),n.continuations.length>0&&f.jsxs("div",{children:[f.jsx("div",{className:"flex max-h-24 flex-wrap gap-1 overflow-auto","aria-label":"Call graph continuations",children:o.map(A=>f.jsxs(gh,{size:"xs",variant:"outline",disabled:!e.expand,onClick:()=>e.expand?.(A.symbol,A.direction,A.nextDepth),children:[A.direction==="callers"?f.jsx(O3,{}):A.direction==="callees"?f.jsx(E3,{}):f.jsx(nv,{}),"Expand ",A.direction]},`${A.symbol}:${A.direction}:${A.nextDepth}`))}),!t&&n.continuations.length>o.length&&f.jsxs("div",{className:"mt-2 flex flex-wrap items-center justify-between gap-2",children:[f.jsxs("p",{className:"text-xs text-muted-foreground",role:"status",children:["Showing ",o.length," of ",n.continuations.length," continuations"]}),f.jsxs(gh,{size:"xs",variant:"outline",onClick:()=>i(!0),children:["Show all ",n.continuations.length," continuations"]})]})]})]})]})}function Vte(n){return n.split("_").map((e,t)=>t===0?`${e.slice(0,1).toUpperCase()}${e.slice(1)}`:e).join(" ")}const K2=0;function Ute(n,e){const t=new Set(n.nodes.map(l=>l.id)),i=n.edges.filter(l=>t.has(l.source)&&t.has(l.target)).map(Hte),o=new Map;for(const l of i)o.set(l.source,(o.get(l.source)??0)+1),o.set(l.target,(o.get(l.target)??0)+1);const r=Wte(n),A=new Set(n.paths.flatMap(l=>l.nodeIds.slice(0,1))),I=n.nodes.map(l=>Yte(l,o.get(l.id)??0,r.get(l.id),A.has(l.id)));return{schema:"compass.viewer.graph/1",title:e,stats:{nodes:I.length,edges:i.length,communities:I.length>0?1:0,aggregated:!1},nodes:I,edges:i,communities:I.length>0?[{id:K2,label:"Query result",color:"#6f7bf7",hidden:!1}]:[],hyperedges:[]}}function Yte(n,e,t,i){const o=n.details?.type==="symbol"?n.details.data.signature??void 0:void 0;return{id:n.id,label:n.name,kind:n.kind,community:K2,communityName:"Query result",degree:e,...t!==void 0?{depth:t}:{},...i?{root:!0}:{},...n.language?{language:n.language}:{},...o?{signature:o}:{},...n.source?{source:n.source}:{},codeEvidence:n.evidence}}function Hte(n){const e=Kte(n);return{id:n.id,source:n.source,target:n.target,relation:n.kind,...n.relationshipSite?{relationshipSite:n.relationshipSite}:{},...n.details?{details:n.details}:{},...e?{confidence:e}:{},codeEvidence:n.evidence}}function Kte(n){return n.evidence.some(e=>e.confidence==="ambiguous")?"ambiguous":n.evidence.some(e=>e.confidence==="inferred")?"inferred":n.evidence.length>0?"extracted":void 0}function Wte(n){const e=new Map;for(const t of n.paths)t.nodeIds.forEach((i,o)=>{const r=e.get(i);(r===void 0||o[x.id,x])),i=new Map(e.nodes.map(x=>[x.id,x])),o=new Map,r=[],A=W2(i,t),I=W2(t,i),l=new Map(Xte(i,t).map(x=>[x,av(t.get(x),i.get(x),"node")])),c=[...l.entries()].filter(([,x])=>x.fields.length>0).map(([x])=>x),h=qte(n.edges,e.edges),p=h.matched.map(({before:x,after:S})=>({before:x,after:S,evidence:$te(x,S)})).filter(({evidence:x})=>x.fields.length>0);for(const x of A)sh(o,i.get(x),"added",JA(void 0,i.get(x)));for(const x of I)sh(o,t.get(x),"removed",JA(t.get(x),void 0));for(const x of c)sh(o,i.get(x),"changed",l.get(x));for(const x of h.added)r.push({...x,change:"added",evidence:JA(void 0,x)}),rh(o,x,t,i);for(const x of h.removed)r.push({...x,change:"removed",evidence:JA(x,void 0)}),rh(o,x,t,i);for(const{after:x,evidence:S}of p)r.push({...x,change:"changed",evidence:S}),rh(o,x,t,i);const m=[...o.values()].sort((x,S)=>x.id.localeCompare(S.id));r.sort((x,S)=>x.id.localeCompare(S.id));const b=Jte(r),w=new Set(m.map(x=>x.community)),O=[...e.communities,...n.communities.filter(x=>!e.communities.some(S=>S.id===x.id))].filter(x=>w.has(x.id));return{addedNodes:A.length,removedNodes:I.length,changedNodes:c.length,addedEdges:h.added.length,removedEdges:h.removed.length,changedEdges:p.length,graph:{...e,title:`Graph delta · ${e.title}`,stats:{...e.stats,nodes:m.length,edges:b.length,communities:O.length,aggregated:n.stats.aggregated||e.stats.aggregated},nodes:m,edges:b,communities:O,hyperedges:[]}}}function W2(n,e){return[...n.keys()].filter(t=>!e.has(t))}function Xte(n,e){return[...n.keys()].filter(t=>e.has(t))}function sh(n,e,t,i){e&&n.set(e.id,{...e,change:t,...i?{evidence:i}:{}})}function Q2(n,e,t,i){if(n.has(e))return;const o=i.get(e)??t.get(e);o&&n.set(e,{...o,change:"unchanged"})}function rh(n,e,t,i){Q2(n,e.source,t,i),Q2(n,e.target,t,i)}function $te(n,e){return av({...n,id:e.id},e,"edge")}function qte(n,e){const t=new Set,i=new Set,o=[],r=(I,l)=>{t.add(I),i.add(l),o.push({before:n[I],after:e[l]})};X2(n,e,t,i,r,I=>xI(I.id)?void 0:I.id),X2(n,e,t,i,r,I=>xI(I.id)?ah(I):void 0);const A=new Map;n.forEach((I,l)=>{if(t.has(l)||!xI(I.id))return;const c=A.get(wI(I))??{parent:[],current:[]};c.parent.push(l),A.set(wI(I),c)}),e.forEach((I,l)=>{if(i.has(l)||!xI(I.id))return;const c=A.get(wI(I))??{parent:[],current:[]};c.current.push(l),A.set(wI(I),c)});for(const I of A.values()){I.parent.sort((c,h)=>$2(n[c],n[h])),I.current.sort((c,h)=>$2(e[c],e[h]));const l=Math.min(I.parent.length,I.current.length);for(let c=0;c!i.has(l)),removed:n.filter((I,l)=>!t.has(l))}}function X2(n,e,t,i,o,r){const A=new Map;e.forEach((I,l)=>{if(i.has(l))return;const c=r(I);if(c===void 0)return;const h=A.get(c)??[];h.push(l),A.set(c,h)}),n.forEach((I,l)=>{if(t.has(l))return;const c=r(I);if(c===void 0)return;const p=A.get(c)?.shift();p!==void 0&&o(l,p)})}function ah(n){return JSON.stringify(n_(n,"edge"))}function wI(n){return JSON.stringify([n.source,n.target,n.relation])}function $2(n,e){return ah(n).localeCompare(ah(e))||n.id.localeCompare(e.id)}function xI(n){return/^edge-\d+-/.test(n)}function Jte(n){const e=new Map;return n.map(t=>{const i=e.get(t.id)??0;return e.set(t.id,i+1),i===0?t:{...t,id:`${t.id}::${t.change}-${i}`}})}function ene({workbench:n,host:e,communityDetail:t,communityLoading:i,communityError:o,onBackToOverview:r,initialInspectorLayout:A,onInspectorLayoutChange:I}){const[l,c]=B.useState(()=>J2(n)??n.defaultView),[h,p]=B.useState(!1),m=n.views.find(w=>w.id===l)??n.views[0];B.useEffect(()=>{const w=()=>{const O=J2(n);O&&c(O)};return window.addEventListener("hashchange",w),()=>window.removeEventListener("hashchange",w)},[n]);const b=w=>{c(w);const O=`view=${encodeURIComponent(w)}`;window.location.hash.slice(1)!==O&&(window.location.hash=O)};return m?f.jsxs("div",{className:"visualization-workbench","data-navigation-collapsed":h,children:[f.jsxs("aside",{className:"visualization-rail","data-collapsed":h,"aria-label":"Compass navigation",children:[f.jsxs("header",{children:[f.jsx("span",{className:"visualization-bearing","aria-hidden":"true",children:f.jsx(q3,{})}),f.jsxs("span",{children:[f.jsx("strong",{children:"Compass"}),f.jsx("small",{title:n.title,children:n.title})]}),f.jsx("button",{className:"visualization-rail-disclosure",type:"button","aria-label":h?"Expand graph navigation":"Collapse graph navigation",title:h?"Expand graph navigation":"Collapse graph navigation",onClick:()=>p(w=>!w),children:h?f.jsx(V3,{"aria-hidden":"true"}):f.jsx(F3,{"aria-hidden":"true"})})]}),f.jsx("nav",{"aria-label":"Graph views",children:n.views.map(w=>f.jsxs("button",{type:"button","aria-current":w.id===m.id?"page":void 0,onClick:()=>b(w.id),children:[f.jsx(one,{view:w}),f.jsxs("span",{children:[f.jsx("strong",{children:w.title}),f.jsx("small",{children:w.description})]}),f.jsx("i",{"data-status":w.coverage.status,title:`${w.coverage.status} view`})]},w.id))}),f.jsxs("footer",{children:[f.jsx("span",{children:"Snapshot"}),f.jsx("code",{children:sne(n.graphIdentity)})]})]}),f.jsxs("main",{className:"visualization-main",children:[f.jsxs("header",{className:"visualization-context",children:[f.jsxs("div",{children:[f.jsx("span",{children:rne(m)}),f.jsx("strong",{children:m.title})]}),f.jsxs("div",{className:"visualization-coverage","data-status":m.coverage.status,children:[m.kind!=="call"&&f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[m.coverage.nodes.toLocaleString()," nodes"]}),f.jsxs("span",{children:[m.coverage.edges.toLocaleString()," relationships"]})]}),f.jsx("strong",{children:ane(m)})]})]}),f.jsx("section",{className:"visualization-stage","aria-label":`${m.title} visualization`,children:f.jsx(tne,{view:m,host:e,communityDetail:t,communityLoading:i,communityError:o,onBackToOverview:r,initialInspectorLayout:A,onInspectorLayoutChange:I},m.id)})]})]}):null}function tne({view:n,host:e,communityDetail:t,communityLoading:i,communityError:o,onBackToOverview:r,initialInspectorLayout:A,onInspectorLayoutChange:I}){if(n.kind==="call")return f.jsx(Fte,{graph:n.graph,host:{openSource:e.openSource,...e.expandCall?{expand:e.expandCall}:{},...e.changeCallDirection?{changeDirection:e.changeCallDirection}:{}}});if(n.kind==="architecture")return f.jsx(nne,{model:n.model,host:e});if(n.kind==="impact")return f.jsx(Ah,{model:Ute(n.result,n.title),host:e,queryResult:n.result,preferredLayout:"hierarchical"});if(n.kind==="history"){const c=Qte(n.before,n.after);return f.jsxs("div",{className:"workbench-history-view",children:[f.jsxs("div",{className:"workbench-history-banner",children:[f.jsx(qm,{"aria-hidden":"true"}),f.jsxs("span",{children:[f.jsxs("strong",{children:[n.baseRevision," → ",n.targetRevision]}),f.jsxs("small",{children:["+",c.addedNodes," / −",c.removedNodes," / Δ",c.changedNodes," nodes"]})]})]}),f.jsx(Ah,{model:c.graph,host:e,preferredLayout:"grid",sourceRevisions:{before:n.baseRevision,after:n.targetRevision}})]})}const l=n.kind==="affected"?"hierarchical":n.kind==="artifact"?n.lens==="routes"?"hierarchical":"grid":"automatic";return f.jsx(Ah,{model:n.model,host:e,preferredLayout:l,communityDetails:n.kind==="code"?n.communityDetails:void 0,communityDetail:n.kind==="code"?t:void 0,communityLoading:n.kind==="code"?i:void 0,communityError:n.kind==="code"?o:void 0,onBackToOverview:n.kind==="code"?r:void 0,initialInspectorLayout:A,onInspectorLayoutChange:I})}function Ah({model:n,host:e,queryResult:t,sourceRevisions:i,preferredLayout:o,communityDetails:r,communityDetail:A,communityLoading:I,communityError:l,onBackToOverview:c,initialInspectorLayout:h,onInspectorLayoutChange:p}){const[m,b]=B.useState(""),[w,O]=B.useState(""),[x,S]=B.useState(""),[E,_]=B.useState(""),[j,X]=B.useState(),[ne,F]=B.useState(!1),V=B.useId(),Ie=B.useRef(null),Ee=B.useRef(null),xe=(j===void 0?void 0:{communityId:j,model:r?.[String(j)]??n})??A,He=xe?.model??n,Fe=xe?`community-${xe.communityId}`:"overview",le=B.useMemo(()=>ine(He),[He]),M=B.useMemo(()=>gne(He,{relation:m,evidence:w,kind:x,language:E}),[He,w,x,E,m]);B.useEffect(()=>{b(""),O(""),S(""),_(""),F(!1)},[Fe]),B.useEffect(()=>{if(!ne)return;const T=ie=>{ie.key==="Escape"&&(F(!1),Ie.current?.focus())},U=ie=>{const ae=ie.target;Ie.current?.contains(ae)||Ee.current?.contains(ae)||F(!1)};return document.addEventListener("keydown",T),document.addEventListener("pointerdown",U),()=>{document.removeEventListener("keydown",T),document.removeEventListener("pointerdown",U)}},[ne]);const Q=B.useCallback(()=>{b(""),O(""),S(""),_("")},[]),W=B.useCallback(()=>F(!1),[]),ge=[m,w,x,E].filter(Boolean).length,ee=ge>0&&M.nodes.length===0;return f.jsx("div",{className:"workbench-graph-lens",children:f.jsx(Fu,{model:xe?n:M,communityDetail:xe?{...xe,model:M}:void 0,communityLoading:I,communityError:l,onBackToOverview:j===void 0?c:()=>X(void 0),initialInspectorLayout:h,onInspectorLayoutChange:p,host:{...e,openCommunity:T=>{r?.[String(T)]?X(T):e.openCommunity?.(T)}},queryResult:t,sourceRevisions:i,showInspectorHeader:!1,preferredLayout:o,toolbarLeading:f.jsxs("button",{ref:Ie,className:"workbench-filter-trigger",type:"button","aria-label":"Graph filters","aria-expanded":ne,"aria-controls":V,onClick:()=>F(T=>!T),children:[f.jsx(X3,{"aria-hidden":"true"}),f.jsx("span",{children:"Filters"}),ge>0?f.jsx("b",{children:ge}):null,f.jsxs("small",{children:[M.nodes.length.toLocaleString()," / ",He.nodes.length.toLocaleString()]})]}),toolbarLeadingPanel:ne?f.jsxs("div",{ref:Ee,id:V,className:"workbench-filter-popover",role:"region","aria-label":"Graph filter options",children:[f.jsxs("header",{children:[f.jsxs("span",{children:[f.jsx("strong",{children:"Filter graph"}),f.jsx("small",{children:"Refine visible nodes and relationships"})]}),f.jsx("button",{type:"button",disabled:ge===0,onClick:Q,children:"Clear filters"})]}),f.jsx(Fo,{label:"Relationship",value:m,values:le.relations,onChange:b}),f.jsx(Fo,{label:"Evidence",value:w,values:le.evidence,onChange:O}),f.jsx(Fo,{label:"Node kind",value:x,values:le.kinds,onChange:S}),f.jsx(Fo,{label:"Language",value:E,values:le.languages,onChange:_}),f.jsx("footer",{role:"status",children:ee?"No nodes match these filters":`Showing ${M.nodes.length.toLocaleString()} of ${He.nodes.length.toLocaleString()} nodes`})]}):void 0,toolbarLeadingOpen:ne,onToolbarLeadingClose:W,stageOverlay:He.nodes.length===0?f.jsx(q2,{title:"This view has no graph nodes",detail:"The exported graph lens did not contain any nodes to visualize."}):ee&&!ne?f.jsx(q2,{title:"No nodes match these filters",detail:"Clear one or more filters to restore the graph.",onClear:Q}):void 0})})}function q2({title:n,detail:e,onClear:t}){return f.jsxs("div",{className:"workbench-graph-empty",role:"status",children:[f.jsx(cc,{"aria-hidden":"true"}),f.jsx("strong",{children:n}),f.jsx("span",{children:e}),t?f.jsx("button",{type:"button",onClick:t,children:"Clear filters"}):null]})}function Fo({label:n,value:e,values:t,onChange:i}){return f.jsxs("label",{children:[f.jsx("span",{children:n}),f.jsxs("select",{value:e,onChange:o=>i(o.target.value),children:[f.jsx("option",{value:"",children:"All"}),t.map(o=>f.jsx("option",{value:o,children:Ch(o)},o))]})]})}function nne({model:n,host:e}){const[t,i]=B.useState("production"),[o,r]=B.useState("all"),[A,I]=B.useState("architecture"),l=B.useMemo(()=>_ee(n,{scope:t,evidence:o,lens:A}),[o,A,n,t]),c=l.groups.find(E=>E.nodeCount>0),[h,p]=B.useState(c?{kind:"group",id:c.id}:void 0),m=n.projections.find(E=>E.scope===(t==="all"?"all_code":"production")),b=h?.kind==="group"?m?.groups.find(E=>E.id===h.id):void 0,w=new Set(m?.groups.filter(E=>E.parentId===b?.id).map(E=>E.id)??[]),O=new Set(m?.memberships.filter(E=>{const _=m.groups[E.groupIndex]?.id;return _===b?.id||_!==void 0&&w.has(_)}).map(E=>n.nodes[E.nodeIndex]?.id).filter(E=>E!==void 0)??[]),x=n.nodes.filter(E=>O.has(E.id)),S=h?.kind==="route"?l.routes.find(E=>E.id===h.id):void 0;return f.jsxs("div",{className:"workbench-architecture",children:[f.jsxs("div",{className:"workbench-filter-strip","aria-label":"Architecture filters",children:[f.jsx(Fo,{label:"Source scope",value:t,values:["production","all"],onChange:E=>i(E)}),f.jsx(Fo,{label:"Evidence",value:o,values:["all","extracted","inferred","ambiguous"],onChange:E=>r(E)}),f.jsx(Fo,{label:"Lens",value:A,values:["architecture","execution","dependency","type","structure","all"],onChange:E=>I(E)}),f.jsxs("label",{children:["Subsystem directory",f.jsxs("select",{"aria-label":"Subsystem directory",value:b?.id??"",onChange:E=>E.target.value&&p({kind:"group",id:E.target.value}),children:[f.jsx("option",{value:"",children:"Select a subsystem"}),m?.groups.map(E=>f.jsxs("option",{value:E.id,children:[E.name.value," · ",E.nodeCount.toLocaleString()," symbols"]},E.id))]})]}),f.jsxs("span",{role:"status",children:[l.statistics.visibleRelationships.toLocaleString()," visible relationships"]}),f.jsxs("span",{role:"status",children:["Architecture quality: ",l.quality.status]}),f.jsxs("span",{role:"status",children:[l.omissions.shownGroups.toLocaleString()," of ",l.omissions.totalGroups.toLocaleString()," groups shown",l.omissions.omittedGroups>0?` · ${l.omissions.omittedGroups.toLocaleString()} available in directory`:""]})]}),f.jsxs("div",{className:"workbench-architecture-body",children:[f.jsx(Nee,{overview:l,selection:h,onSelect:p}),f.jsx("aside",{"aria-label":"Architecture details",children:b?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:"Subsystem"}),f.jsx("h2",{children:b.name.value}),f.jsxs("p",{children:[x.length.toLocaleString()," symbols · ",b.relationshipCount.toLocaleString()," related relationships"]}),f.jsxs("small",{children:["Name source: ",b.name.provenance," · quality ",b.name.quality,"/100"]}),f.jsx("div",{className:"workbench-symbol-list",children:x.slice(0,100).map(E=>f.jsxs("button",{type:"button",disabled:!E.sourceFile,onClick:()=>E.sourceFile&&e.openSource({file:E.sourceFile}),children:[f.jsx("strong",{children:E.label}),f.jsxs("small",{children:[E.kind,E.sourceFile?` · ${E.sourceFile}`:""]})]},E.id))})]}):S?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:"Subsystem route"}),f.jsxs("h2",{children:[eE(l,S.sourceGroup)," → ",eE(l,S.targetGroup)]}),f.jsxs("p",{children:[S.relationships.toLocaleString()," relationships cross this boundary."]})]}):f.jsx("p",{children:"Select a subsystem or route."})})]})]})}function ine(n){const e=t=>[...new Set(t.filter(i=>!!i))].sort();return{relations:e(n.edges.map(t=>t.relation)),evidence:e(n.edges.map(t=>t.confidence)),kinds:e(n.nodes.map(t=>t.kind)),languages:e(n.nodes.map(t=>t.language))}}function gne(n,e){const t=n.nodes.filter(I=>(!e.kind||I.kind===e.kind)&&(!e.language||I.language===e.language));let i=new Set(t.map(I=>I.id));const o=n.edges.filter(I=>i.has(I.source)&&i.has(I.target)&&(!e.relation||I.relation===e.relation)&&(!e.evidence||I.confidence===e.evidence));if(e.relation||e.evidence){const I=new Set(o.flatMap(l=>[l.source,l.target]));for(const l of t)l.root&&I.add(l.id);i=I}const r=t.filter(I=>i.has(I.id)),A=new Set(r.map(I=>I.community));return{...n,stats:{...n.stats,nodes:r.length,edges:o.length,communities:A.size},nodes:r,edges:o,communities:n.communities.filter(I=>A.has(I.id))}}function one({view:n}){const e=n.kind==="code"?cc:n.kind==="call"?lc:n.kind==="impact"?R3:n.kind==="architecture"?D3:n.kind==="history"?qm:n.kind==="affected"?W3:n.lens==="routes"?gv:n.lens==="provenance"?M3:H3;return f.jsx(e,{"aria-hidden":"true"})}function J2(n){const e=new URLSearchParams(window.location.hash.slice(1)).get("view");return e&&n.views.some(t=>t.id===e)?e:void 0}function sne(n){const e=n.startsWith("sha256:")?n.slice(7):n;return e.length>12?e.slice(0,12):e}function rne(n){return n.kind==="artifact"?`${Ch(n.lens)} lens`:`${Ch(n.kind)} graph`}function ane(n){return n.kind==="architecture"?n.coverage.status==="complete"?"Extraction complete":n.coverage.status==="summary"?"Extraction summary":"Extraction bounded":n.coverage.status==="complete"?"Complete":n.coverage.status==="summary"?"Community summary":"Bounded result"}function Ch(n){return n.replaceAll("_"," ").replace(/\b\w/g,e=>e.toUpperCase())}function eE(n,e){return n.groups.find(t=>t.id===e)?.name??e}const Ane=ce({provider:Ge(["github","gitlab","bitbucket"]),repositoryUrl:z().url(),revision:z().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/i)});function Cne(n,e,t=n.revision){if(!lne(t))return;const i=cne(e.file);if(!i)return;const o=n.repositoryUrl.replace(/\/$/,""),r=dne(n.provider,e);return n.provider==="gitlab"?`${o}/-/blob/${t}/${i}${r}`:n.provider==="bitbucket"?`${o}/src/${t}/${i}${r}`:`${o}/blob/${t}/${i}${r}`}function Ine(n,e,t){if(window.dispatchEvent(new CustomEvent("compass:open-source",{detail:e})),!n)return{kind:"unavailable"};const i=Cne(n,e,t??n.revision);if(!i)return{kind:"unavailable"};const o=document.createElement("a");return o.href=i,o.target="_blank",o.rel="noopener noreferrer",o.click(),{kind:"opened",url:i}}function lne(n){return/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/i.test(n)}function cne(n){if(!n||n.startsWith("/")||n.startsWith("\\")||n.includes("\0"))return;const e=n.replaceAll("\\","/").split("/");if(!e.some(t=>!t||t==="."||t===".."))return e.map(encodeURIComponent).join("/")}function dne(n,e){const t=e.startLine;if(t===void 0)return"";const i=Math.max(t,e.endLine??t);return n==="gitlab"?i===t?`#L${t}`:`#L${t}-${i}`:n==="bitbucket"?i===t?`#lines-${t}`:`#lines-${t}:${i}`:i===t?`#L${t}`:`#L${t}-L${i}`}function tE(){const n=document.getElementById("compass-viewer-root"),e=document.getElementById("compass-viewer-model");if(!n||!e)throw new Error("Compass viewer root or model is missing");const t=JSON.parse(e.textContent??""),i=une(),o=IN.createRoot(n),r=p3.safeParse(t);if(r.success){o.render(f.jsx(ene,{workbench:r.data,host:{openSource(m,b){nE(i,m,b)}}}));return}const A=Sg.parse(t),I=new Map;let l,c=null,h;const p=()=>{o.render(f.jsx(Fu,{model:A,communityDetail:l,communityLoading:c,communityError:h,onBackToOverview:l?()=>{l=void 0,h=void 0,p()}:void 0,host:{openSource(m,b){nE(i,m,b)},openCommunity(m){c===null&&(c=m,h=void 0,p(),window.setTimeout(()=>{try{let b=I.get(m);if(!b){const w=document.querySelector(`script[data-compass-community="${m}"]`);if(!w)throw new Error(`Community ${m} detail is unavailable in this export.`);b=Sg.parse(JSON.parse(w.textContent??"")),I.set(m,b)}l={communityId:m,model:b},window.dispatchEvent(new CustomEvent("compass:open-community",{detail:{communityId:m}}))}catch(b){h=b instanceof Error?b.message:String(b)}finally{c=null,p()}},0))}}}))};p()}function une(){const n=document.getElementById("compass-source-navigation");if(!n?.textContent)return;const e=Ane.safeParse(JSON.parse(n.textContent));return e.success?e.data:void 0}function nE(n,e,t){Ine(n,e,t).kind==="unavailable"&&hne(e.file)}function hne(n){const e=document.getElementById("compass-source-notice"),t=e??document.createElement("div");t.id="compass-source-notice",t.className="compass-source-notice",t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.textContent=["Source link unavailable.",`The exported revision for ${n} is not published by the configured remote.`,"Open this graph in VS Code to navigate to the local source."].join(" "),e||document.body.append(t)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",tE,{once:!0}):tE()})(); diff --git a/crates/compass-output/assets/viewer/manifest.json b/crates/compass-output/assets/viewer/manifest.json index 3a712caf..d0985f3e 100644 --- a/crates/compass-output/assets/viewer/manifest.json +++ b/crates/compass-output/assets/viewer/manifest.json @@ -3,12 +3,12 @@ "viewerSchema": "compass.viewer.graph/1", "files": { "graph.js": { - "bytes": 1073897, - "sha256": "69176c8da4b7a8517b99f537ad06da9d874fe60654fccab6c624de4e220027bf" + "bytes": 1082714, + "sha256": "7685967fc7467502f84d78584c060477f476b979a0777b48f23297af7ac06304" }, "viewer.css": { - "bytes": 254471, - "sha256": "883904c3c0318999104b968391e0898335da23bfd83b849fb56a41f5e3dc95c2" + "bytes": 255848, + "sha256": "a9b91d60549e949999805c6791b3f99c34e3788efb9513757458c4ea673a8646" } } } diff --git a/crates/compass-output/assets/viewer/viewer.css b/crates/compass-output/assets/viewer/viewer.css index fbc10b59..59c93f87 100644 --- a/crates/compass-output/assets/viewer/viewer.css +++ b/crates/compass-output/assets/viewer/viewer.css @@ -1 +1 @@ -@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-content:"";--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--spacing:.25rem;--container-xs:20rem;--container-md:28rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--font-weight-medium:500;--radius-md:calc(var(--radius) - 2px);--radius-4xl:2rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--compass-font-sans);--default-mono-font-family:var(--compass-font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.top-2{top:calc(var(--spacing) * 2)}.right-2{right:calc(var(--spacing) * 2)}.bottom-3{bottom:calc(var(--spacing) * 3)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-1\/2{left:50%}.left-3{left:calc(var(--spacing) * 3)}.left-4{left:calc(var(--spacing) * 4)}.isolate{isolation:isolate}.z-20{z-index:20}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mt-2{margin-top:calc(var(--spacing) * 2)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-full{width:100%;height:100%}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-\[calc\(100\%-1px\)\]{height:calc(100% - 1px)}.h-screen{height:100vh}.max-h-24{max-height:calc(var(--spacing) * 24)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\[min\(44rem\,calc\(100\%-1\.5rem\)\)\]{max-width:min(44rem,100% - 1.5rem)}.max-w-md{max-width:var(--container-md)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-7{min-width:calc(var(--spacing) * 7)}.min-w-8{min-width:calc(var(--spacing) * 8)}.min-w-9{min-width:calc(var(--spacing) * 9)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.origin-\(--radix-tooltip-content-transform-origin\){transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[calc\(-50\%_-_2px\)\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-45{rotate:45deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.touch-none{touch-action:none}.resize{resize:both}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-\[--spacing\(var\(--gap\)\)\]{gap:calc(var(--spacing) * var(--gap))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.rounded-4xl{border-radius:var(--radius-4xl)}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-\[min\(var\(--radius-md\)\,10px\)\]{border-radius:min(var(--radius-md),10px)}.rounded-\[min\(var\(--radius-md\)\,12px\)\]{border-radius:min(var(--radius-md),12px)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-border{border-color:var(--border)}.border-destructive\/50{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.border-destructive\/50{border-color:color-mix(in oklab,var(--destructive) 50%,transparent)}}.border-input{border-color:var(--input)}.border-transparent{border-color:#0000}.bg-background,.bg-background\/95{background-color:var(--background)}@supports (color:color-mix(in lab,red,red)){.bg-background\/95{background-color:color-mix(in oklab,var(--background) 95%,transparent)}}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-destructive\/10{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\/10{background-color:color-mix(in oklab,var(--destructive) 10%,transparent)}}.bg-foreground{background-color:var(--foreground)}.bg-muted{background-color:var(--muted)}.bg-popover\/95{background-color:var(--popover)}@supports (color:color-mix(in lab,red,red)){.bg-popover\/95{background-color:color-mix(in oklab,var(--popover) 95%,transparent)}}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.bg-clip-padding{background-clip:padding-box}.fill-foreground{fill:var(--foreground)}.p-1{padding:var(--spacing)}.p-3{padding:calc(var(--spacing) * 3)}.p-\[3px\]{padding:3px}.p-px{padding:1px}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.text-left{text-align:left}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[0\.8rem\]{font-size:.8rem}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-balance{text-wrap:balance}.whitespace-nowrap{white-space:nowrap}.text-background{color:var(--background)}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-foreground,.text-foreground\/60{color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.text-foreground\/60{color:color-mix(in oklab,var(--foreground) 60%,transparent)}}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-secondary-foreground{color:var(--secondary-foreground)}.underline-offset-4{text-underline-offset:4px}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.paused{animation-play-state:paused}.running{animation-play-state:running}.group-has-\[\>svg\]\/alert\:col-start-2:is(:where(.group\/alert):has(>svg) *){grid-column-start:2}.group-data-\[orientation\=horizontal\]\/tabs\:h-8:is(:where(.group\/tabs)[data-orientation=horizontal] *){height:calc(var(--spacing) * 8)}.group-data-\[orientation\=vertical\]\/tabs\:h-fit:is(:where(.group\/tabs)[data-orientation=vertical] *){height:fit-content}.group-data-\[orientation\=vertical\]\/tabs\:w-full:is(:where(.group\/tabs)[data-orientation=vertical] *){width:100%}.group-data-\[orientation\=vertical\]\/tabs\:flex-col:is(:where(.group\/tabs)[data-orientation=vertical] *){flex-direction:column}.group-data-\[orientation\=vertical\]\/tabs\:justify-start:is(:where(.group\/tabs)[data-orientation=vertical] *){justify-content:flex-start}.group-data-\[spacing\=0\]\/toggle-group\:rounded-none:is(:where(.group\/toggle-group)[data-spacing="0"] *){border-radius:0}.group-data-\[spacing\=0\]\/toggle-group\:px-2:is(:where(.group\/toggle-group)[data-spacing="0"] *){padding-inline:calc(var(--spacing) * 2)}.group-data-\[variant\=line\]\/tabs-list\:bg-transparent:is(:where(.group\/tabs-list)[data-variant=line] *){background-color:#0000}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-6::file-selector-button{height:calc(var(--spacing) * 6)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:bg-foreground:after{content:var(--tw-content);background-color:var(--foreground)}.after\:opacity-0:after{content:var(--tw-content);opacity:0}.after\:transition-opacity:after{content:var(--tw-content);transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.group-data-\[orientation\=horizontal\]\/tabs\:after\:inset-x-0:is(:where(.group\/tabs)[data-orientation=horizontal] *):after{content:var(--tw-content);inset-inline:0}.group-data-\[orientation\=horizontal\]\/tabs\:after\:bottom-\[-5px\]:is(:where(.group\/tabs)[data-orientation=horizontal] *):after{content:var(--tw-content);bottom:-5px}.group-data-\[orientation\=horizontal\]\/tabs\:after\:h-0\.5:is(:where(.group\/tabs)[data-orientation=horizontal] *):after{content:var(--tw-content);height:calc(var(--spacing) * .5)}.group-data-\[orientation\=vertical\]\/tabs\:after\:inset-y-0:is(:where(.group\/tabs)[data-orientation=vertical] *):after{content:var(--tw-content);inset-block:0}.group-data-\[orientation\=vertical\]\/tabs\:after\:-right-1:is(:where(.group\/tabs)[data-orientation=vertical] *):after{content:var(--tw-content);right:calc(var(--spacing) * -1)}.group-data-\[orientation\=vertical\]\/tabs\:after\:w-0\.5:is(:where(.group\/tabs)[data-orientation=vertical] *):after{content:var(--tw-content);width:calc(var(--spacing) * .5)}@media(hover:hover){.hover\:bg-\[color-mix\(in_oklch\,var\(--secondary\)\,var\(--foreground\)_5\%\)\]:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[color-mix\(in_oklch\,var\(--secondary\)\,var\(--foreground\)_5\%\)\]:hover{background-color:color-mix(in oklch,var(--secondary),var(--foreground) 5%)}}.hover\:bg-destructive\/20:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/20:hover{background-color:color-mix(in oklab,var(--destructive) 20%,transparent)}}.hover\:bg-muted:hover{background-color:var(--muted)}.hover\:bg-primary\/80:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/80:hover{background-color:color-mix(in oklab,var(--primary) 80%,transparent)}}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:text-muted-foreground:hover{color:var(--muted-foreground)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:z-10:focus,.focus-visible\:z-10:focus-visible{z-index:10}.focus-visible\:border-destructive\/40:focus-visible{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:border-destructive\/40:focus-visible{border-color:color-mix(in oklab,var(--destructive) 40%,transparent)}}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-3:focus-visible,.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.focus-visible\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-ring:focus-visible{outline-color:var(--ring)}.active\:not-aria-\[haspopup\]\:translate-y-px:active:not([aria-haspopup]){--tw-translate-y:1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-input\/50:disabled{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.disabled\:bg-input\/50:disabled{background-color:color-mix(in oklab,var(--input) 50%,transparent)}}.disabled\:opacity-50:disabled{opacity:.5}:where([data-slot=button-group]) .in-data-\[slot\=button-group\]\:rounded-lg{border-radius:var(--radius)}.has-data-\[icon\=inline-end\]\:pr-1:has([data-icon=inline-end]){padding-right:var(--spacing)}.has-data-\[icon\=inline-end\]\:pr-1\.5:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 1.5)}.has-data-\[icon\=inline-end\]\:pr-2:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 2)}.group-data-\[spacing\=0\]\/toggle-group\:has-data-\[icon\=inline-end\]\:pr-1\.5:is(:where(.group\/toggle-group)[data-spacing="0"] *):has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 1.5)}.has-data-\[icon\=inline-start\]\:pl-1:has([data-icon=inline-start]){padding-left:var(--spacing)}.has-data-\[icon\=inline-start\]\:pl-1\.5:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 1.5)}.has-data-\[icon\=inline-start\]\:pl-2:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 2)}.group-data-\[spacing\=0\]\/toggle-group\:has-data-\[icon\=inline-start\]\:pl-1\.5:is(:where(.group\/toggle-group)[data-spacing="0"] *):has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 1.5)}.has-data-\[slot\=alert-action\]\:relative:has([data-slot=alert-action]){position:relative}.has-data-\[slot\=alert-action\]\:pr-18:has([data-slot=alert-action]){padding-right:calc(var(--spacing) * 18)}.has-data-\[slot\=kbd\]\:pr-1\.5:has([data-slot=kbd]){padding-right:calc(var(--spacing) * 1.5)}.has-\[\>svg\]\:grid-cols-\[auto_1fr\]:has(>svg){grid-template-columns:auto 1fr}.has-\[\>svg\]\:gap-x-2:has(>svg){column-gap:calc(var(--spacing) * 2)}.aria-expanded\:bg-muted[aria-expanded=true]{background-color:var(--muted)}.aria-expanded\:bg-secondary[aria-expanded=true]{background-color:var(--secondary)}.aria-expanded\:text-foreground[aria-expanded=true]{color:var(--foreground)}.aria-expanded\:text-secondary-foreground[aria-expanded=true]{color:var(--secondary-foreground)}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-3[aria-invalid=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.aria-pressed\:bg-muted[aria-pressed=true]{background-color:var(--muted)}.data-closed\:animate-out[data-closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-closed\:fade-out-0[data-closed]{--tw-exit-opacity:0}.data-closed\:zoom-out-95[data-closed]{--tw-exit-scale:.95}.data-horizontal\:h-2\.5[data-horizontal]{height:calc(var(--spacing) * 2.5)}.data-horizontal\:h-px[data-horizontal]{height:1px}.data-horizontal\:w-full[data-horizontal]{width:100%}.data-horizontal\:flex-col[data-horizontal]{flex-direction:column}.data-horizontal\:border-t[data-horizontal]{border-top-style:var(--tw-border-style);border-top-width:1px}.data-horizontal\:border-t-transparent[data-horizontal]{border-top-color:#0000}.data-open\:animate-in[data-open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-open\:fade-in-0[data-open]{--tw-enter-opacity:0}.data-open\:zoom-in-95[data-open]{--tw-enter-scale:.95}.data-vertical\:h-full[data-vertical]{height:100%}.data-vertical\:w-2\.5[data-vertical]{width:calc(var(--spacing) * 2.5)}.data-vertical\:w-px[data-vertical]{width:1px}.data-vertical\:flex-col[data-vertical]{flex-direction:column}.data-vertical\:items-stretch[data-vertical]{align-items:stretch}.data-vertical\:self-stretch[data-vertical]{align-self:stretch}.data-vertical\:border-l[data-vertical]{border-left-style:var(--tw-border-style);border-left-width:1px}.data-vertical\:border-l-transparent[data-vertical]{border-left-color:#0000}.data-\[orientation\=horizontal\]\:flex-col[data-orientation=horizontal]{flex-direction:column}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[size\=sm\]\:rounded-\[min\(var\(--radius-md\)\,10px\)\][data-size=sm]{border-radius:min(var(--radius-md),10px)}:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:color-mix(in oklab,var(--destructive) 90%,transparent)}}:is(.\*\*\:data-\[slot\=kbd\]\:relative *)[data-slot=kbd]{position:relative}:is(.\*\*\:data-\[slot\=kbd\]\:isolate *)[data-slot=kbd]{isolation:isolate}:is(.\*\*\:data-\[slot\=kbd\]\:z-50 *)[data-slot=kbd]{z-index:50}:is(.\*\*\:data-\[slot\=kbd\]\:rounded-sm *)[data-slot=kbd]{border-radius:calc(var(--radius) - 4px)}.group-data-horizontal\/toggle-group\:data-\[spacing\=0\]\:first\:rounded-l-lg:is(:where(.group\/toggle-group)[data-horizontal] *)[data-spacing="0"]:first-child{border-top-left-radius:var(--radius);border-bottom-left-radius:var(--radius)}.group-data-vertical\/toggle-group\:data-\[spacing\=0\]\:first\:rounded-t-lg:is(:where(.group\/toggle-group)[data-vertical] *)[data-spacing="0"]:first-child{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.group-data-horizontal\/toggle-group\:data-\[spacing\=0\]\:last\:rounded-r-lg:is(:where(.group\/toggle-group)[data-horizontal] *)[data-spacing="0"]:last-child{border-top-right-radius:var(--radius);border-bottom-right-radius:var(--radius)}.group-data-vertical\/toggle-group\:data-\[spacing\=0\]\:last\:rounded-b-lg:is(:where(.group\/toggle-group)[data-vertical] *)[data-spacing="0"]:last-child{border-bottom-right-radius:var(--radius);border-bottom-left-radius:var(--radius)}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:var(--background)}.data-\[state\=active\]\:text-foreground[data-state=active]{color:var(--foreground)}.group-data-\[variant\=default\]\/tabs-list\:data-\[state\=active\]\:shadow-sm:is(:where(.group\/tabs-list)[data-variant=default] *)[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:bg-transparent:is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]{background-color:#0000}.group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:shadow-none:is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:after\:opacity-100:is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]:after{content:var(--tw-content);opacity:1}.data-\[state\=delayed-open\]\:animate-in[data-state=delayed-open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=delayed-open\]\:fade-in-0[data-state=delayed-open]{--tw-enter-opacity:0}.data-\[state\=delayed-open\]\:zoom-in-95[data-state=delayed-open]{--tw-enter-scale:.95}.data-\[state\=on\]\:bg-muted[data-state=on]{background-color:var(--muted)}.data-\[variant\=line\]\:rounded-none[data-variant=line]{border-radius:0}.group-data-horizontal\/toggle-group\:data-\[spacing\=0\]\:data-\[variant\=outline\]\:border-l-0:is(:where(.group\/toggle-group)[data-horizontal] *)[data-spacing="0"][data-variant=outline]{border-left-style:var(--tw-border-style);border-left-width:0}.group-data-vertical\/toggle-group\:data-\[spacing\=0\]\:data-\[variant\=outline\]\:border-t-0:is(:where(.group\/toggle-group)[data-vertical] *)[data-spacing="0"][data-variant=outline]{border-top-style:var(--tw-border-style);border-top-width:0}.group-data-horizontal\/toggle-group\:data-\[spacing\=0\]\:data-\[variant\=outline\]\:first\:border-l:is(:where(.group\/toggle-group)[data-horizontal] *)[data-spacing="0"][data-variant=outline]:first-child{border-left-style:var(--tw-border-style);border-left-width:1px}.group-data-vertical\/toggle-group\:data-\[spacing\=0\]\:data-\[variant\=outline\]\:first\:border-t:is(:where(.group\/toggle-group)[data-vertical] *)[data-spacing="0"][data-variant=outline]:first-child{border-top-style:var(--tw-border-style);border-top-width:1px}@media(min-width:48rem){.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.md\:text-pretty{text-wrap:pretty}}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:bg-destructive\/20:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-destructive\/20:is(.dark *){background-color:color-mix(in oklab,var(--destructive) 20%,transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:text-muted-foreground:is(.dark *){color:var(--muted-foreground)}@media(hover:hover){.dark\:hover\:bg-destructive\/30:is(.dark *):hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-destructive\/30:is(.dark *):hover{background-color:color-mix(in oklab,var(--destructive) 30%,transparent)}}.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input) 50%,transparent)}}.dark\:hover\:bg-muted\/50:is(.dark *):hover{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-muted\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}.dark\:hover\:text-foreground:is(.dark *):hover{color:var(--foreground)}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:disabled\:bg-input\/80:is(.dark *):disabled{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:disabled\:bg-input\/80:is(.dark *):disabled{background-color:color-mix(in oklab,var(--input) 80%,transparent)}}.dark\:aria-invalid\:border-destructive\/50:is(.dark *)[aria-invalid=true]{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:border-destructive\/50:is(.dark *)[aria-invalid=true]{border-color:color-mix(in oklab,var(--destructive) 50%,transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:data-\[state\=active\]\:border-input:is(.dark *)[data-state=active]{border-color:var(--input)}.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:data-\[state\=active\]\:text-foreground:is(.dark *)[data-state=active]{color:var(--foreground)}.dark\:group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:border-transparent:is(.dark *):is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]{border-color:#0000}.dark\:group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:bg-transparent:is(.dark *):is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]{background-color:#0000}.\[\&_a\]\:underline a{text-decoration-line:underline}.\[\&_a\]\:underline-offset-3 a{text-underline-offset:3px}@media(hover:hover){.\[\&_a\]\:hover\:text-foreground a:hover{color:var(--foreground)}}.\[\&_p\:not\(\:last-child\)\]\:mb-4 p:not(:last-child){margin-bottom:calc(var(--spacing) * 4)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3\.5 svg:not([class*=size-]){width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}@media(hover:hover){.\[a\]\:hover\:bg-destructive\/20:is(a):hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.\[a\]\:hover\:bg-destructive\/20:is(a):hover{background-color:color-mix(in oklab,var(--destructive) 20%,transparent)}}.\[a\]\:hover\:bg-muted:is(a):hover{background-color:var(--muted)}.\[a\]\:hover\:bg-primary\/80:is(a):hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[a\]\:hover\:bg-primary\/80:is(a):hover{background-color:color-mix(in oklab,var(--primary) 80%,transparent)}}.\[a\]\:hover\:bg-secondary\/80:is(a):hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.\[a\]\:hover\:bg-secondary\/80:is(a):hover{background-color:color-mix(in oklab,var(--secondary) 80%,transparent)}}.\[a\]\:hover\:text-muted-foreground:is(a):hover{color:var(--muted-foreground)}}:is(.\*\:\[svg\]\:row-span-2>*):is(svg){grid-row:span 2/span 2}:is(.\*\:\[svg\]\:translate-y-0\.5>*):is(svg){--tw-translate-y:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}:is(.\*\:\[svg\]\:text-current>*):is(svg){color:currentColor}:is(.\*\:\[svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4>*):is(svg:not([class*=size-])){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&\>svg\]\:pointer-events-none>svg{pointer-events:none}.\[\&\>svg\]\:size-3\!>svg{width:calc(var(--spacing) * 3)!important;height:calc(var(--spacing) * 3)!important}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}.init-shell{box-sizing:border-box;background:linear-gradient(var(--compass-grid) 1px,transparent 1px),linear-gradient(90deg,var(--compass-grid) 1px,transparent 1px),var(--background);height:100vh;min-height:100vh;color:var(--foreground);background-size:32px 32px;padding:clamp(28px,5vw,72px);overflow:auto}.init-header,.init-progress-header{justify-content:space-between;align-items:flex-end;gap:28px;width:min(1080px,100%);margin:0 auto clamp(26px,4vw,46px);display:flex}.init-eyebrow{color:var(--compass-focus);font:600 11px/1.3 var(--compass-font-mono);letter-spacing:.12em;text-transform:uppercase;margin:0 0 8px}.init-header h1,.init-progress-header h1,.init-result-card h1{color:var(--foreground);font:600 clamp(28px,4vw,44px)/1.08 var(--compass-font-sans);letter-spacing:-.035em;margin:0}.init-header-copy,.init-progress-header p:not(.init-eyebrow),.init-result-card>p:not(.init-eyebrow){max-width:650px;color:var(--muted-foreground);margin:13px 0 0;font-size:14px;line-height:1.65}.init-repository-badge{border:1px solid var(--compass-line);background:var(--vscode-editorWidget-background,var(--compass-panel));border-radius:5px;align-items:center;gap:11px;min-width:190px;max-width:320px;padding:11px 13px;display:flex}.init-repository-badge>svg{width:16px;color:var(--compass-focus)}.init-repository-badge span{min-width:0}.init-repository-badge small,.init-repository-badge strong{display:block}.init-repository-badge small{color:var(--compass-faint);font:10px/1.2 var(--compass-font-mono);text-transform:uppercase;margin-bottom:2px}.init-repository-badge strong{text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.init-layout{border:1px solid var(--compass-line-strong);background:var(--vscode-editorWidget-background,var(--compass-panel));width:min(1080px,100%);min-height:520px;box-shadow:0 22px 55px var(--vscode-widget-shadow,#0000003d);border-radius:7px;grid-template-columns:245px minmax(0,1fr);margin:0 auto;display:grid;overflow:hidden}.init-step-nav{border-right:1px solid var(--compass-line);background:var(--compass-panel);flex-direction:column;justify-content:space-between;min-width:0;padding:27px 20px 20px;display:flex}@supports (color:color-mix(in lab,red,red)){.init-step-nav{background:color-mix(in srgb,var(--compass-panel) 88%,var(--compass-canvas))}}.init-step-nav ol,.init-runway,.init-rule-list{margin:0;padding:0;list-style:none}.init-step-nav li{padding-bottom:10px;position:relative}.init-step-nav li:not(:last-child):after{background:var(--compass-line);content:"";width:1px;position:absolute;top:37px;bottom:-1px;left:22px}.init-step-nav li[data-state=complete]:after{background:var(--compass-success)}@supports (color:color-mix(in lab,red,red)){.init-step-nav li[data-state=complete]:after{background:color-mix(in srgb,var(--compass-success) 62%,var(--compass-line))}}.init-step-nav button{width:100%;color:var(--muted-foreground);text-align:left;background:0 0;border:0;border-radius:4px;align-items:center;gap:11px;padding:7px;display:flex}.init-step-nav button:not(:disabled):hover{background:var(--workbench-hover);color:var(--foreground)}.init-step-nav button:focus-visible{outline:2px solid var(--compass-focus);outline-offset:1px}.init-step-marker{z-index:1;border:1px solid var(--compass-line-strong);background:var(--compass-panel);border-radius:50%;flex:0 0 30px;place-items:center;width:30px;height:30px;display:grid}.init-step-marker svg{width:13px;height:13px}.init-step-nav li[data-state=active] button{color:var(--foreground)}.init-step-nav li[data-state=active] .init-step-marker{border-color:var(--compass-focus);background:var(--compass-focus-soft);color:var(--compass-focus);box-shadow:0 0 0 4px var(--compass-focus-soft)}.init-step-nav li[data-state=complete] .init-step-marker{border-color:var(--compass-success);color:var(--compass-success)}.init-step-nav button small,.init-step-nav button strong{display:block}.init-step-nav button small{color:var(--compass-faint);font:9px/1.2 var(--compass-font-mono);letter-spacing:.06em;text-transform:uppercase;margin-bottom:2px}.init-step-nav button strong{font-size:12px;font-weight:550}.init-local-note{border:1px solid var(--compass-line);background:var(--compass-focus);border-radius:5px;align-items:flex-start;gap:9px;padding:12px;display:flex}@supports (color:color-mix(in lab,red,red)){.init-local-note{background:color-mix(in srgb,var(--compass-focus) 6%,transparent)}}.init-local-note>svg{width:14px;color:var(--compass-focus);flex:0 0 14px}.init-local-note p{color:var(--muted-foreground);margin:0;font-size:10px;line-height:1.5}.init-local-note strong,.init-local-note code{display:block}.init-local-note strong{color:var(--foreground);margin-bottom:2px;font-size:10px}.init-local-note code{color:var(--compass-focus);font-family:var(--compass-font-mono);margin-top:4px}.init-stage{flex-direction:column;min-width:0;padding:clamp(28px,5vw,52px);display:flex}.init-stage-heading{align-items:flex-start;gap:16px;margin-bottom:28px;display:flex}.init-stage-heading>span{color:var(--compass-focus);font:600 11px/1 var(--compass-font-mono);padding-top:5px}.init-stage-heading h2{color:var(--foreground);font:600 clamp(21px,3vw,28px)/1.2 var(--compass-font-sans);letter-spacing:-.025em;margin:0}.init-stage-heading p{color:var(--muted-foreground);margin:8px 0 0;font-size:12px;line-height:1.55}.init-scope-grid,.init-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;display:grid}.init-choice{border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--background));cursor:pointer;border-radius:6px;align-items:flex-start;gap:12px;min-height:125px;padding:18px;display:flex;position:relative}.init-choice:hover{border-color:var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.init-choice:hover{border-color:color-mix(in srgb,var(--compass-focus) 48%,var(--compass-line))}}.init-choice[data-selected=true]{border-color:var(--compass-focus);background:var(--compass-focus-soft);box-shadow:inset 0 0 0 1px var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.init-choice[data-selected=true]{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--compass-focus) 30%,transparent)}}.init-choice input{opacity:0;width:1px;height:1px;position:absolute}.init-choice:has(input:focus-visible){outline:2px solid var(--compass-focus);outline-offset:2px}.init-choice-radio{width:20px;height:20px;color:var(--compass-faint);flex:0 0 20px;place-items:center;display:grid}.init-choice-radio svg{fill:#0000;width:16px}.init-choice[data-selected=true] .init-choice-radio svg{fill:var(--compass-focus);color:var(--compass-focus);stroke-width:4px}.init-choice strong,.init-choice small{display:block}.init-choice strong{color:var(--foreground);margin:1px 0 8px;font-size:13px}.init-choice small{color:var(--muted-foreground);font-size:11px;line-height:1.55}.init-scope-browser{border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--background));border-radius:6px;margin-top:16px;overflow:hidden}.init-scope-browser>header{border-bottom:1px solid var(--compass-line);background:var(--compass-panel);justify-content:space-between;align-items:center;gap:16px;min-height:47px;padding:0 14px;display:flex}@supports (color:color-mix(in lab,red,red)){.init-scope-browser>header{background:color-mix(in srgb,var(--compass-panel) 84%,transparent)}}.init-scope-browser>header strong,.init-scope-browser>header small{display:block}.init-scope-browser>header strong{color:var(--foreground);margin-bottom:3px;font-size:11px}.init-scope-browser>header small{color:var(--compass-faint);font-size:9px}.init-scope-browser>header>span{border:1px solid var(--compass-focus);flex:none;padding:4px 7px}@supports (color:color-mix(in lab,red,red)){.init-scope-browser>header>span{border:1px solid color-mix(in srgb,var(--compass-focus) 45%,var(--compass-line))}}.init-scope-browser>header>span{background:var(--compass-focus-soft);color:var(--compass-focus);font:600 9px/1 var(--compass-font-mono);border-radius:999px}.init-scope-toolbar{border-bottom:1px solid var(--compass-line);align-items:center;gap:7px;height:35px;padding:0 10px;display:flex}.init-scope-toolbar>svg{width:13px;color:var(--compass-faint)}.init-scope-toolbar input{min-width:0;color:var(--foreground);font:10px/1.3 var(--compass-font-sans);background:0 0;border:0;outline:0;flex:1}.init-scope-toolbar input::placeholder{color:var(--vscode-input-placeholderForeground,var(--compass-faint))}.init-scope-toolbar:focus-within{box-shadow:inset 0 0 0 1px var(--compass-focus)}.init-scope-toolbar button,.init-scope-ledger button{width:22px;height:22px;color:var(--compass-faint);background:0 0;border:0;border-radius:3px;place-items:center;padding:0;display:grid}.init-scope-toolbar button:hover,.init-scope-ledger button:hover{background:var(--workbench-hover);color:var(--foreground)}.init-scope-toolbar button svg,.init-scope-ledger button svg{width:12px}.init-scope-body{grid-template-rows:minmax(0,1fr);grid-template-columns:minmax(0,1.45fr) minmax(180px,.8fr);height:clamp(230px,38vh,310px);min-height:0;display:grid;overflow:hidden}.init-scope-tree{overscroll-behavior:contain;border-right:1px solid var(--compass-line);scrollbar-gutter:stable;min-width:0;min-height:0;padding:6px 0;overflow:auto}.init-scope-tree:focus-visible{outline:2px solid var(--compass-focus);outline-offset:-2px}.init-scope-row{box-sizing:border-box;align-items:center;min-width:max-content;height:27px;padding-right:9px;display:flex}.init-scope-row:hover{background:var(--workbench-hover)}.init-scope-disclosure{width:20px;height:22px;color:var(--compass-faint);background:0 0;border:0;border-radius:3px;flex:0 0 20px;place-items:center;padding:0;display:grid}button.init-scope-disclosure:hover{color:var(--foreground)}.init-scope-disclosure svg{width:13px}.init-scope-row label{min-width:0;color:var(--muted-foreground);cursor:pointer;flex:1;align-items:center;gap:7px;font-size:10px;display:flex}.init-scope-row label input{width:13px;height:13px;accent-color:var(--compass-focus);margin:0}.init-scope-row label svg{width:13px;height:13px;color:var(--compass-focus)}.init-scope-row label span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.init-scope-ledger{overscroll-behavior:contain;background:var(--compass-panel);min-width:0;min-height:0;padding:10px;overflow:auto}@supports (color:color-mix(in lab,red,red)){.init-scope-ledger{background:color-mix(in srgb,var(--compass-panel) 73%,transparent)}}.init-scope-ledger{scrollbar-gutter:stable}.init-scope-ledger>div{padding:2px 3px 9px}.init-scope-ledger strong,.init-scope-ledger small{display:block}.init-scope-ledger strong{color:var(--foreground);margin-bottom:3px;font-size:10px}.init-scope-ledger small,.init-scope-ledger>p,.init-scope-empty,.init-scope-notice{color:var(--compass-faint);font-size:9px;line-height:1.45}.init-scope-ledger>p,.init-scope-empty{margin:8px 3px}.init-scope-ledger ul{margin:0;padding:0;list-style:none}.init-scope-ledger li{border-top:1px solid var(--compass-line);align-items:center;gap:5px;min-width:0;padding:4px 3px 4px 7px;display:flex}.init-scope-ledger code{min-width:0;color:var(--foreground);font:9px/1.4 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.init-scope-notice{border-top:1px solid var(--compass-line);background:var(--compass-warning);margin:0;padding:7px 12px}@supports (color:color-mix(in lab,red,red)){.init-scope-notice{background:color-mix(in srgb,var(--compass-warning) 7%,transparent)}}.init-scope-notice{color:var(--compass-warning)}.init-facts{border:1px solid var(--compass-line);border-radius:5px;grid-template-columns:1.5fr 1fr 1fr;margin:22px 0 0;display:grid;overflow:hidden}.init-facts>div{background:var(--compass-panel);min-width:0;padding:11px 13px}@supports (color:color-mix(in lab,red,red)){.init-facts>div{background:color-mix(in srgb,var(--compass-panel) 82%,transparent)}}.init-facts>div:not(:last-child){border-right:1px solid var(--compass-line)}.init-facts dt,.init-review-row>span{color:var(--compass-faint);font:9px/1.2 var(--compass-font-mono);text-transform:uppercase}.init-facts dt{margin-bottom:4px}.init-facts dd{min-width:0;color:var(--muted-foreground);text-overflow:ellipsis;white-space:nowrap;margin:0;font-size:10px;overflow:hidden}.init-facts code,.init-review-row code{font-family:var(--compass-font-mono)}.init-fields{gap:18px}.init-fields label>span{margin-bottom:9px;display:block}.init-fields label strong,.init-fields label small{display:block}.init-fields label strong{color:var(--foreground);margin-bottom:3px;font-size:12px}.init-fields label small{color:var(--compass-faint);font-size:10px}.init-fields textarea{box-sizing:border-box;resize:vertical;border:1px solid var(--vscode-input-border,var(--compass-line));background:var(--vscode-input-background,var(--background));width:100%;min-height:142px;color:var(--vscode-input-foreground,var(--foreground));font:11px/1.6 var(--compass-font-mono);border-radius:4px;outline:none;padding:11px 12px}.init-fields textarea::placeholder{color:var(--vscode-input-placeholderForeground,var(--compass-faint))}.init-fields textarea:focus{border-color:var(--compass-focus);outline:1px solid var(--compass-focus)}.init-fields textarea:disabled{opacity:.55;cursor:not-allowed}.init-validation{color:var(--destructive);margin:12px 0 0;font-size:11px}.init-stage-actions{justify-content:space-between;align-items:center;gap:10px;margin-top:auto;padding-top:30px;display:flex}.init-button{min-height:32px;font:500 12px/1.3 var(--compass-font-sans);border:1px solid #0000;border-radius:3px;justify-content:center;align-items:center;gap:8px;padding:6px 13px;display:inline-flex}.init-button svg{width:14px;height:14px}.init-button:focus-visible{outline:2px solid var(--compass-focus);outline-offset:2px}.init-button:disabled{opacity:.45;cursor:not-allowed}.init-button-primary{border-color:var(--vscode-button-border,transparent);background:var(--vscode-button-background,var(--primary));color:var(--vscode-button-foreground,var(--primary-foreground))}.init-button-primary:not(:disabled):hover{background:var(--vscode-button-hoverBackground,var(--primary))}.init-button-secondary{border-color:var(--compass-line);background:var(--vscode-button-secondaryBackground,var(--secondary));color:var(--vscode-button-secondaryForeground,var(--secondary-foreground))}.init-button-secondary:not(:disabled):hover,.init-button-quiet:hover{border-color:var(--compass-line-strong);background:var(--workbench-hover);color:var(--foreground)}.init-button-quiet{color:var(--muted-foreground);background:0 0}.init-button-build{min-width:170px}.init-review{border:1px solid var(--compass-line);border-radius:5px;overflow:hidden}.init-review-row{border-bottom:1px solid var(--compass-line);grid-template-columns:130px minmax(0,1fr);align-items:start;min-height:42px;display:grid}.init-review-row:last-child{border-bottom:0}.init-review-row>span{background:var(--compass-panel);align-self:stretch;padding:12px 13px}@supports (color:color-mix(in lab,red,red)){.init-review-row>span{background:color-mix(in srgb,var(--compass-panel) 76%,transparent)}}.init-review-row>div{min-width:0;color:var(--foreground);padding:11px 13px;font-size:11px}.init-review-row code{overflow-wrap:anywhere;color:var(--foreground)}.init-rule-default{color:var(--muted-foreground)}.init-rule-list{flex-wrap:wrap;gap:6px;display:flex}.init-rule-list li{border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--background));border-radius:3px;padding:3px 7px}.init-build-callout{border-left:2px solid var(--compass-focus);background:var(--compass-focus-soft);align-items:flex-start;gap:12px;margin-top:16px;padding:13px 15px;display:flex}.init-build-callout>svg{width:17px;color:var(--compass-focus);flex:0 0 17px}.init-build-callout strong{color:var(--foreground);margin-bottom:3px;font-size:11px;display:block}.init-build-callout p{color:var(--muted-foreground);margin:0;font-size:10px;line-height:1.45}.init-replace-confirmation{border:1px solid var(--compass-warning);align-items:flex-start;gap:10px;margin-top:10px;padding:12px 14px;display:flex}@supports (color:color-mix(in lab,red,red)){.init-replace-confirmation{border:1px solid color-mix(in srgb,var(--compass-warning) 55%,var(--compass-line))}}.init-replace-confirmation{background:var(--compass-warning);border-radius:4px}@supports (color:color-mix(in lab,red,red)){.init-replace-confirmation{background:color-mix(in srgb,var(--compass-warning) 8%,transparent)}}.init-replace-confirmation{cursor:pointer}.init-replace-confirmation input{accent-color:var(--compass-focus);margin:2px 0 0}.init-replace-confirmation strong,.init-replace-confirmation small{display:block}.init-replace-confirmation strong{color:var(--compass-warning);margin-bottom:3px;font-size:11px}.init-replace-confirmation small{color:var(--muted-foreground);font-size:10px;line-height:1.45}.init-progress-shell{flex-direction:column;display:flex}.init-progress-header{align-items:center}.init-running-badge{border:1px solid var(--compass-focus);align-items:center;gap:7px;padding:6px 10px;display:inline-flex}@supports (color:color-mix(in lab,red,red)){.init-running-badge{border:1px solid color-mix(in srgb,var(--compass-focus) 46%,var(--compass-line))}}.init-running-badge{background:var(--compass-focus-soft);color:var(--compass-focus);font:600 10px/1 var(--compass-font-mono);text-transform:uppercase;border-radius:999px}.init-running-badge svg,.init-runway li[data-state=active] .init-runway-marker svg{animation:1.2s linear infinite init-spin}.init-progress-card{box-sizing:border-box;border:1px solid var(--compass-line-strong);background:var(--vscode-editorWidget-background,var(--compass-panel));width:min(880px,100%);box-shadow:0 22px 55px var(--vscode-widget-shadow,#0000003d);border-radius:7px;margin:auto;padding:clamp(26px,5vw,48px)}.init-progress-summary{justify-content:space-between;align-items:flex-end;gap:20px;display:flex}.init-progress-summary small,.init-progress-summary strong{display:block}.init-progress-summary small{color:var(--compass-faint);font:10px/1.2 var(--compass-font-mono);letter-spacing:.08em;text-transform:uppercase;margin-bottom:7px}.init-progress-summary strong{color:var(--foreground);font-size:18px;font-weight:580}.init-progress-summary>span{color:var(--compass-focus);font:600 24px/1 var(--compass-font-mono)}.init-progress-track{background:var(--foreground);border-radius:99px;height:7px;margin:18px 0 22px;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.init-progress-track{background:color-mix(in srgb,var(--foreground) 10%,transparent)}}.init-progress-track>span{border-radius:inherit;background:var(--workbench-progress);height:100%;box-shadow:0 0 15px var(--compass-focus);display:block}@supports (color:color-mix(in lab,red,red)){.init-progress-track>span{box-shadow:0 0 15px color-mix(in srgb,var(--compass-focus) 50%,transparent)}}.init-progress-track>span{transition:width .18s ease-out}.init-progress-track>span.is-indeterminate{width:28%;animation:1.35s ease-in-out infinite init-indeterminate}.init-current-file{border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--compass-canvas));border-radius:5px;align-items:center;gap:12px;min-width:0;padding:13px 15px;display:flex}.init-current-file>svg{width:16px;color:var(--compass-focus);flex:0 0 16px}.init-current-file span{min-width:0}.init-current-file small,.init-current-file code{display:block}.init-current-file small{color:var(--compass-faint);font:9px/1 var(--compass-font-mono);text-transform:uppercase;margin-bottom:4px}.init-current-file code{color:var(--foreground);font:11px/1.4 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.init-runway{grid-template-columns:repeat(3,minmax(0,1fr));margin-top:30px;display:grid}.init-runway li{align-items:flex-start;gap:10px;display:flex;position:relative}.init-runway li:not(:last-child):after{background:var(--compass-line);content:"";height:1px;position:absolute;top:13px;left:27px;right:8px}.init-runway li[data-state=complete]:after{background:var(--compass-success)}@supports (color:color-mix(in lab,red,red)){.init-runway li[data-state=complete]:after{background:color-mix(in srgb,var(--compass-success) 58%,var(--compass-line))}}.init-runway-marker{z-index:1;border:1px solid var(--compass-line-strong);background:var(--compass-panel);width:26px;height:26px;color:var(--compass-faint);border-radius:50%;flex:0 0 26px;place-items:center;display:grid}.init-runway-marker svg{width:12px;height:12px}.init-runway li[data-state=complete] .init-runway-marker{border-color:var(--compass-success);color:var(--compass-success)}.init-runway li[data-state=active] .init-runway-marker{border-color:var(--compass-focus);color:var(--compass-focus);box-shadow:0 0 0 4px var(--compass-focus-soft)}.init-runway li>span:last-child{min-width:0;padding-right:20px}.init-runway strong,.init-runway small{display:block}.init-runway strong{color:var(--foreground);margin:1px 0 4px;font-size:10px}.init-runway small{color:var(--compass-faint);font-size:9px;line-height:1.35}.init-progress-footer{box-sizing:border-box;justify-content:space-between;align-items:center;gap:20px;width:min(880px,100%);margin:22px auto 0;display:flex}.init-progress-footer p{color:var(--compass-faint);margin:0;font-size:10px}.init-result-shell{place-items:center;display:grid}.init-result-card{box-sizing:border-box;border:1px solid var(--compass-line-strong);background:var(--vscode-editorWidget-background,var(--compass-panel));width:min(580px,100%);box-shadow:0 22px 55px var(--vscode-widget-shadow,#0000003d);text-align:center;border-radius:7px;padding:clamp(32px,6vw,60px)}.init-result-icon{border:1px solid;border-radius:50%;place-items:center;width:54px;height:54px;margin:0 auto 22px;display:grid}.init-result-icon svg{width:24px}.init-result-icon-success{border-color:var(--compass-success);background:var(--compass-success)}@supports (color:color-mix(in lab,red,red)){.init-result-icon-success{background:color-mix(in srgb,var(--compass-success) 10%,transparent)}}.init-result-icon-success{color:var(--compass-success)}.init-result-icon-error{border-color:var(--destructive);background:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.init-result-icon-error{background:color-mix(in srgb,var(--destructive) 10%,transparent)}}.init-result-icon-error{color:var(--destructive)}.init-result-icon-cancelled{border-color:var(--compass-warning);background:var(--compass-warning)}@supports (color:color-mix(in lab,red,red)){.init-result-icon-cancelled{background:color-mix(in srgb,var(--compass-warning) 10%,transparent)}}.init-result-icon-cancelled{color:var(--compass-warning)}.init-result-card .init-eyebrow{text-align:center}.init-result-card>p:not(.init-eyebrow){margin-left:auto;margin-right:auto}.init-result-actions{flex-wrap:wrap;justify-content:center;gap:9px;margin-top:26px;display:flex}@keyframes init-spin{to{transform:rotate(360deg)}}@keyframes init-indeterminate{0%{transform:translate(-120%)}55%{transform:translate(180%)}to{transform:translate(320%)}}@media(max-width:760px){.init-shell{padding:24px 18px}.init-header,.init-progress-header{flex-direction:column;align-items:flex-start}.init-repository-badge{box-sizing:border-box;width:100%}.init-layout{grid-template-columns:1fr}.init-step-nav{border-right:0;border-bottom:1px solid var(--compass-line);padding:16px}.init-step-nav ol{grid-template-columns:repeat(3,1fr);display:grid}.init-step-nav li{padding:0}.init-step-nav li:not(:last-child):after{width:auto;height:1px;inset:22px -8px auto 37px}.init-step-nav button{flex-direction:column;align-items:flex-start}.init-step-nav button strong{font-size:10px}.init-local-note{display:none}.init-scope-grid,.init-fields{grid-template-columns:1fr}.init-scope-browser>header{flex-direction:column;align-items:flex-start;gap:8px;padding-block:10px}.init-scope-body{grid-template-rows:auto auto;grid-template-columns:1fr;height:auto;max-height:none;overflow:visible}.init-scope-tree{border-right:0;border-bottom:1px solid var(--compass-line);height:clamp(210px,42vh,300px);min-height:210px;max-height:none}.init-scope-ledger{max-height:150px}.init-facts{grid-template-columns:1fr}.init-facts>div:not(:last-child){border-right:0;border-bottom:1px solid var(--compass-line)}.init-review-row{grid-template-columns:95px minmax(0,1fr)}.init-runway{grid-template-columns:1fr;gap:13px}.init-runway li:not(:last-child):after{width:1px;height:auto;inset:26px auto -13px 13px}.init-progress-footer{flex-direction:column;align-items:flex-start}}@media(prefers-reduced-motion:reduce){.init-running-badge svg,.init-runway li[data-state=active] .init-runway-marker svg,.init-progress-track>span.is-indeterminate{animation:none}.init-progress-track>span{transition:none}}:root{color-scheme:light dark;--compass-font-sans:var(--vscode-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);--compass-font-mono:var(--vscode-editor-font-family,"SFMono-Regular", Consolas, monospace);--background:var(--vscode-editor-background,#0d131d);--foreground:var(--vscode-editor-foreground,#d7e1ed);--card:var(--vscode-sideBar-background,#121b28);--card-foreground:var(--vscode-sideBar-foreground,#d7e1ed);--popover:var(--vscode-menu-background,#172231);--popover-foreground:var(--vscode-menu-foreground,#d7e1ed);--primary:var(--vscode-button-background,#2f81f7);--primary-foreground:var(--vscode-button-foreground,#fff);--secondary:var(--vscode-button-secondaryBackground,#263448);--secondary-foreground:var(--vscode-button-secondaryForeground,#d7e1ed);--muted:var(--vscode-list-inactiveSelectionBackground,#1d2938);--muted-foreground:var(--vscode-descriptionForeground,#93a4b8);--accent:var(--vscode-list-activeSelectionBackground,#264f78);--accent-foreground:var(--vscode-list-activeSelectionForeground,#fff);--destructive:var(--vscode-errorForeground,#f47067);--border:var(--vscode-panel-border,#2c3a4d);--input:var(--vscode-input-border,#3b4a5e);--ring:var(--vscode-focusBorder,#4f9cf9);--radius:.625rem;--compass-canvas:var(--vscode-editor-background,#08111f);--compass-canvas-deep:var(--compass-canvas)}@supports (color:color-mix(in lab,red,red)){:root{--compass-canvas-deep:color-mix(in srgb, var(--compass-canvas) 82%, #000)}}:root{--compass-panel:var(--vscode-sideBar-background,#101b2d);--compass-panel-raised:var(--vscode-menu-background,#142236)}@supports (color:color-mix(in lab,red,red)){:root{--compass-panel-raised:color-mix(in srgb, var(--vscode-menu-background,#142236) 88%, transparent)}}:root{--compass-line:var(--vscode-panel-border,#9ab2d329);--compass-line-strong:var(--vscode-contrastBorder,#9ab2d34d);--compass-focus:var(--vscode-focusBorder,#76b7ff);--compass-focus-soft:var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){:root{--compass-focus-soft:color-mix(in srgb, var(--compass-focus) 14%, transparent)}}:root{--compass-faint:var(--vscode-disabledForeground,#60728b);--compass-grid:var(--foreground)}@supports (color:color-mix(in lab,red,red)){:root{--compass-grid:color-mix(in srgb, var(--foreground) 16%, transparent)}}:root{--compass-success:var(--vscode-testing-iconPassed,#3fb950);--compass-warning:var(--vscode-editorWarning-foreground,#d29922);--sidebar:var(--vscode-sideBar-background,var(--background));--sidebar-foreground:var(--vscode-sideBar-foreground,var(--foreground));--sidebar-accent:var(--vscode-list-activeSelectionBackground,var(--accent));--sidebar-accent-foreground:var(--vscode-list-activeSelectionForeground,var(--accent-foreground));--sidebar-primary:var(--vscode-focusBorder,var(--ring));--workbench-hover:var(--vscode-list-hoverBackground,var(--foreground))}@supports (color:color-mix(in lab,red,red)){:root{--workbench-hover:var(--vscode-list-hoverBackground,color-mix(in srgb, var(--foreground) 7%, transparent))}}:root{--workbench-hover-foreground:var(--vscode-list-hoverForeground,var(--foreground));--workbench-table-header:var(--vscode-editorStickyScroll-background,var(--background));--workbench-link:var(--vscode-textLink-foreground,var(--ring));--workbench-progress:var(--vscode-progressBar-background,var(--ring))}@media(prefers-color-scheme:light){:root{--background:var(--vscode-editor-background,#f7f9fc);--foreground:var(--vscode-editor-foreground,#172033);--card:var(--vscode-sideBar-background,#fff);--card-foreground:var(--vscode-sideBar-foreground,#172033);--popover:var(--vscode-menu-background,#fff);--popover-foreground:var(--vscode-menu-foreground,#172033);--primary:var(--vscode-button-background,#0969da);--primary-foreground:var(--vscode-button-foreground,#fff);--secondary:var(--vscode-button-secondaryBackground,#e8edf4);--secondary-foreground:var(--vscode-button-secondaryForeground,#172033);--muted:var(--vscode-list-inactiveSelectionBackground,#edf1f6);--muted-foreground:var(--vscode-descriptionForeground,#576579);--accent:var(--vscode-list-activeSelectionBackground,#dbeafe);--accent-foreground:var(--vscode-list-activeSelectionForeground,#172033);--border:var(--vscode-panel-border,#c8d1dc);--input:var(--vscode-input-border,#aeb9c8);--ring:var(--vscode-focusBorder,#0969da);--compass-canvas:var(--vscode-editor-background,#f4f7fb);--compass-canvas-deep:var(--compass-canvas)}@supports (color:color-mix(in lab,red,red)){:root{--compass-canvas-deep:color-mix(in srgb, var(--compass-canvas) 94%, #dbe3ed)}}:root{--compass-panel:var(--vscode-sideBar-background,#fff);--compass-panel-raised:var(--vscode-menu-background,#fff);--compass-line:var(--vscode-panel-border,#ccd6e1);--compass-line-strong:var(--vscode-contrastBorder,#9eacbd);--compass-faint:var(--vscode-disabledForeground,#68778a)}}body.vscode-light,body.vscode-high-contrast-light{color-scheme:light}body.vscode-dark,body.vscode-high-contrast{color-scheme:dark}.compass-source-notice{z-index:100;border:1px solid var(--compass-warning);max-width:min(420px,100vw - 32px);padding:12px 14px;position:fixed;bottom:16px;right:16px}@supports (color:color-mix(in lab,red,red)){.compass-source-notice{border:1px solid color-mix(in srgb,var(--compass-warning) 55%,var(--compass-line))}}.compass-source-notice{background:var(--compass-panel);border-radius:6px}@supports (color:color-mix(in lab,red,red)){.compass-source-notice{background:color-mix(in srgb,var(--compass-panel) 96%,transparent)}}.compass-source-notice{color:var(--foreground);font-size:13px;line-height:1.45;box-shadow:0 12px 32px #00000047}.visualization-workbench{background:var(--background);grid-template-columns:minmax(220px,268px) minmax(0,1fr);width:100vw;height:100vh;display:grid;overflow:hidden}.visualization-workbench[data-navigation-collapsed=true]{grid-template-columns:48px minmax(0,1fr)}.visualization-rail{border-right:1px solid var(--compass-line);background:linear-gradient(180deg,var(--compass-focus-soft),transparent 180px),var(--compass-panel);grid-template-rows:auto minmax(0,1fr) auto;min-width:0;display:grid}.visualization-rail>header{border-bottom:1px solid var(--compass-line);grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:11px;padding:18px 16px 16px;display:grid}.visualization-rail-disclosure{width:30px;height:30px;color:var(--muted-foreground);background:0 0;border:1px solid #0000;border-radius:3px;place-items:center;display:grid}.visualization-rail-disclosure:hover{border-color:var(--compass-line);background:var(--workbench-hover);color:var(--foreground)}.visualization-rail-disclosure svg{width:16px;height:16px}.visualization-rail[data-collapsed=true]>header{flex-direction:column;gap:9px;padding:12px 7px 10px;display:flex}.visualization-rail[data-collapsed=true]>header>span:nth-child(2),.visualization-rail[data-collapsed=true] nav button>span,.visualization-rail[data-collapsed=true] nav i,.visualization-rail[data-collapsed=true]>footer{display:none}.visualization-rail[data-collapsed=true] .visualization-bearing{width:30px;height:30px}.visualization-rail[data-collapsed=true] nav button{grid-template-columns:1fr;place-items:center;padding-inline:5px}.visualization-bearing{border:1px solid var(--compass-focus);place-items:center;width:34px;height:34px;display:grid}@supports (color:color-mix(in lab,red,red)){.visualization-bearing{border:1px solid color-mix(in srgb,var(--compass-focus) 48%,var(--border))}}.visualization-bearing{background:var(--compass-focus);border-radius:50%}@supports (color:color-mix(in lab,red,red)){.visualization-bearing{background:color-mix(in srgb,var(--compass-focus) 12%,transparent)}}.visualization-bearing{color:var(--compass-focus);box-shadow:inset 0 0 0 4px var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.visualization-bearing{box-shadow:inset 0 0 0 4px color-mix(in srgb,var(--compass-focus) 5%,transparent)}}.visualization-bearing svg{width:18px;height:18px}.visualization-rail header>span:nth-child(2),.visualization-rail nav button>span{gap:2px;min-width:0;display:grid}.visualization-rail header strong{letter-spacing:.02em;font-size:14px}.visualization-rail header small,.visualization-rail nav small{color:var(--muted-foreground);text-overflow:ellipsis;white-space:nowrap;font-size:10px;overflow:hidden}.visualization-rail nav{flex-direction:column;gap:3px;min-height:0;padding:10px 8px;display:flex;overflow:auto}.visualization-rail nav button{min-width:0;color:var(--foreground);text-align:left;background:0 0;border:1px solid #0000;border-radius:5px;grid-template-columns:24px minmax(0,1fr) 8px;align-items:center;gap:9px;padding:9px 8px;display:grid;position:relative}.visualization-rail nav button:hover{background:var(--workbench-hover)}.visualization-rail nav button[aria-current=page]{border-color:var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.visualization-rail nav button[aria-current=page]{border-color:color-mix(in srgb,var(--compass-focus) 28%,var(--border))}}.visualization-rail nav button[aria-current=page]{background:var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.visualization-rail nav button[aria-current=page]{background:color-mix(in srgb,var(--compass-focus) 13%,var(--compass-panel))}}.visualization-rail nav button[aria-current=page]{box-shadow:inset 2px 0 var(--compass-focus)}.visualization-rail nav svg{width:16px;height:16px;color:var(--muted-foreground)}.visualization-rail nav button[aria-current=page] svg{color:var(--compass-focus)}.visualization-rail nav strong{text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:600;overflow:hidden}.visualization-rail nav i{background:var(--compass-success);border-radius:50%;width:6px;height:6px}.visualization-rail nav i[data-status=summary]{background:var(--compass-warning)}.visualization-rail nav i[data-status=partial]{background:var(--destructive)}.visualization-rail>footer{border-top:1px solid var(--compass-line);color:var(--muted-foreground);justify-content:space-between;align-items:center;gap:10px;padding:11px 14px;font-size:10px;display:flex}.visualization-rail>footer code{color:var(--foreground);font-family:var(--compass-font-mono)}.visualization-main{grid-template-rows:49px minmax(0,1fr);min-width:0;min-height:0;display:grid}.visualization-context{border-bottom:1px solid var(--compass-line);background:var(--background);justify-content:space-between;align-items:center;gap:20px;min-width:0;padding:7px 14px 7px 16px;display:flex}@supports (color:color-mix(in lab,red,red)){.visualization-context{background:color-mix(in srgb,var(--background) 92%,var(--compass-panel))}}.visualization-context>div:first-child{gap:1px;min-width:0;display:grid}.visualization-context>div:first-child span{color:var(--muted-foreground);letter-spacing:.1em;text-transform:uppercase;font-size:9px;font-weight:650}.visualization-context>div:first-child strong{text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.visualization-coverage{color:var(--muted-foreground);align-items:center;gap:10px;font-size:10px;display:flex}.visualization-coverage strong{border:1px solid var(--compass-success);padding:3px 7px}@supports (color:color-mix(in lab,red,red)){.visualization-coverage strong{border:1px solid color-mix(in srgb,var(--compass-success) 36%,var(--border))}}.visualization-coverage strong{color:var(--compass-success);border-radius:999px;font-weight:600}.visualization-coverage[data-status=summary] strong{border-color:var(--compass-warning)}@supports (color:color-mix(in lab,red,red)){.visualization-coverage[data-status=summary] strong{border-color:color-mix(in srgb,var(--compass-warning) 42%,var(--border))}}.visualization-coverage[data-status=summary] strong{color:var(--compass-warning)}.visualization-coverage[data-status=partial] strong{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.visualization-coverage[data-status=partial] strong{border-color:color-mix(in srgb,var(--destructive) 42%,var(--border))}}.visualization-coverage[data-status=partial] strong{color:var(--destructive)}.visualization-stage,.workbench-graph-lens,.workbench-history-view,.workbench-architecture{min-width:0;height:100%;min-height:0}.workbench-architecture{grid-template-rows:39px minmax(0,1fr);display:grid}.workbench-graph-lens{position:relative}.workbench-graph-lens>.compass-workspace,.workbench-history-view .compass-workspace{height:100%;min-height:0}.visualization-stage .call-graph-view{height:100%}.visualization-stage .call-graph-direction{top:58px}.visualization-stage .call-graph-summary{max-height:min(42%,360px);overflow:auto}.workbench-filter-strip{border-bottom:1px solid var(--compass-line);background:var(--compass-panel);align-items:center;gap:7px;min-width:0;padding:5px 9px;display:flex;overflow-x:auto}.workbench-filter-strip label{color:var(--muted-foreground);white-space:nowrap;align-items:center;gap:5px;font-size:9px;display:flex}.workbench-filter-strip select{border:1px solid var(--input);background:var(--background);max-width:160px;height:27px;color:var(--foreground);font:inherit;border-radius:3px;padding:2px 22px 2px 7px;font-size:10px}.workbench-filter-strip>span{color:var(--muted-foreground);white-space:nowrap;margin-left:auto;font-size:9px}.compass-toolbar-leading{flex:none;align-items:center;min-width:0;display:flex}.workbench-filter-trigger{border:1px solid var(--compass-line);background:var(--vscode-dropdown-background,transparent);min-height:30px;color:var(--muted-foreground);cursor:pointer;font:inherit;white-space:nowrap;border-radius:3px;align-items:center;gap:6px;padding:0 8px;display:flex}.workbench-filter-trigger:hover,.workbench-filter-trigger[aria-expanded=true]{background:var(--workbench-hover);color:var(--foreground)}.workbench-filter-trigger:focus-visible{outline:2px solid var(--compass-focus);outline-offset:2px}.workbench-filter-trigger svg{width:15px;height:15px}.workbench-filter-trigger b{background:var(--compass-focus);min-width:17px;height:17px;color:var(--vscode-button-foreground,#fff);font:9px/1 var(--compass-font-mono);border-radius:9px;place-items:center;display:inline-grid}.workbench-filter-trigger small{color:var(--compass-faint);font:9px/1 var(--compass-font-mono)}.workbench-filter-popover{z-index:12;box-sizing:border-box;border:1px solid var(--compass-line-strong);background:var(--vscode-editorWidget-background,var(--compass-panel));width:min(310px,100%);max-height:calc(100vh - 84px);box-shadow:none;border-radius:5px;gap:10px;padding:12px;display:grid;position:absolute;top:calc(100% + 8px);right:6px;overflow-y:auto}.workbench-filter-popover>header{border-bottom:1px solid var(--compass-line);justify-content:space-between;align-items:flex-start;gap:12px;padding-bottom:9px;display:flex}.workbench-filter-popover>header span{gap:2px;display:grid}.workbench-filter-popover>header strong{font-size:11px}.workbench-filter-popover>header small,.workbench-filter-popover>footer{color:var(--compass-faint);font-size:10px}.workbench-filter-popover>header button{border:1px solid var(--compass-line);min-height:26px;color:var(--muted-foreground);white-space:nowrap;background:0 0;border-radius:3px;padding:0 7px;font-size:10px}.workbench-filter-popover>header button:disabled{opacity:.45}.workbench-filter-popover>label{color:var(--muted-foreground);grid-template-columns:88px minmax(0,1fr);align-items:center;gap:9px;font-size:10px;display:grid}.workbench-filter-popover select{border:1px solid var(--input);background:var(--vscode-dropdown-background,var(--background));width:100%;min-height:30px;color:var(--vscode-dropdown-foreground,var(--foreground));font:inherit;border-radius:3px;padding:2px 24px 2px 8px}.workbench-filter-popover select:focus-visible,.workbench-filter-popover button:focus-visible{outline:2px solid var(--compass-focus);outline-offset:2px}.workbench-filter-popover>footer{border-top:1px solid var(--compass-line);padding-top:8px}.workbench-graph-empty{z-index:3;box-sizing:border-box;border:1px solid var(--compass-line);background:var(--vscode-editorWidget-background,var(--compass-panel));width:min(360px,100% - 32px);color:var(--muted-foreground);text-align:center;border-radius:5px;justify-items:center;gap:7px;padding:18px;display:grid;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.workbench-graph-empty svg{width:24px;height:24px;color:var(--compass-faint);margin-bottom:3px}.workbench-graph-empty strong{color:var(--foreground);font-size:12px}.workbench-graph-empty span{max-width:290px;font-size:11px;line-height:1.45}.workbench-graph-empty button{border:1px solid var(--compass-line-strong);background:var(--vscode-button-background,var(--compass-focus));min-height:30px;color:var(--vscode-button-foreground,#fff);font:inherit;border-radius:3px;margin-top:5px;padding:0 10px;font-size:10px}.workbench-graph-empty button:hover{background:var(--vscode-button-hoverBackground,var(--compass-focus))}.workbench-graph-empty button:focus-visible{outline:2px solid var(--compass-focus);outline-offset:2px}.workbench-history-view{position:relative}.workbench-history-banner{z-index:24;border:1px solid var(--compass-line-strong);background:var(--compass-panel-raised);border-radius:5px;align-items:center;gap:9px;padding:8px 11px;display:flex;position:absolute;top:10px;left:50%;transform:translate(-50%);box-shadow:0 10px 28px #0000002e}.workbench-history-banner svg{width:17px;color:var(--compass-focus)}.workbench-history-banner span{gap:1px;display:grid}.workbench-history-banner strong{font-size:11px}.workbench-history-banner small{color:var(--muted-foreground);font-size:9px}.workbench-architecture-body{grid-template-columns:minmax(0,1fr) minmax(240px,310px);min-width:0;min-height:0;display:grid}.workbench-architecture-body>.architecture-map-panel{border:0;border-radius:0;min-width:0;height:100%;min-height:0}.workbench-architecture-body>aside{border-left:1px solid var(--compass-line);background:var(--compass-panel);min-width:0;padding:16px;overflow:auto}.workbench-architecture-body>aside>span{color:var(--muted-foreground);letter-spacing:.09em;text-transform:uppercase;font-size:9px;font-weight:650}.workbench-architecture-body>aside h2{margin:5px 0;font-size:15px}.workbench-architecture-body>aside p{color:var(--muted-foreground);font-size:10px;line-height:1.5}.workbench-symbol-list{gap:2px;margin-top:12px;display:grid}.workbench-symbol-list button{min-width:0;color:var(--foreground);text-align:left;background:0 0;border:1px solid #0000;border-radius:3px;gap:2px;padding:7px;display:grid}.workbench-symbol-list button:hover:not(:disabled){border-color:var(--border);background:var(--workbench-hover)}.workbench-symbol-list button:disabled{cursor:default}.workbench-symbol-list strong,.workbench-symbol-list small{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.workbench-symbol-list strong{font-size:10px}.workbench-symbol-list small{color:var(--muted-foreground);font-size:9px}.visualization-workbench button:focus-visible,.visualization-workbench select:focus-visible{outline:1px solid var(--compass-focus);outline-offset:1px}@media(max-width:760px){.visualization-workbench{grid-template-columns:58px minmax(0,1fr)}.visualization-rail>header{flex-direction:column;justify-content:center;gap:9px;padding-inline:8px;display:flex}.visualization-rail header>span:nth-child(2),.visualization-rail nav button>span,.visualization-rail nav i,.visualization-rail>footer{display:none}.visualization-rail nav button{grid-template-columns:1fr;place-items:center;display:grid}.visualization-coverage>span{display:none}.workbench-architecture-body{grid-template-columns:minmax(0,1fr)}.workbench-architecture-body>aside{display:none}}@media(prefers-reduced-motion:no-preference){.visualization-rail nav button[aria-current=page]{animation:.18s ease-out compass-bearing}}@keyframes compass-bearing{0%{opacity:.7;transform:translate(-3px)}to{opacity:1;transform:translate(0)}}*{border-color:var(--border)}html,body,#root,#compass-viewer-root{min-height:100%;margin:0}body{background:var(--background);color:var(--foreground);font-family:var(--compass-font-sans);overflow:hidden}button:not(:disabled),[role=button]:not(:disabled){cursor:pointer}[data-slot=button],[data-slot=input],[data-slot=tabs-list],[data-slot=tabs-trigger]{border-radius:4px}.workbench-collection-toolbar{justify-content:space-between;align-items:center;gap:10px;min-width:0;display:flex}.workbench-search{flex:1;align-items:center;min-width:180px;max-width:540px;display:flex;position:relative}.workbench-search>svg{width:14px;height:14px;color:var(--vscode-input-placeholderForeground,var(--muted-foreground));pointer-events:none;position:absolute;left:8px}.workbench-search input{border:1px solid var(--vscode-input-border,var(--border));background:var(--vscode-input-background,var(--input));width:100%;height:30px;color:var(--vscode-input-foreground,var(--foreground));font:inherit;border-radius:3px;outline:none;padding:4px 30px 4px 29px;font-size:12px}.workbench-search input::placeholder{color:var(--vscode-input-placeholderForeground,var(--muted-foreground))}.workbench-search input:focus-visible{border-color:var(--ring);outline:1px solid var(--ring);outline-offset:-1px}.workbench-search-clear{width:24px;height:24px;color:var(--muted-foreground);background:0 0;border:0;border-radius:3px;place-items:center;display:grid;position:absolute;right:3px}.workbench-search-clear:hover{background:var(--workbench-hover);color:var(--workbench-hover-foreground)}.workbench-search-clear svg{width:13px;height:13px}.workbench-result-count,.workbench-pagination-range{color:var(--muted-foreground);white-space:nowrap;font-size:11px}.workbench-pagination{justify-content:space-between;align-items:center;gap:12px;min-height:36px;padding-top:8px;display:flex}.workbench-pagination-actions{color:var(--muted-foreground);align-items:center;gap:4px;font-size:11px;display:flex}.workbench-pagination-actions button{width:26px;height:26px;color:var(--foreground);background:0 0;border:1px solid #0000;border-radius:3px;place-items:center;display:grid}.workbench-pagination-actions button:hover:not(:disabled){border-color:var(--border);background:var(--workbench-hover)}.workbench-pagination-actions button:disabled{color:var(--vscode-disabledForeground,var(--compass-faint))}.workbench-pagination-actions svg{width:14px;height:14px}.workbench-state{width:min(520px,100% - 32px);min-height:180px;color:var(--muted-foreground);text-align:center;align-content:center;place-items:center;gap:12px;margin:auto;padding:24px;display:grid}.workbench-state>svg{width:28px;height:28px}.workbench-state[data-kind=error]>svg{color:var(--destructive)}.workbench-state h2{color:var(--foreground);margin:0;font-size:14px;font-weight:600}.workbench-state p{margin:5px 0 0;font-size:12px;line-height:1.55}.workbench-button{border:1px solid var(--vscode-button-border,transparent);background:var(--vscode-button-background,var(--primary));min-height:30px;color:var(--vscode-button-foreground,var(--primary-foreground));font:inherit;border-radius:3px;padding:4px 11px;font-size:12px}.workbench-button:hover{background:var(--vscode-button-hoverBackground,var(--primary))}.workbench-button:focus-visible,.workbench-search-clear:focus-visible,.workbench-pagination-actions button:focus-visible{outline:2px solid var(--ring);outline-offset:1px}.workbench-state-spinner{animation:1s linear infinite spin}.compass-load-shell{background:radial-gradient(circle at 50% 43%,var(--compass-focus),transparent 28%),radial-gradient(circle at 68% 62%,var(--compass-success),transparent 24%),linear-gradient(145deg,var(--compass-canvas) 0%,var(--compass-canvas-deep) 100%);place-content:center;min-height:100vh;padding:40px 24px;display:grid;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.compass-load-shell{background:radial-gradient(circle at 50% 43%,color-mix(in srgb,var(--compass-focus) 16%,transparent),transparent 28%),radial-gradient(circle at 68% 62%,color-mix(in srgb,var(--compass-success) 8%,transparent),transparent 24%),linear-gradient(145deg,var(--compass-canvas) 0%,var(--compass-canvas-deep) 100%)}}.compass-load-shell{text-align:center}.compass-load-shell:before{content:"";opacity:.18;background-image:radial-gradient(var(--compass-grid) .65px,transparent .65px);pointer-events:none;background-size:24px 24px;position:absolute;inset:0}.compass-load-visual{place-items:start center;width:92px;height:88px;margin:0 auto;display:grid;position:relative}.compass-load-mark{width:58px;height:58px;color:var(--compass-focus);place-items:center;display:grid;position:relative}.compass-load-logo{filter:drop-shadow(0 10px 22px);width:54px;height:54px}@supports (color:color-mix(in lab,red,red)){.compass-load-logo{filter:drop-shadow(0 10px 22px color-mix(in srgb,currentColor 24%,transparent))}}.compass-load-logo{transform-origin:50%;animation:2.4s ease-in-out infinite compass-load-logo-breathe}.compass-load-visual[data-state=error] .compass-load-mark{border:1px solid var(--destructive);width:48px;height:48px}@supports (color:color-mix(in lab,red,red)){.compass-load-visual[data-state=error] .compass-load-mark{border:1px solid color-mix(in srgb,var(--destructive) 66%,var(--compass-line))}}.compass-load-visual[data-state=error] .compass-load-mark{color:var(--destructive);box-shadow:0 18px 48px var(--destructive);border-radius:12px}@supports (color:color-mix(in lab,red,red)){.compass-load-visual[data-state=error] .compass-load-mark{box-shadow:0 18px 48px color-mix(in srgb,var(--destructive) 20%,transparent)}}.compass-load-visual[data-state=error] .compass-load-mark svg{width:22px;height:22px}.compass-load-copy{z-index:1;width:min(620px,100vw - 48px);position:relative}.compass-load-eyebrow{color:var(--compass-focus);letter-spacing:.16em;text-transform:uppercase;margin-bottom:10px;font-size:11px;font-weight:700;display:block}.compass-load-copy h1{color:var(--foreground);letter-spacing:-.035em;margin:0;font-size:clamp(24px,4vw,38px);font-weight:650;line-height:1.08}.compass-load-steps,.compass-load-error{color:var(--muted-foreground);margin:16px auto 0;font-size:13px;line-height:1.65}.compass-load-steps{flex-wrap:wrap;justify-content:center;gap:6px;display:flex}.compass-load-steps b{color:var(--compass-focus);font-weight:700}.compass-load-error{overflow-wrap:anywhere;max-width:560px}.compass-load-actions{flex-wrap:wrap;justify-content:center;gap:10px;margin-top:22px;display:flex}.compass-load-action{border:1px solid var(--compass-line-strong);background:var(--compass-panel-raised);min-height:38px;color:var(--foreground);font:inherit;border-radius:9px;outline:none;align-items:center;gap:8px;padding:0 14px;font-size:12px;display:inline-flex}.compass-load-action:hover{border-color:var(--compass-focus);background:var(--compass-focus-soft)}.compass-load-action-primary{border-color:var(--vscode-button-background,var(--compass-focus));background:var(--vscode-button-background,var(--compass-focus));color:var(--vscode-button-foreground,#fff)}.compass-load-action-primary:hover{background:var(--vscode-button-hoverBackground,var(--compass-focus))}.compass-load-action svg{width:15px;height:15px}@keyframes compass-load-logo-breathe{50%{opacity:.72;transform:scale(.94)}}.compass-load-shell{background:var(--vscode-editor-background,var(--background));grid-template-rows:auto auto;gap:18px}.compass-load-shell:before{display:none}.compass-load-visual{width:92px;height:88px;margin:0 auto}.compass-load-mark{color:var(--vscode-symbolIcon-classForeground,var(--vscode-progressBar-background,var(--compass-focus)));box-shadow:none}.compass-load-logo{filter:drop-shadow(0 9px 20px var(--vscode-progressBar-background,var(--workbench-progress)))}@supports (color:color-mix(in lab,red,red)){.compass-load-logo{filter:drop-shadow(0 9px 20px color-mix(in srgb,var(--vscode-progressBar-background,var(--workbench-progress)) 28%,transparent))}}.compass-load-progress{background:var(--vscode-progressBar-background,var(--workbench-progress));width:96px;height:2px;position:absolute;bottom:0;left:50%;overflow:hidden;transform:translate(-50%)}@supports (color:color-mix(in lab,red,red)){.compass-load-progress{background:var(--vscode-progressBar-background,color-mix(in srgb, var(--workbench-progress) 28%, transparent))}}.compass-load-progress i{background:var(--workbench-progress);width:45%;height:100%;animation:1.4s ease-in-out infinite compass-native-progress;display:block}@keyframes compass-native-progress{0%{transform:translate(-110%)}to{transform:translate(330%)}}.compass-load-copy{width:min(520px,100vw - 40px)}.compass-load-eyebrow{color:var(--muted-foreground);letter-spacing:.08em;margin-bottom:7px;font-size:10px}.compass-load-copy h1{letter-spacing:-.015em;font-size:clamp(19px,3vw,25px);font-weight:600;line-height:1.2}.compass-load-steps,.compass-load-error{margin-top:10px;font-size:12px}.compass-load-steps{gap:8px 14px}.compass-load-step{color:var(--vscode-disabledForeground,var(--muted-foreground));align-items:center;gap:6px;display:inline-flex}.compass-load-step>i{border:1px solid;border-radius:50%;width:6px;height:6px;display:block}.compass-load-step[data-state=complete]{color:var(--vscode-descriptionForeground,var(--muted-foreground))}.compass-load-step[data-state=complete]>i{border-color:var(--vscode-progressBar-background,var(--workbench-progress));background:var(--vscode-progressBar-background,var(--workbench-progress))}.compass-load-step[data-state=active]{color:var(--vscode-editor-foreground,var(--foreground))}.compass-load-step[data-state=active]>i{border-color:var(--vscode-progressBar-background,var(--workbench-progress));background:var(--vscode-progressBar-background,var(--workbench-progress));box-shadow:0 0 7px var(--vscode-progressBar-background,var(--workbench-progress))}@supports (color:color-mix(in lab,red,red)){.compass-load-step[data-state=active]>i{box-shadow:0 0 7px color-mix(in srgb,var(--vscode-progressBar-background,var(--workbench-progress)) 46%,transparent)}}.compass-load-action{background:var(--vscode-button-secondaryBackground,var(--secondary));min-height:30px;color:var(--vscode-button-secondaryForeground,var(--secondary-foreground));border-radius:3px;padding:0 11px}.compass-load-action-primary{background:var(--vscode-button-background,var(--primary));color:var(--vscode-button-foreground,var(--primary-foreground))}.compass-load-shell[data-variant=architecture]{text-align:left;grid-template-rows:auto auto;grid-template-columns:minmax(220px,390px) minmax(280px,560px);column-gap:clamp(24px,6vw,72px)}.compass-load-shell[data-variant=architecture] .compass-load-visual{grid-column:1;margin:0}.compass-load-shell[data-variant=architecture] .compass-load-copy{grid-column:1;width:auto}.compass-load-shell[data-variant=architecture] .compass-load-steps{justify-content:flex-start}.architecture-load-skeleton{border:1px solid var(--vscode-panel-border,var(--border));background:var(--vscode-editor-background,var(--background));border-radius:4px;grid-area:1/2/span 2;grid-template-rows:54px 1fr;grid-template-columns:92px 1fr;width:min(46vw,560px);height:min(46vh,360px);display:grid;overflow:hidden}.architecture-load-skeleton span{background-image:linear-gradient(90deg,transparent,var(--foreground),transparent)}@supports (color:color-mix(in lab,red,red)){.architecture-load-skeleton span{background-image:linear-gradient(90deg,transparent,color-mix(in srgb,var(--foreground) 7%,transparent),transparent)}}.architecture-load-skeleton span{background-size:220% 100%;animation:1.8s ease-in-out infinite compass-skeleton}.architecture-load-rail{border-right:1px solid var(--border);background-color:var(--vscode-sideBar-background,var(--sidebar));grid-row:1/span 2}.architecture-load-flow{border-bottom:1px solid var(--border)}.architecture-load-content{border:1px solid var(--border);border-radius:3px;margin:14px}@keyframes compass-skeleton{to{background-position:-220% 0}}.compass-workspace{isolation:isolate;background:var(--compass-canvas);height:100vh;min-height:30rem;position:relative;overflow:hidden}.compass-workspace-content{grid-template-columns:minmax(0,1fr) 8px var(--compass-inspector-width,340px);width:100%;height:100%;min-height:inherit;display:grid;overflow:hidden}.compass-workspace-content[data-inspector-collapsed=true]{grid-template-columns:minmax(0,1fr) 48px}.compass-graph-transition{z-index:30;background:var(--vscode-editor-background,var(--background));color:var(--foreground);text-align:center;grid-template-rows:auto auto;place-content:center;gap:18px;padding:40px 24px;display:grid;position:absolute;inset:0;overflow:hidden}.compass-graph-transition .compass-load-copy{width:min(520px,100vw - 40px)}.compass-graph-transition-description{max-width:470px;color:var(--vscode-descriptionForeground,var(--muted-foreground));margin:10px auto 0;font-size:12px;line-height:1.6}.compass-graph-transition .compass-load-action:focus-visible{outline:2px solid var(--vscode-focusBorder,var(--ring));outline-offset:2px}.compass-graph-stage{background:radial-gradient(circle at 45% 42%,var(--compass-focus),transparent 34%),radial-gradient(circle at 76% 75%,var(--compass-success),transparent 28%),linear-gradient(145deg,var(--compass-canvas) 0%,var(--compass-canvas-deep) 100%);min-width:0;min-height:0;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.compass-graph-stage{background:radial-gradient(circle at 45% 42%,color-mix(in srgb,var(--compass-focus) 21%,transparent),transparent 34%),radial-gradient(circle at 76% 75%,color-mix(in srgb,var(--compass-success) 10%,transparent),transparent 28%),linear-gradient(145deg,var(--compass-canvas) 0%,var(--compass-canvas-deep) 100%)}}.compass-graph-stage:after{content:"";pointer-events:none;opacity:.16;background-image:radial-gradient(var(--compass-grid) .55px,transparent .55px);background-size:22px 22px;position:absolute;inset:0}.compass-graph-stage[data-comparison=true]{background:var(--vscode-editor-background,var(--compass-canvas))}.compass-graph-stage[data-comparison=true]:after{opacity:.09}.compass-canvas{z-index:1;min-width:0;min-height:0;position:absolute;inset:0}.compass-glass-panel{background:var(--vscode-editorWidget-background,var(--compass-panel));border:1px solid var(--compass-line);box-shadow:none;-webkit-backdrop-filter:none}.compass-graph-toolbar{z-index:4;border-radius:4px;justify-content:space-between;align-items:center;gap:10px;min-height:42px;padding:5px 6px 5px 10px;display:flex;position:absolute;top:12px;left:12px;right:12px}.compass-viewer-status{min-width:0;color:var(--muted-foreground);letter-spacing:.015em;align-items:center;gap:10px;font-size:12px;display:flex}.compass-viewer-status-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.compass-viewer-status-dot{background:var(--compass-focus);width:8px;height:8px;box-shadow:0 0 0 4px var(--compass-focus);border-radius:50%;flex:none}@supports (color:color-mix(in lab,red,red)){.compass-viewer-status-dot{box-shadow:0 0 0 4px color-mix(in srgb,var(--compass-focus) 12%,transparent)}}.compass-viewer-status[data-state=running] .compass-viewer-status-dot{animation:1.6s ease-in-out infinite compass-status-pulse}@keyframes compass-status-pulse{50%{box-shadow:0 0 0 8px color-mix(in srgb,var(--compass-focus) 0%,transparent)}}.compass-toolbar-actions{scrollbar-width:none;align-items:center;gap:6px;min-width:0;display:flex;overflow-x:auto}.compass-physics-button{border-color:var(--compass-line);background:var(--vscode-dropdown-background,transparent)}.compass-physics-button[aria-pressed=true]{border-color:var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.compass-physics-button[aria-pressed=true]{border-color:color-mix(in srgb,var(--compass-focus) 55%,var(--compass-line))}}.compass-physics-button[aria-pressed=true]{background:var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.compass-physics-button[aria-pressed=true]{background:color-mix(in srgb,var(--compass-focus) 13%,transparent)}}.compass-physics-button[aria-pressed=true]{color:var(--foreground)}.compass-toolbar-actions::-webkit-scrollbar{display:none}.compass-toolbar-separator{background:var(--compass-line);flex:none;width:1px;height:18px}.compass-zoom-controls{border:1px solid var(--compass-line);background:var(--vscode-dropdown-background,transparent);border-radius:3px;flex:none;min-height:30px;display:inline-flex;overflow:hidden}.compass-zoom-controls .compass-tool-button{border:0;border-radius:0;min-height:28px}.compass-zoom-controls .compass-tool-button+.compass-tool-button{border-left:1px solid var(--compass-line)}.compass-layout-picker{border:1px solid var(--compass-line);min-height:30px;color:var(--muted-foreground);background:var(--vscode-dropdown-background,transparent);border-radius:3px;align-items:center;gap:6px;padding-left:8px;display:inline-flex}.compass-layout-picker svg{flex:none;width:15px;height:15px}.compass-layout-picker select{min-height:28px;color:var(--vscode-dropdown-foreground,var(--foreground));font:inherit;background:0 0;border:0;outline:0;padding:0 24px 0 0}.compass-layout-picker:focus-within{outline:1px solid var(--vscode-focusBorder,var(--compass-focus));outline-offset:1px}.compass-tool-button:disabled{cursor:default;opacity:.55}.compass-tool-button{min-height:30px;color:var(--muted-foreground);white-space:nowrap;background:0 0;border:1px solid #0000;border-radius:3px;align-items:center;gap:7px;padding:0 8px;transition:none;display:inline-flex}.compass-tool-button svg{width:15px;height:15px}.compass-tool-icon-button{flex:0 0 30px;justify-content:center;width:30px;padding:0}.compass-zoom-reset{min-width:42px;color:var(--compass-faint);font:9px/1 var(--compass-font-mono);letter-spacing:.02em;justify-content:center;padding:0 7px}.compass-tool-button:hover,.compass-tool-button[aria-pressed=true]{border-color:var(--compass-line);background:var(--workbench-hover);color:var(--foreground)}.compass-tool-button:focus-visible,.compass-explore-panel button:focus-visible,.compass-explore-panel select:focus-visible,.compass-minimap button:focus-visible,.compass-change-legend button:focus-visible,.compass-search-field input:focus-visible,.compass-search-item:focus-visible,.compass-inspector-action:focus-visible,.compass-source-card:focus-visible,.compass-inspector-disclosure:focus-visible,.compass-inspector-resizer:focus-visible,.compass-load-action:focus-visible,.compass-neighbor-link:focus-visible,.compass-community-item:focus-within{outline:2px solid var(--compass-focus);outline-offset:2px}.compass-explore-panel{z-index:8;width:min(330px,100vw - 24px);max-height:calc(100vh - 84px);color:var(--foreground);border-radius:5px;gap:10px;padding:12px;display:grid;position:absolute;top:calc(100% + 7px);right:0;overflow-y:auto}.compass-explore-heading{border-bottom:1px solid var(--compass-line);justify-content:space-between;align-items:flex-start;gap:16px;padding-bottom:10px;display:flex}.compass-explore-heading>div{gap:3px;display:grid}.compass-explore-heading strong,.compass-explore-toggle strong,.compass-shortcut-title strong{letter-spacing:.02em;font-size:11px;font-weight:600}.compass-explore-heading span,.compass-explore-toggle small{color:var(--compass-faint);font-size:10px;line-height:1.35}.compass-selection-prompt{border:1px solid var(--compass-focus);grid-template-columns:18px minmax(0,1fr);align-items:start;gap:9px;padding:9px;display:grid}@supports (color:color-mix(in lab,red,red)){.compass-selection-prompt{border:1px solid color-mix(in srgb,var(--compass-focus) 28%,var(--compass-line))}}.compass-selection-prompt{background:var(--compass-focus);border-radius:4px}@supports (color:color-mix(in lab,red,red)){.compass-selection-prompt{background:color-mix(in srgb,var(--compass-focus) 7%,transparent)}}.compass-selection-prompt{color:var(--muted-foreground)}.compass-selection-prompt>svg{width:16px;height:16px;color:var(--compass-focus)}.compass-selection-prompt>span{gap:3px;display:grid}.compass-selection-prompt strong{color:var(--foreground);font-size:10px}.compass-selection-prompt small{color:var(--compass-faint);font-size:10px;line-height:1.4}.compass-explore-panel kbd{border:1px solid var(--compass-line);border-bottom-color:var(--compass-line);justify-content:center;align-items:center;min-width:20px;min-height:19px;padding:0 5px;display:inline-flex}@supports (color:color-mix(in lab,red,red)){.compass-explore-panel kbd{border-bottom-color:color-mix(in srgb,var(--compass-line) 72%,var(--foreground))}}.compass-explore-panel kbd{background:var(--vscode-keybindingLabel-background,var(--workbench-hover));color:var(--vscode-keybindingLabel-foreground,var(--foreground));font:9px/1 var(--compass-font-mono);border-radius:3px}.compass-explore-toggle{width:100%;color:var(--muted-foreground);text-align:left;background:0 0;border:1px solid #0000;border-radius:4px;grid-template-columns:18px minmax(0,1fr) 28px;align-items:center;gap:9px;padding:7px 8px;display:grid}.compass-explore-toggle:hover,.compass-explore-toggle[aria-pressed=true]{border-color:var(--compass-line);background:var(--workbench-hover);color:var(--foreground)}.compass-explore-toggle:disabled{cursor:default;opacity:.5}.compass-explore-toggle>svg{width:16px;height:16px}.compass-explore-toggle>span{gap:2px;min-width:0;display:grid}.compass-explore-toggle>i{border:1px solid var(--compass-line);background:var(--compass-canvas-deep);border-radius:8px;width:26px;height:14px;position:relative}.compass-explore-toggle>i:after{content:"";background:var(--compass-faint);border-radius:50%;width:8px;height:8px;position:absolute;top:2px;left:2px}.compass-explore-toggle[aria-pressed=true]>i{border-color:var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.compass-explore-toggle[aria-pressed=true]>i{border-color:color-mix(in srgb,var(--compass-focus) 65%,var(--compass-line))}}.compass-explore-toggle[aria-pressed=true]>i{background:var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.compass-explore-toggle[aria-pressed=true]>i{background:color-mix(in srgb,var(--compass-focus) 24%,var(--compass-canvas-deep))}}.compass-explore-toggle[aria-pressed=true]>i:after{background:var(--compass-focus);left:14px}.compass-explore-field{border:0;gap:6px;min-width:0;margin:0;padding:0;display:grid}.compass-explore-field:disabled{opacity:.5}.compass-explore-field legend,.compass-explore-select>span{color:var(--compass-faint);letter-spacing:.08em;text-transform:uppercase;margin-bottom:6px;font-size:9px;font-weight:600}.compass-segmented-control{border:1px solid var(--compass-line);border-radius:4px;grid-auto-columns:1fr;grid-auto-flow:column;display:grid;overflow:hidden}.compass-segmented-control button{min-height:28px;color:var(--compass-faint);font:10px/1 var(--compass-font-mono);background:0 0;border:0}.compass-segmented-control button+button{border-left:1px solid var(--compass-line)}.compass-segmented-control button:hover,.compass-segmented-control button[aria-pressed=true]{background:var(--workbench-hover);color:var(--foreground)}.compass-segmented-control button[aria-pressed=true]{box-shadow:inset 0 -2px var(--compass-focus)}.compass-explore-select{display:grid}.compass-explore-select select{border:1px solid var(--compass-line);background:var(--vscode-dropdown-background,var(--compass-canvas-deep));min-height:30px;color:var(--vscode-dropdown-foreground,var(--foreground));border-radius:4px;padding:0 28px 0 8px;font-size:10px}.compass-shortcut-guide{border-top:1px solid var(--compass-line);gap:9px;padding-top:10px;display:grid}.compass-shortcut-title{color:var(--muted-foreground);align-items:center;gap:7px;display:flex}.compass-shortcut-title svg{width:15px;height:15px}.compass-shortcut-guide dl{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 14px;margin:0;display:grid}.compass-shortcut-guide dl>div{grid-template-columns:52px minmax(0,1fr);align-items:center;gap:5px;display:grid}.compass-shortcut-guide dt,.compass-shortcut-guide dd{margin:0}.compass-shortcut-guide dt{gap:3px;display:flex}.compass-shortcut-guide dd{color:var(--compass-faint);font-size:9px}.compass-minimap{z-index:3;border-radius:4px;width:178px;position:absolute;bottom:12px;right:12px;overflow:hidden}.compass-minimap header{border-bottom:1px solid var(--compass-line);min-height:26px;color:var(--muted-foreground);font:9px/1 var(--compass-font-mono);letter-spacing:.08em;text-transform:uppercase;justify-content:space-between;align-items:center;padding:0 8px;display:flex}.compass-minimap header small{color:var(--compass-faint);font:inherit;letter-spacing:0;text-transform:none}.compass-minimap button{background:var(--compass-canvas);border:0;width:100%;height:108px;padding:0;display:block}@supports (color:color-mix(in lab,red,red)){.compass-minimap button{background:color-mix(in srgb,var(--compass-canvas) 90%,transparent)}}.compass-minimap button{color:var(--compass-faint)}.compass-minimap svg{width:100%;height:100%;display:block}.compass-minimap-edges line{stroke:var(--compass-line);stroke-width:.65px;vector-effect:non-scaling-stroke}.compass-minimap-nodes circle[data-focused=true]{stroke:var(--foreground);stroke-width:1.25px;vector-effect:non-scaling-stroke}.compass-minimap-viewport{fill:var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.compass-minimap-viewport{fill:color-mix(in srgb,var(--compass-focus) 8%,transparent)}}.compass-minimap-viewport{stroke:var(--compass-focus);stroke-width:1px;vector-effect:non-scaling-stroke}.compass-changed-symbols button:focus-visible,.compass-evidence-source-actions button:focus-visible,.compass-relationship-detail>button:focus-visible{outline:2px solid var(--compass-focus);outline-offset:2px}.compass-change-legend{z-index:4;border:1px solid var(--compass-line);background:var(--vscode-editorWidget-background,var(--compass-panel));border-radius:4px;flex-wrap:wrap;gap:5px;max-width:calc(100% - 24px);padding:5px;display:flex;position:absolute;top:64px;left:12px}.compass-change-legend button{min-height:27px;color:var(--muted-foreground);background:0 0;border:1px solid #0000;border-radius:3px;align-items:center;gap:6px;padding:3px 7px;font-size:10px;display:inline-flex}.compass-change-legend button:hover,.compass-change-legend button[aria-pressed=true]{border-color:var(--compass-line);background:var(--workbench-hover);color:var(--foreground)}.compass-change-legend button[aria-pressed=false]{opacity:.42}.compass-change-legend button>span{border:1px solid var(--vscode-descriptionForeground,#6e7781);background:var(--vscode-descriptionForeground,#6e7781);border-radius:50%;width:8px;height:8px}@supports (color:color-mix(in lab,red,red)){.compass-change-legend button>span{background:color-mix(in srgb,var(--vscode-descriptionForeground,#6e7781) 18%,var(--vscode-editor-background,var(--background)))}}.compass-change-legend button[data-change=added]>span{border-color:var(--vscode-gitDecoration-addedResourceForeground,#2ea043);background:var(--vscode-gitDecoration-addedResourceForeground,#2ea043)}@supports (color:color-mix(in lab,red,red)){.compass-change-legend button[data-change=added]>span{background:color-mix(in srgb,var(--vscode-gitDecoration-addedResourceForeground,#2ea043) 22%,var(--vscode-editor-background,var(--background)))}}.compass-change-legend button[data-change=removed]>span{border-color:var(--vscode-gitDecoration-deletedResourceForeground,#f85149);background:var(--vscode-gitDecoration-deletedResourceForeground,#f85149)}@supports (color:color-mix(in lab,red,red)){.compass-change-legend button[data-change=removed]>span{background:color-mix(in srgb,var(--vscode-gitDecoration-deletedResourceForeground,#f85149) 22%,var(--vscode-editor-background,var(--background)))}}.compass-change-legend button[data-change=changed]>span{border-color:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922);background:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922)}@supports (color:color-mix(in lab,red,red)){.compass-change-legend button[data-change=changed]>span{background:color-mix(in srgb,var(--vscode-gitDecoration-modifiedResourceForeground,#d29922) 22%,var(--vscode-editor-background,var(--background)))}}.compass-change-legend button small{color:var(--compass-faint);font:9px/1 var(--compass-font-mono)}.compass-semantic-legend{z-index:4;border:1px solid var(--compass-line);background:var(--vscode-editorWidget-background,var(--compass-panel));max-width:calc(100% - 24px);color:var(--muted-foreground);border-radius:4px;flex-wrap:wrap;gap:5px 12px;padding:7px 8px;font-size:10px;display:flex;position:absolute;top:64px;left:12px}.compass-semantic-legend section{flex-wrap:wrap;align-items:center;gap:5px 9px;min-height:20px;display:flex}.compass-semantic-legend section+section{border-left:1px solid var(--compass-line);padding-left:12px}.compass-semantic-legend strong{color:var(--compass-faint);font:9px/1 var(--compass-font-mono);letter-spacing:.08em;text-transform:uppercase}.compass-semantic-legend-item{white-space:nowrap;align-items:center;gap:5px;display:inline-flex}.compass-semantic-legend-item small{color:var(--compass-faint);font:9px/1 var(--compass-font-mono)}.compass-semantic-legend-item i[data-node-category]{border:1.5px solid var(--vscode-descriptionForeground,#8b949e);background:var(--vscode-descriptionForeground,#8b949e);width:9px;height:9px;display:inline-block}@supports (color:color-mix(in lab,red,red)){.compass-semantic-legend-item i[data-node-category]{background:color-mix(in srgb,var(--vscode-descriptionForeground,#8b949e) 22%,var(--vscode-editor-background,var(--background)))}}.compass-semantic-legend-item i[data-node-category=callable]{border-color:var(--vscode-symbolIcon-functionForeground,#5fa8ff);background:var(--vscode-symbolIcon-functionForeground,#5fa8ff);border-radius:50%}@supports (color:color-mix(in lab,red,red)){.compass-semantic-legend-item i[data-node-category=callable]{background:color-mix(in srgb,var(--vscode-symbolIcon-functionForeground,#5fa8ff) 22%,var(--vscode-editor-background,var(--background)))}}.compass-semantic-legend-item i[data-node-category=type]{border-color:var(--vscode-symbolIcon-classForeground,#e3b341);background:var(--vscode-symbolIcon-classForeground,#e3b341)}@supports (color:color-mix(in lab,red,red)){.compass-semantic-legend-item i[data-node-category=type]{background:color-mix(in srgb,var(--vscode-symbolIcon-classForeground,#e3b341) 22%,var(--vscode-editor-background,var(--background)))}}.compass-semantic-legend-item i[data-node-category=type]{transform:rotate(45deg)scale(.82)}.compass-semantic-legend-item i[data-node-category=module]{border-color:var(--vscode-symbolIcon-moduleForeground,#56d4b4);background:var(--vscode-symbolIcon-moduleForeground,#56d4b4);border-radius:1px}@supports (color:color-mix(in lab,red,red)){.compass-semantic-legend-item i[data-node-category=module]{background:color-mix(in srgb,var(--vscode-symbolIcon-moduleForeground,#56d4b4) 22%,var(--vscode-editor-background,var(--background)))}}.compass-semantic-legend-item i[data-node-category=boundary]{background:var(--vscode-symbolIcon-eventForeground,#ff9b87);clip-path:polygon(50% 0,100% 100%,0 100%);border:0;width:11px;height:10px}.compass-semantic-legend-item i[data-edge-category]{background:var(--vscode-descriptionForeground,#8b949e);width:16px;height:2px;display:inline-block;position:relative}.compass-semantic-legend-item i[data-edge-category]:after{content:"";border-top:3px solid #0000;border-bottom:3px solid #0000;border-left:4px solid;width:0;height:0;position:absolute;top:-2px;right:-1px}.compass-semantic-legend-item i[data-edge-category=execution]{background:var(--vscode-symbolIcon-functionForeground,#5fa8ff);color:var(--vscode-symbolIcon-functionForeground,#5fa8ff)}.compass-semantic-legend-item i[data-edge-category=dependency]{background:var(--vscode-symbolIcon-moduleForeground,#56d4b4);color:var(--vscode-symbolIcon-moduleForeground,#56d4b4)}.compass-semantic-legend-item i[data-edge-category=structure]{background:var(--vscode-symbolIcon-classForeground,#e3b341);color:var(--vscode-symbolIcon-classForeground,#e3b341)}.compass-semantic-legend-item i[data-edge-category=flow]{background:var(--vscode-symbolIcon-eventForeground,#ff9b87);color:var(--vscode-symbolIcon-eventForeground,#ff9b87)}.compass-inspector-resizer{z-index:6;background:var(--compass-panel);cursor:col-resize;touch-action:none;border:0;outline:none;min-width:8px;position:relative}.compass-inspector-resizer span{background:var(--compass-line-strong);border-radius:999px;width:2px;height:42px;transition:height .16s,background .16s;position:absolute;top:50%;left:3px;transform:translateY(-50%)}.compass-inspector-resizer:hover span,.compass-inspector-resizer:focus-visible span{background:var(--compass-focus);height:68px}.compass-graph-inspector{z-index:5;border-left:1px solid var(--compass-line);background:var(--vscode-sideBar-background,var(--compass-panel));min-width:0;box-shadow:none;flex-direction:column;display:flex;position:relative;overflow:hidden}.compass-graph-inspector-collapsed{border-left:1px solid var(--compass-line);box-shadow:none;align-items:center}.compass-inspector-header{border-bottom:1px solid var(--compass-line);align-items:center;gap:11px;min-height:52px;padding:8px 12px;display:flex}.compass-inspector-title{flex:1;min-width:0}.compass-inspector-header strong,.compass-inspector-header small{display:block}.compass-inspector-header strong{letter-spacing:.01em;font-size:14px}.compass-inspector-header small{color:var(--compass-faint);text-overflow:ellipsis;white-space:nowrap;margin-top:2px;font-size:11px;overflow:hidden}.compass-product-mark{background:linear-gradient(145deg,var(--vscode-button-foreground,#eff8ff),var(--compass-focus));border-radius:4px;flex:none;place-items:center;width:32px;height:32px;display:grid}@supports (color:color-mix(in lab,red,red)){.compass-product-mark{background:linear-gradient(145deg,var(--vscode-button-foreground,#eff8ff),color-mix(in srgb,var(--compass-focus) 64%,#fff))}}.compass-product-mark{color:var(--vscode-button-background,#09182c);box-shadow:inset 0 0 0 1px #ffffff7a}.compass-product-mark svg{width:19px;height:19px}.compass-inspector-disclosure{width:32px;height:32px;color:var(--muted-foreground);background:0 0;border:1px solid #0000;border-radius:3px;outline:none;flex:none;place-items:center;transition:none;display:grid}.compass-inspector-disclosure:hover{border-color:var(--compass-line);background:var(--workbench-hover);color:var(--foreground)}.compass-inspector-disclosure svg{width:17px;height:17px}.compass-inspector-expand{margin-top:18px}.compass-inspector-rail-label{color:var(--compass-faint);letter-spacing:.12em;text-transform:uppercase;writing-mode:vertical-rl;margin-top:16px;font-size:10px;font-weight:650}.compass-inspector-search{border-bottom:1px solid var(--compass-line);padding:10px 12px;position:relative}.compass-inspector-search-row{grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px;display:grid}.compass-inspector-search-row .compass-search-field:last-child{grid-column:1/-1}.compass-inspector-search-disclosure{border-color:var(--compass-line)}.compass-search-field{position:relative}.compass-search-field svg{width:15px;height:15px;color:var(--compass-faint);pointer-events:none;position:absolute;top:50%;left:13px;transform:translateY(-50%)}.compass-search-field input{border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--background));width:100%;min-height:30px;color:var(--vscode-input-foreground,var(--foreground));border-radius:3px;outline:none;padding:0 10px 0 34px}.compass-search-field input::placeholder{color:var(--vscode-input-placeholderForeground,var(--compass-faint))}.compass-search-results{z-index:8;border:1px solid var(--compass-line-strong);background:var(--vscode-menu-background,var(--compass-panel));max-height:230px;box-shadow:0 4px 12px var(--vscode-widget-shadow,#00000047);border-radius:3px;padding:6px;position:absolute;top:46px;left:12px;right:12px;overflow-y:auto}.compass-search-item{width:100%;min-height:42px;color:var(--muted-foreground);text-align:left;background:0 0;border:0;border-left:3px solid #0000;border-radius:2px;padding:7px 10px;display:block;overflow:hidden}.compass-search-item strong,.compass-search-item span{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.compass-search-item strong{color:var(--foreground);font-size:12px}.compass-search-item span{color:var(--compass-faint);font:10px/1.4 var(--compass-font-mono)}.compass-search-item:hover,.compass-search-item[aria-selected=true]{background:var(--vscode-list-activeSelectionBackground,var(--compass-focus-soft));color:var(--vscode-list-activeSelectionForeground,var(--foreground))}.compass-info-panel{border-bottom:1px solid var(--compass-line);max-height:48%;padding:18px 16px;overflow-y:auto}.compass-changed-symbols{border-bottom:1px solid var(--compass-line);max-height:30%;padding:14px 16px;overflow-y:auto}.compass-changed-symbol-list{gap:4px;display:grid}.compass-changed-symbol-list>button{width:100%;color:var(--foreground);text-align:left;background:0 0;border:1px solid #0000;border-radius:3px;grid-template-columns:auto minmax(0,1fr);gap:2px 8px;padding:7px 8px;display:grid}.compass-changed-symbol-list>button:hover,.compass-changed-symbol-list>button[aria-pressed=true]{border-color:var(--compass-line);background:var(--vscode-list-activeSelectionBackground,var(--compass-focus-soft))}.compass-changed-symbol-list strong,.compass-changed-symbol-list small{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.compass-changed-symbol-list small{color:var(--compass-faint);font:9px/1.35 var(--compass-font-mono);grid-column:2}.compass-changed-symbol-status{color:var(--vscode-descriptionForeground);letter-spacing:.06em;text-transform:uppercase;grid-row:1/span 2;align-self:center;font-size:8px;font-weight:700}.compass-changed-symbol-list>button[data-change=added] .compass-changed-symbol-status{color:var(--vscode-gitDecoration-addedResourceForeground,#2ea043)}.compass-changed-symbol-list>button[data-change=removed] .compass-changed-symbol-status{color:var(--vscode-gitDecoration-deletedResourceForeground,#f85149)}.compass-changed-symbol-list>button[data-change=changed] .compass-changed-symbol-status{color:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922)}.compass-changed-symbol-expand{border:1px solid var(--compass-line);width:100%;color:var(--vscode-textLink-foreground,var(--compass-focus));background:0 0;border-radius:3px;margin-top:8px;padding:6px 8px}.compass-record-evidence,.compass-relationship-evidence,.compass-code-evidence{margin-top:16px}.compass-code-query-actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin-top:10px;display:grid}.compass-code-query-actions button{border:1px solid var(--compass-line);color:var(--vscode-textLink-foreground,var(--compass-focus));background:0 0;border-radius:3px;padding:5px 4px;font-size:9px}.compass-code-query-actions button:focus-visible{outline:2px solid var(--vscode-focusBorder,var(--compass-focus));outline-offset:1px}.compass-code-evidence-ledger{gap:6px;display:grid}.compass-code-evidence-entry{border:1px solid var(--compass-line);background:var(--vscode-editorWidget-background,var(--background));border-left-width:3px;border-radius:3px;grid-template-columns:24px minmax(0,1fr);gap:8px;padding:8px;display:grid}.compass-code-evidence-entry[data-status=exact],.compass-code-evidence-entry[data-status=config],.compass-code-evidence-entry[data-status=convention]{border-left-color:var(--vscode-testing-iconPassed,#2ea043)}.compass-code-evidence-entry[data-status=heuristic]{border-left-color:var(--vscode-charts-blue,#58a6ff)}.compass-code-evidence-entry[data-status=ambiguous],.compass-code-evidence-entry[data-status=unresolved]{border-left-color:var(--vscode-editorWarning-foreground,#d29922)}.compass-code-evidence-icon{background:var(--vscode-badge-background,var(--muted));width:24px;height:24px;color:var(--vscode-badge-foreground,var(--foreground));border-radius:50%;place-items:center;display:grid}.compass-code-evidence-icon svg{width:13px;height:13px}.compass-code-evidence-copy{min-width:0}.compass-code-evidence-status{justify-content:space-between;align-items:baseline;gap:8px;display:flex}.compass-code-evidence-status strong{color:var(--foreground);font-size:10px}.compass-code-evidence-status span{color:var(--compass-faint);text-transform:uppercase;font-size:8px}.compass-code-evidence-copy dl{gap:3px;margin:7px 0 0;display:grid}.compass-code-evidence-copy dl>div{grid-template-columns:62px minmax(0,1fr);gap:6px;display:grid}.compass-code-evidence-copy dt{color:var(--compass-faint);text-transform:uppercase;font-size:8px}.compass-code-evidence-copy dd{overflow-wrap:anywhere;min-width:0;color:var(--foreground);font:9px/1.35 var(--compass-font-mono);margin:0}.compass-code-evidence-source{max-width:100%;color:var(--vscode-textLink-foreground,var(--compass-focus));font:9px/1.35 var(--compass-font-mono);overflow-wrap:anywhere;text-align:left;background:0 0;border:0;align-items:center;gap:5px;margin-top:7px;padding:0;display:inline-flex}button.compass-code-evidence-source{cursor:pointer}button.compass-code-evidence-source:focus-visible{outline:2px solid var(--vscode-focusBorder,var(--compass-focus));outline-offset:2px;border-radius:2px}.compass-code-evidence-source svg{width:11px;min-width:11px;height:11px}.compass-code-candidates{border-top:1px solid var(--compass-line);margin-top:8px;padding-top:7px}.compass-code-candidates>span{color:var(--compass-faint);text-transform:uppercase;font-size:8px}.compass-code-candidates ul{gap:5px;margin:6px 0 0;padding:0;list-style:none;display:grid}.compass-code-candidates li{grid-template-columns:minmax(0,1fr) auto;gap:1px 6px;display:grid}.compass-code-candidates code{overflow-wrap:anywhere;color:var(--foreground);font:9px/1.35 var(--compass-font-mono)}.compass-code-candidates li>span{color:var(--muted-foreground);grid-column:1/-1;font-size:9px}.compass-code-candidates small{color:var(--compass-faint);text-transform:uppercase;grid-area:1/2;font-size:8px}.compass-code-diagnostic{border:1px solid var(--vscode-editorWarning-foreground,#d29922);color:var(--muted-foreground);border-radius:3px;gap:7px;margin:0 0 6px;padding:7px 8px;font-size:9px;display:flex}.compass-code-diagnostic[data-severity=info]{border-color:var(--vscode-charts-blue,#58a6ff)}.compass-code-diagnostic svg{width:12px;min-width:12px;height:12px}.compass-code-diagnostic strong{color:var(--foreground);text-transform:capitalize}.compass-evidence-heading{justify-content:space-between;align-items:baseline;margin-bottom:7px;display:flex}.compass-evidence-heading h3{color:var(--foreground);font-size:11px}.compass-evidence-heading span{color:var(--compass-faint);font-size:9px}.compass-field-table-wrap{border:1px solid var(--compass-line);border-radius:3px;overflow-x:auto}.compass-field-table{border-collapse:collapse;table-layout:fixed;width:100%;min-width:360px}.compass-field-table th,.compass-field-table td{border-right:1px solid var(--compass-line);border-bottom:1px solid var(--compass-line);vertical-align:top;text-align:left;padding:6px 7px}.compass-field-table tr:last-child>*{border-bottom:0}.compass-field-table tr>:last-child{border-right:0}.compass-field-table thead th{background:var(--vscode-editorWidget-background,var(--background));color:var(--compass-faint);text-transform:uppercase;font-size:9px}.compass-field-table tbody th{width:27%;color:var(--foreground);font:9px/1.4 var(--compass-font-mono);overflow-wrap:anywhere}.compass-field-table code{color:var(--foreground);font:9px/1.4 var(--compass-font-mono);white-space:pre-wrap;overflow-wrap:anywhere}.compass-value-truncated{color:var(--vscode-editorWarning-foreground,#d29922);margin-top:4px;font-size:8px;display:block}.compass-evidence-source-actions{gap:6px;margin-top:8px;display:flex}.compass-evidence-source-actions button{border:1px solid var(--compass-line);color:var(--vscode-textLink-foreground,var(--compass-focus));background:0 0;border-radius:3px;align-items:center;gap:5px;padding:5px 7px;display:inline-flex}.compass-evidence-source-actions svg{width:12px;height:12px}.compass-relationship-list{gap:5px;margin-top:7px;display:grid}.compass-relationship-list details{border:1px solid var(--compass-line);background:var(--vscode-editorWidget-background,var(--background));border-radius:3px;padding:6px 7px}.compass-relationship-list summary{cursor:pointer;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:4px 7px;display:grid}.compass-relationship-target{color:var(--vscode-textLink-foreground,var(--compass-focus));text-align:left;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.compass-relationship-list summary small{color:var(--foreground);font:9px/1.3 var(--compass-font-mono);grid-column:2}.compass-relationship-list summary i{color:var(--compass-faint);text-transform:uppercase;grid-area:2/3;font-size:8px;font-style:normal}.compass-relationship-detail{margin-top:7px}.compass-relationship-detail>p{color:var(--compass-faint);font:9px/1.4 var(--compass-font-mono);margin:7px 0 0}.compass-relationship-detail>button{border:1px solid var(--compass-line);color:var(--vscode-textLink-foreground,var(--compass-focus));background:0 0;border-radius:3px;margin-top:7px;padding:4px 7px}.compass-bounded-notice{z-index:4;border:1px solid var(--vscode-editorWarning-foreground,#d29922);background:var(--vscode-editorWidget-background,var(--compass-panel));max-width:min(420px,100% - 24px);color:var(--foreground);border-radius:3px;gap:2px;padding:8px 10px;font-size:10px;display:grid;position:absolute;bottom:12px;right:12px}.compass-bounded-notice span{color:var(--muted-foreground)}.compass-hover-hint{border-top:1px solid var(--compass-line);color:var(--vscode-textLink-foreground,var(--compass-focus));align-items:center;gap:7px;margin-top:2px;padding-top:9px;font-size:11px;display:flex!important}.compass-hover-hint svg{flex:none;width:14px;height:14px}.compass-hover-hint strong{color:var(--vscode-editorHoverWidget-foreground,var(--foreground));font-weight:650}.compass-section-heading,.compass-neighbors-heading{justify-content:space-between;align-items:baseline;display:flex}.compass-section-heading{margin-bottom:15px}.compass-section-heading h2,.compass-community-panel h2{letter-spacing:.1em;text-transform:uppercase;font-size:11px;font-weight:700}.compass-section-heading span{color:var(--compass-faint);letter-spacing:.1em;text-transform:uppercase;font-size:9px}.compass-info-content{color:var(--muted-foreground);font-size:12px;line-height:1.45}.compass-node-identity{align-items:center;gap:11px;margin-bottom:15px;display:flex}.compass-node-identity>span:nth-child(2){flex:1;min-width:0}.compass-node-identity strong,.compass-node-identity small{display:block}.compass-node-identity strong{color:var(--foreground);text-overflow:ellipsis;white-space:nowrap;font-size:14px;overflow:hidden}.compass-node-identity small{background:var(--compass-success);border-radius:999px;width:max-content;margin-top:3px;padding:3px 7px}@supports (color:color-mix(in lab,red,red)){.compass-node-identity small{background:color-mix(in srgb,var(--compass-success) 20%,transparent)}}.compass-node-identity small{color:var(--compass-success);letter-spacing:.07em;text-transform:uppercase;font-size:9px;font-weight:800}.compass-node-swatch{border-radius:5px;flex:none;width:10px;height:36px}.compass-change-badge{width:max-content;color:var(--vscode-descriptionForeground,#6e7781);letter-spacing:.05em;text-transform:uppercase;border:1px solid;border-radius:999px;align-items:center;gap:5px;padding:3px 7px;font-size:9px;font-weight:700;display:inline-flex}.compass-node-identity .compass-change-badge{flex:none;margin-left:auto}.compass-change-badge[data-change=added]{color:var(--vscode-gitDecoration-addedResourceForeground,#2ea043)}.compass-change-badge[data-change=removed]{color:var(--vscode-gitDecoration-deletedResourceForeground,#f85149)}.compass-change-badge[data-change=changed]{color:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922)}.compass-metadata-grid{grid-template-columns:1fr 1fr;gap:8px;margin-bottom:15px;display:grid}.compass-metadata-grid>div{border:1px solid var(--compass-line);background:var(--vscode-editorWidget-background,var(--background));border-radius:3px;min-width:0;padding:9px 10px}.compass-metadata-grid .compass-metadata-wide{grid-column:1/-1}.compass-metadata-grid dt{color:var(--compass-faint);letter-spacing:.08em;text-transform:uppercase;font-size:9px}.compass-metadata-grid dd{color:var(--foreground);text-overflow:ellipsis;white-space:nowrap;margin-top:4px;overflow:hidden}.compass-source-metadata[data-interactive=true]{padding:0;transition:border-color .16s,background .16s}.compass-source-metadata[data-interactive=true]:hover,.compass-source-metadata[data-interactive=true]:focus-within{border-color:var(--compass-focus);background:var(--compass-focus-soft)}.compass-source-metadata[data-interactive=true] dd{white-space:normal;margin:0;overflow:visible}.compass-source-card{width:100%;min-height:58px;color:var(--foreground);text-align:left;background:0 0;border:0;border-radius:2px;outline:none;justify-content:space-between;align-items:center;gap:10px;padding:9px 10px;display:flex}.compass-source-copy{min-width:0;display:block}.compass-source-eyebrow,.compass-source-path,.compass-source-range{display:block}.compass-source-eyebrow{color:var(--compass-faint);font-family:var(--compass-font-sans);letter-spacing:.08em;text-transform:uppercase;font-size:9px}.compass-source-path{font:11px/1.35 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;margin-top:4px;overflow:hidden}.compass-source-range{color:var(--muted-foreground);font:10px/1.25 var(--compass-font-sans);margin-top:3px}.compass-source-card>svg{width:15px;height:15px;color:var(--compass-focus);flex:none}.compass-source-card:hover>svg{color:var(--foreground)}.compass-signature-block{overflow-wrap:anywhere;border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--background));color:var(--foreground);font:11px/1.45 var(--compass-font-mono);border-radius:3px;margin-bottom:15px;padding:10px;display:block}.compass-inspector-action{border:1px solid var(--compass-line);background:var(--workbench-hover);width:100%;min-height:36px;color:var(--foreground);border-radius:3px;justify-content:space-between;align-items:center;gap:8px;margin-bottom:14px;padding:0 10px;display:flex}.compass-inspector-action span{min-width:0;color:var(--muted-foreground);font:10px/1.2 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.compass-neighbors-heading{margin:3px 0 7px}.compass-neighbors-heading strong{color:var(--compass-faint);font-size:10px}.compass-neighbors-list{max-height:154px;overflow-y:auto}.compass-neighbor-link{width:100%;min-height:36px;color:var(--muted-foreground);text-align:left;background:0 0;border:0;border-radius:3px;align-items:center;gap:9px;margin:3px 0;padding:8px 9px;display:flex;overflow:hidden}.compass-neighbor-link:hover{background:var(--workbench-hover);color:var(--foreground)}.compass-neighbor-dot{width:8px;height:8px;box-shadow:0 0 0 1px var(--foreground);border-radius:50%;flex:none}@supports (color:color-mix(in lab,red,red)){.compass-neighbor-dot{box-shadow:0 0 0 1px color-mix(in srgb,var(--foreground) 10%,transparent)}}.compass-neighbor-label{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.compass-empty{color:var(--compass-faint);padding:8px 0;font-size:12px;display:block}.compass-community-panel{flex:1;min-height:0;padding:16px;overflow-y:auto}.compass-community-panel h2{margin-bottom:10px}.compass-community-panel[data-secondary=true]{flex:0 auto;padding-top:12px}.compass-community-panel details>summary{cursor:pointer;min-height:30px;color:var(--muted-foreground);letter-spacing:.1em;text-transform:uppercase;justify-content:space-between;align-items:center;font-size:11px;font-weight:700;display:flex}.compass-community-panel details>summary span{color:var(--compass-faint);font:9px/1 var(--compass-font-mono)}.compass-community-controls{min-height:0}.compass-community-search{align-items:center;margin:2px 0 8px;display:flex;position:relative}.compass-community-search>svg{width:13px;height:13px;color:var(--compass-faint);pointer-events:none;position:absolute;left:8px}.compass-community-search input{border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--background));width:100%;height:30px;color:var(--foreground);font:11px/1.3 var(--compass-font-sans);border-radius:3px;padding:0 8px 0 28px}.compass-community-limit{color:var(--compass-faint);margin:8px 0 0;font-size:10px;line-height:1.45}.compass-community-control,.compass-community-item{min-height:34px;color:var(--muted-foreground);align-items:center;gap:8px;font-size:12px;display:flex}.compass-community-item{border-radius:3px}.compass-community-item:hover{background:var(--workbench-hover);color:var(--foreground)}.compass-community-item[data-hidden=true]{opacity:.36}.compass-community-item input,.compass-community-control input{width:15px;height:15px;accent-color:var(--compass-focus)}.compass-community-dot{border-radius:50%;flex:none;width:9px;height:9px}.compass-community-label{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.compass-community-item small{color:var(--compass-faint);font-size:10px}.compass-graph-stats{border-top:1px solid var(--compass-line);color:var(--compass-faint);letter-spacing:.025em;padding:11px 16px;font-size:10px}.compass-node-hover-card{z-index:7;top:clamp(86px,var(--compass-hover-y),calc(100% - 10rem));left:clamp(12px,var(--compass-hover-x),calc(100% - min(27rem,90%) - 12px));border:1px solid var(--compass-line-strong);background:var(--vscode-editorHoverWidget-background,var(--compass-panel));width:max-content;max-width:min(26rem,100% - 24px);color:var(--vscode-editorHoverWidget-foreground,var(--muted-foreground));box-shadow:0 4px 12px var(--vscode-widget-shadow,#00000047);pointer-events:none;border-radius:3px;gap:7px;padding:13px 15px;font-size:12px;line-height:1.35;display:grid;position:absolute;overflow:hidden}.compass-node-hover-card>.compass-change-badge{margin:0}.compass-hover-heading{align-items:center;gap:8px;display:flex}.compass-hover-heading strong{min-width:0;color:var(--foreground);text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.compass-hover-heading span{background:var(--compass-success);border-radius:999px;width:max-content;padding:3px 7px}@supports (color:color-mix(in lab,red,red)){.compass-hover-heading span{background:color-mix(in srgb,var(--compass-success) 20%,transparent)}}.compass-hover-heading span{color:var(--compass-success);letter-spacing:.07em;font-size:9px;font-weight:800}.compass-node-hover-card p,.compass-node-hover-card code{display:block}.compass-hover-source{color:var(--compass-focus)}.compass-node-hover-card code{max-width:395px;color:var(--foreground);font-family:var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.compass-edge-hover-card{z-index:8;top:clamp(86px,var(--compass-hover-y),calc(100% - 15rem));left:clamp(12px,var(--compass-hover-x),calc(100% - min(31rem,92%) - 12px));border:1px solid var(--compass-line-strong);background:var(--vscode-editorHoverWidget-background,var(--compass-panel));width:min(31rem,100% - 24px);color:var(--vscode-editorHoverWidget-foreground,var(--muted-foreground));box-shadow:0 8px 24px var(--vscode-widget-shadow,#00000057);pointer-events:none;border-radius:4px;gap:10px;padding:13px 15px;font-size:11px;line-height:1.35;animation:90ms ease-out both compass-edge-card-enter;display:grid;position:absolute;overflow:hidden}@keyframes compass-edge-card-enter{0%{opacity:0;transform:translateY(3px)}}.compass-edge-hover-heading,.compass-edge-relation-row{justify-content:space-between;align-items:center;gap:10px;display:flex}.compass-edge-hover-eyebrow{color:var(--compass-faint);letter-spacing:.09em;text-transform:uppercase;align-items:center;gap:6px;font-size:9px;font-weight:750;display:inline-flex}.compass-edge-hover-eyebrow svg{width:12px;height:12px;color:var(--compass-focus)}.compass-edge-confidence{border:1px solid;padding:3px 7px}@supports (color:color-mix(in lab,red,red)){.compass-edge-confidence{border:1px solid color-mix(in srgb,currentColor 28%,transparent)}}.compass-edge-confidence{background:currentColor;border-radius:999px}@supports (color:color-mix(in lab,red,red)){.compass-edge-confidence{background:color-mix(in srgb,currentColor 11%,transparent)}}.compass-edge-confidence{color:var(--compass-faint);letter-spacing:.055em;text-transform:uppercase;font-size:9px;font-weight:800}.compass-edge-confidence[data-confidence=extracted]{color:var(--compass-success)}.compass-edge-confidence[data-confidence=inferred]{color:var(--compass-focus)}.compass-edge-confidence[data-confidence=ambiguous]{color:var(--compass-warning)}.compass-edge-confidence[data-confidence=aggregated]{color:var(--compass-faint)}.compass-edge-trace{border:1px solid var(--compass-line);background:var(--compass-focus);border-radius:3px;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:9px;min-width:0;padding:9px 10px;display:grid}@supports (color:color-mix(in lab,red,red)){.compass-edge-trace{background:color-mix(in srgb,var(--compass-focus) 7%,transparent)}}.compass-edge-trace strong{min-width:0;color:var(--foreground);font:600 11px/1.35 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.compass-edge-trace strong:last-child{text-align:right}.compass-edge-trace>span{border:1px solid var(--compass-focus);place-items:center;width:22px;height:22px;display:grid}@supports (color:color-mix(in lab,red,red)){.compass-edge-trace>span{border:1px solid color-mix(in srgb,var(--compass-focus) 38%,transparent)}}.compass-edge-trace>span{background:var(--vscode-editorHoverWidget-background,var(--compass-panel));color:var(--compass-focus);border-radius:50%}.compass-edge-trace svg{width:12px;height:12px}.compass-edge-relation-row>strong{color:var(--foreground);font-size:12px;font-weight:700}.compass-edge-relation-row>.compass-change-badge{margin:0}.compass-edge-metadata{gap:5px;padding-top:1px;display:grid}.compass-edge-metadata p{grid-template-columns:54px minmax(0,1fr);align-items:baseline;gap:8px;display:grid}.compass-edge-metadata span{color:var(--compass-faint);letter-spacing:.06em;text-transform:uppercase;font-size:9px;font-weight:700}.compass-edge-metadata code{min-width:0;color:var(--vscode-textLink-foreground,var(--compass-focus));font:10px/1.4 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}body.vscode-high-contrast .compass-glass-panel,body.vscode-high-contrast .compass-graph-inspector,body.vscode-high-contrast .compass-inspector-resizer,body.vscode-high-contrast .compass-load-action,body.vscode-high-contrast .compass-load-step>i,body.vscode-high-contrast .compass-source-metadata,body.vscode-high-contrast .compass-node-hover-card,body.vscode-high-contrast .compass-edge-hover-card,body.vscode-high-contrast-light .compass-glass-panel,body.vscode-high-contrast-light .compass-graph-inspector,body.vscode-high-contrast-light .compass-inspector-resizer,body.vscode-high-contrast-light .compass-load-action,body.vscode-high-contrast-light .compass-load-step>i,body.vscode-high-contrast-light .compass-source-metadata,body.vscode-high-contrast-light .compass-node-hover-card,body.vscode-high-contrast-light .compass-edge-hover-card{border-width:2px;border-color:var(--vscode-contrastBorder,var(--compass-focus))}body.vscode-high-contrast .compass-load-logo,body.vscode-high-contrast-light .compass-load-logo{color:var(--vscode-contrastBorder,currentColor)}@media(max-width:980px){.compass-tool-button span{display:none}.compass-tool-button{padding:0 11px}}@media(max-width:760px){.compass-workspace{height:auto;min-height:100vh;overflow:auto}.compass-workspace-content,.compass-workspace-content[data-inspector-collapsed=true]{height:auto;min-height:inherit;grid-template-rows:minmax(360px,62vh) minmax(280px,40vh);grid-template-columns:1fr;overflow:visible}.compass-workspace-content[data-inspector-collapsed=true]{grid-template-rows:minmax(360px,calc(100vh - 48px)) 48px}.compass-inspector-resizer{display:none}.compass-graph-inspector{border-top:1px solid var(--compass-line);min-height:280px;box-shadow:none;border-left:0;border-radius:0}.compass-graph-inspector-collapsed{border-radius:0;flex-direction:row;justify-content:center;min-height:48px}.compass-inspector-expand{margin-top:0}.compass-inspector-rail-label{writing-mode:horizontal-tb;margin-top:0;margin-left:10px}.compass-graph-toolbar{top:12px;left:12px;right:12px}.compass-toolbar-actions{max-width:62%;overflow-x:auto}.compass-explore-panel{max-height:calc(62vh - 82px)}.compass-info-panel{max-height:none}}@media(prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}.compass-load-logo,.compass-load-progress i,.architecture-load-skeleton span,.workbench-state-spinner{animation:none!important}}.architecture-shell{background:var(--background);height:100vh;color:var(--foreground);grid-template-columns:minmax(220px,280px) minmax(0,1fr);display:grid}.query-shell{--query-surface:var(--vscode-editor-background,var(--background));--query-surface-raised:var(--vscode-editorWidget-background,var(--vscode-sideBar-background,var(--card)));--query-border:var(--vscode-panel-border,var(--border));--query-input:var(--vscode-input-background,var(--background));--query-input-foreground:var(--vscode-input-foreground,var(--foreground));--query-accent:var(--vscode-focusBorder,var(--ring));background:var(--background);height:100vh;min-height:420px;color:var(--foreground);grid-template-rows:auto 1fr;display:grid;overflow:hidden}.query-header{border-bottom:1px solid var(--query-border);background:var(--query-surface);padding:14px 18px 16px}.query-heading-row{justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.query-context{color:var(--muted-foreground);font:10px/1.35 var(--compass-font-mono);letter-spacing:.04em;text-transform:uppercase}.query-heading-row h1{margin:3px 0 0;font-size:16px;font-weight:600;line-height:1.3}.query-mode{border-bottom:1px solid var(--query-border);background:0 0;gap:0;width:100%;margin-top:14px;display:flex;overflow-x:auto}.query-mode button{min-width:min(250px,42vw);min-height:48px;color:var(--muted-foreground);font:inherit;text-align:left;background:0 0;border:0;border-radius:0;flex:1 0 220px;grid-template-columns:18px minmax(0,1fr);align-items:center;gap:8px;padding:7px 12px 8px;display:grid;position:relative}.query-mode-indicator{background:var(--query-accent);height:3px;box-shadow:0 1px 5px var(--query-accent);position:absolute;top:0;left:0;right:0}@supports (color:color-mix(in lab,red,red)){.query-mode-indicator{box-shadow:0 1px 5px color-mix(in srgb,var(--query-accent) 35%,transparent)}}.query-mode-indicator{opacity:0;pointer-events:none}.query-mode button:hover{background:var(--workbench-hover);color:var(--foreground)}.query-mode button[aria-selected=true]{background:var(--vscode-tab-activeBackground,var(--query-surface-raised));box-shadow:inset 1px 0 var(--query-border),inset -1px 0 var(--query-border);color:var(--vscode-tab-activeForeground,var(--foreground))}.query-mode button[aria-selected=true] .query-mode-indicator,.query-mode button[aria-selected=true] svg,.query-mode button[aria-selected=true] strong{opacity:1}.query-mode svg{width:15px;height:15px}.query-mode button>span,.query-mode strong,.query-mode small{min-width:0;display:block}.query-mode strong{font-size:12px;font-weight:600;line-height:1.3}.query-mode small{color:inherit;opacity:.78;text-overflow:ellipsis;white-space:nowrap;margin-top:2px;font-size:10px;font-weight:400;line-height:1.3;overflow:hidden}.query-composer-panel{border:1px solid var(--query-border);background:var(--query-surface-raised);border-top:0;padding:12px}.query-composer{display:block}.query-editor-shell{border:1px solid var(--vscode-input-border,var(--border));background:var(--query-input);color:var(--query-input-foreground);border-radius:3px;overflow:hidden}.query-editor-shell:focus-within{border-color:var(--ring);outline:1px solid var(--ring);outline-offset:-1px}.query-editor{min-width:0;position:relative}.query-editor textarea{resize:vertical;background:var(--query-input);width:100%;min-height:96px;max-height:260px;color:inherit;font:13px/1.55 var(--compass-font-sans);box-sizing:border-box;border:0;border-radius:0;outline:none;padding:11px 12px;display:block}.query-composer-panel[data-mode=cql] .query-editor textarea,.query-composer-panel[data-mode=explain] .query-editor textarea{font-family:var(--compass-font-mono);font-size:12px}.query-editor textarea::placeholder,.query-params input::placeholder{color:var(--vscode-input-placeholderForeground,var(--muted-foreground))}.query-suggestions{border-top:1px solid var(--query-border);background:var(--vscode-editorSuggestWidget-background,var(--query-surface-raised));max-height:210px;color:var(--vscode-editorSuggestWidget-foreground,var(--foreground));display:grid;overflow-y:auto}.query-suggestions-label,.query-suggestions-hint{color:var(--vscode-descriptionForeground,var(--muted-foreground));font:9px/1.2 var(--compass-font-sans);padding:6px 10px}.query-suggestions-label{letter-spacing:.06em;text-transform:uppercase}.query-suggestions-hint{border-top:1px solid var(--query-border);text-align:right}.query-suggestions button{min-width:0;color:inherit;font:inherit;text-align:left;background:0 0;border:0;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:16px;padding:7px 10px;display:grid}.query-suggestions button[aria-selected=true],.query-suggestions button:hover{background:var(--vscode-editorSuggestWidget-selectedBackground,var(--accent));color:var(--vscode-editorSuggestWidget-selectedForeground,var(--foreground))}.query-suggestions button>span{font:11px/1.35 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.query-suggestions button>small{color:var(--vscode-descriptionForeground,var(--muted-foreground));white-space:nowrap;font-size:10px}.query-completion-status{border-top:1px solid var(--query-border);background:var(--vscode-editorSuggestWidget-background,var(--query-surface-raised));min-width:0;min-height:34px;color:var(--vscode-descriptionForeground,var(--muted-foreground));justify-content:space-between;align-items:center;gap:12px;padding-block:7px;padding-inline:10px;font-size:10px;display:flex}.query-completion-status>span{overflow-wrap:anywhere;min-width:0}.query-completion-status button{border:1px solid var(--vscode-button-border,var(--query-border));background:var(--vscode-button-secondaryBackground,var(--secondary));color:var(--vscode-button-secondaryForeground,var(--secondary-foreground));font:inherit;border-radius:3px;flex:none;padding:3px 7px}.query-completion-status button:hover{background:var(--vscode-button-secondaryHoverBackground,var(--workbench-hover))}.query-params input:focus-visible{border-color:var(--ring);outline:1px solid var(--ring);outline-offset:-1px}.query-composer-footer{border-top:1px solid var(--query-border);background:var(--query-surface);align-items:center;gap:12px;min-height:40px;padding:5px 6px 5px 10px;display:flex}.query-footer-actions{flex:none;justify-content:flex-end;align-items:center;gap:8px;margin-left:auto;display:flex}.query-shortcut{color:var(--vscode-disabledForeground,var(--compass-faint));font:10px/1 var(--compass-font-sans);white-space:nowrap}.query-run{border:1px solid var(--vscode-button-border,transparent);background:var(--vscode-button-background,var(--primary));min-width:76px;min-height:30px;color:var(--vscode-button-foreground,var(--primary-foreground));font:inherit;border-radius:3px;justify-content:center;align-items:center;gap:6px;padding:5px 11px;font-size:12px;display:flex}.query-run:hover:not(:disabled){background:var(--vscode-button-hoverBackground,var(--primary))}.query-run:disabled{background:var(--vscode-button-secondaryBackground,var(--secondary));color:var(--vscode-disabledForeground,var(--compass-faint))}.query-run svg{width:13px;height:13px}.query-params{min-width:0;max-width:620px;color:var(--muted-foreground);flex:520px;align-items:center;gap:8px;font-size:10px;display:flex}.query-params>span{flex:none}.query-params input{border:1px solid var(--vscode-input-border,var(--border));background:var(--vscode-input-background,var(--input));min-width:0;max-width:520px;height:28px;color:var(--vscode-input-foreground,var(--foreground));font:11px var(--compass-font-mono);border-radius:3px;outline:none;flex:260px;padding:3px 8px}.query-examples{align-items:center;gap:5px;margin-top:9px;display:flex;overflow-x:auto}.query-examples>span{color:var(--muted-foreground);text-transform:uppercase;flex:none;font-size:10px;font-weight:600}.query-examples button,.query-history button{border:1px solid var(--border);color:var(--muted-foreground);font:inherit;white-space:nowrap;background:0 0;border-radius:3px;padding:4px 7px;font-size:10px}.query-examples button:hover,.query-history button:hover{background:var(--workbench-hover);color:var(--foreground)}.query-results{grid-template-rows:auto minmax(0,1fr);min-height:0;padding:0;display:grid;overflow:hidden}.query-result-stage{min-height:0;padding:clamp(12px,2vw,22px);overflow:auto}.query-result-stage>.workbench-state{min-height:100%}.query-result-tabs{border-bottom:1px solid var(--query-border);background:var(--vscode-editorGroupHeader-tabsBackground,var(--query-surface-raised));min-width:0;display:flex;overflow-x:auto}.query-result-tab{border-right:1px solid var(--query-border);background:var(--vscode-tab-inactiveBackground,transparent);grid-template-columns:minmax(0,1fr) 26px;min-width:150px;max-width:300px;display:grid}.query-result-tab:has([aria-selected=true]){background:var(--vscode-tab-activeBackground,var(--query-surface));box-shadow:inset 0 2px var(--vscode-tab-activeBorderTop,var(--query-accent))}.query-result-tab[data-status=error]{box-shadow:inset 0 2px var(--vscode-testing-iconFailed,var(--destructive))}.query-result-tab>[role=tab]{min-width:0;color:var(--vscode-tab-inactiveForeground,var(--muted-foreground));font:inherit;text-align:left;background:0 0;border:0;gap:1px;padding:7px 4px 7px 10px;display:grid;overflow:hidden}.query-result-tab>[role=tab][aria-selected=true]{color:var(--vscode-tab-activeForeground,var(--foreground))}.query-result-tab>[role=tab] span{color:var(--query-accent);font:9px/1.2 var(--compass-font-mono);letter-spacing:.05em;text-transform:uppercase}.query-result-tab>[role=tab] strong{text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:500;line-height:1.3;overflow:hidden}.query-result-close{width:22px;height:22px;color:var(--muted-foreground);background:0 0;border:0;border-radius:3px;align-self:center;place-items:center;padding:0;display:grid}.query-result-close:hover{background:var(--workbench-hover);color:var(--foreground)}.query-result-close svg{width:13px;height:13px}.query-result{width:min(1180px,100%);margin:0 auto}.query-result>header{justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:9px;display:flex}.query-result>header span{color:var(--muted-foreground);font-size:10px}.query-result>header>span{font-family:var(--compass-font-mono);align-items:center;gap:5px;display:flex}.query-result>header svg{width:12px;height:12px}.query-result h2{margin:2px 0 0;font-size:14px;font-weight:600}.query-text-result,.query-json-result{border:1px solid var(--border);background:var(--vscode-textCodeBlock-background,var(--card));min-height:120px;color:var(--foreground);font:12px/1.6 var(--compass-font-mono);white-space:pre-wrap;overflow-wrap:anywhere;border-radius:3px;margin:0;padding:12px;overflow:auto}.query-prose-result{border:1px solid var(--query-border);background:var(--query-surface-raised);color:var(--foreground);border-radius:3px;padding:14px 16px;font-size:13px;line-height:1.65}.query-prose-result p,.query-prose-result ul{margin:0}.query-prose-result p+p,.query-prose-result p+ul,.query-prose-result ul+p{margin-top:10px}.query-prose-result ul{padding-left:20px}.query-traversal-result,.query-typed-result,.query-explanation{gap:10px;display:grid}.query-diagnostics{border:1px solid var(--query-border);border-left:3px solid var(--vscode-editorWarning-foreground,#cca700);background:var(--query-surface-raised);display:grid;overflow:hidden}.query-diagnostics>h3{border-bottom:1px solid var(--query-border);margin:0;padding:8px 11px;font-size:11px;font-weight:600}.query-diagnostics article{border-bottom:1px solid var(--query-border);grid-template-columns:16px minmax(0,1fr);gap:8px;min-width:0;padding:9px 11px;display:grid}.query-diagnostics article:last-child{border-bottom:0}.query-diagnostics article>svg{width:14px;height:14px;color:var(--vscode-editorWarning-foreground,#cca700);margin-top:1px}.query-diagnostics strong,.query-diagnostics p{overflow-wrap:anywhere;margin:0}.query-diagnostics strong{font-size:11px}.query-diagnostics p{color:var(--muted-foreground);margin-top:2px;font-size:11px;line-height:1.45}.query-explanation-card{border:1px solid var(--query-border);border-left:3px solid var(--query-accent);background:var(--query-surface-raised);grid-template-columns:minmax(180px,1fr) minmax(220px,1fr);gap:12px 18px;min-width:0;padding:13px 14px;display:grid}.query-explanation-card>div>span{color:var(--query-accent);font:9px/1.2 var(--compass-font-mono);letter-spacing:.05em;text-transform:uppercase}.query-explanation-card h3{margin:3px 0 4px;font-size:14px}.query-explanation-card code{color:var(--muted-foreground);font:10px/1.4 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.query-explanation-card>.query-source-action{align-self:center}.query-explanation-card dl{border-top:1px solid var(--query-border);grid-column:1/-1;gap:18px;margin:0;padding-top:10px;display:flex}.query-explanation-card dl>div{gap:6px;display:flex}.query-explanation-card dt,.query-explanation-card dd{margin:0;font-size:10px}.query-explanation-card dt{color:var(--muted-foreground)}.query-connections{border:1px solid var(--query-border);background:var(--query-surface);overflow:hidden}.query-connections>h3{border-bottom:1px solid var(--query-border);margin:0;padding:8px 11px;font-size:11px}.query-connections>h3 span{color:var(--muted-foreground);margin-left:4px;font-weight:400}.query-connections article{border-bottom:1px solid var(--query-border);grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:8px;padding:8px 10px;display:grid}.query-connections article:last-child{border-bottom:0}.query-connections article>svg{width:14px;color:var(--query-accent)}.query-connections strong,.query-connections p{margin:0;font-size:11px}.query-connections p,.query-connections article>span{color:var(--muted-foreground);font-size:9px}.query-connections article>span{font-family:var(--compass-font-mono);text-transform:uppercase}.query-guidance{border:1px solid var(--query-border);background:var(--query-surface-raised);color:var(--muted-foreground);margin:0;padding:9px 11px;font-size:11px}.query-object-result{border:1px solid var(--query-border);background:var(--query-surface);margin:0;display:grid;overflow:hidden}.query-object-result>div{border-bottom:1px solid var(--query-border);grid-template-columns:minmax(120px,.28fr) minmax(0,1fr);display:grid}.query-object-result>div:last-child{border-bottom:0}.query-object-result dt,.query-object-result dd{overflow-wrap:anywhere;margin:0;padding:8px 10px}.query-object-result dt{color:var(--muted-foreground);text-transform:capitalize;font-size:10px}.query-object-result dd{border-left:1px solid var(--query-border);font:11px/1.5 var(--compass-font-mono);white-space:pre-wrap}.query-traversal-summary{border:1px solid var(--query-border);border-left:3px solid var(--query-accent);background:var(--query-surface-raised);justify-content:space-between;align-items:center;gap:16px;min-height:54px;padding:10px 12px;display:flex}.query-traversal-summary p{color:var(--foreground);margin:0;font-size:12px;font-weight:600}.query-result-metrics{color:var(--muted-foreground);flex-wrap:wrap;gap:5px 14px;margin-top:5px;font-size:10px;display:flex}.query-result-metrics strong{color:var(--foreground);font-weight:600}.query-graph-action{border:1px solid var(--vscode-button-border,transparent);background:var(--vscode-button-secondaryBackground,var(--secondary));min-height:30px;color:var(--vscode-button-secondaryForeground,var(--secondary-foreground));font:11px var(--compass-font-sans);border-radius:3px;flex:none;align-items:center;gap:6px;padding:5px 9px;display:inline-flex}.query-graph-action:hover{background:var(--vscode-button-secondaryHoverBackground,var(--workbench-hover))}.query-graph-action svg{width:14px;height:14px}.query-node-results{border:1px solid var(--query-border);background:var(--query-surface);border-radius:3px;overflow:hidden}.query-node-result{border-bottom:1px solid var(--query-border);grid-template-columns:18px minmax(160px,.72fr) minmax(240px,1.28fr);align-items:center;gap:9px;min-width:0;min-height:48px;padding:7px 10px;display:grid}.query-node-result:last-child{border-bottom:0}.query-node-result:hover{background:var(--workbench-hover)}.query-node-result>svg{width:14px;height:14px;color:var(--vscode-symbolIcon-functionForeground,var(--query-accent))}.query-node-copy,.query-node-copy h3,.query-node-copy p{min-width:0}.query-node-copy h3,.query-node-copy p{text-overflow:ellipsis;white-space:nowrap;margin:0;overflow:hidden}.query-node-copy h3{color:var(--vscode-editor-foreground,var(--foreground));font-size:12px;font-weight:600}.query-node-copy p{color:var(--muted-foreground);margin-top:2px;font-size:10px}.query-source-action{min-width:0;color:var(--workbench-link);font:10px/1.4 var(--compass-font-mono);text-align:left;background:0 0;border:1px solid #0000;border-radius:3px;justify-content:space-between;align-items:center;gap:8px;padding:5px 7px;display:flex;overflow:hidden}.query-source-action:hover{border-color:var(--query-border);background:var(--vscode-editorHoverWidget-background,var(--query-surface-raised))}.query-source-action span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.query-source-action small{color:var(--muted-foreground);font:10px var(--compass-font-mono);flex:none}.query-source-missing{color:var(--vscode-disabledForeground,var(--compass-faint));font:10px var(--compass-font-mono)}.query-table{border:1px solid var(--border);border-radius:3px;overflow:auto}.query-table table{border-collapse:collapse;width:100%;min-width:480px;font-size:11px}.query-table thead{background:var(--workbench-table-header);position:sticky;top:0}.query-table th,.query-table td{border-bottom:1px solid var(--border);text-align:left;text-overflow:ellipsis;white-space:nowrap;max-width:380px;padding:7px 9px;overflow:hidden}.query-table th{color:var(--muted-foreground);font-weight:500}.query-table tbody tr:hover{background:var(--workbench-hover)}.query-table tr:last-child td{border-bottom:0}.query-empty{place-content:center;display:grid}.query-history{text-align:center;width:min(720px,100vw - 40px);margin:-28px auto 20px}.query-history h2{color:var(--muted-foreground);margin:0 0 7px;font-size:10px;font-weight:500}.query-history button{text-overflow:ellipsis;max-width:min(100%,460px);margin:2px;overflow:hidden}.query-shell button:focus-visible{outline:2px solid var(--ring);outline-offset:1px}body.vscode-high-contrast .query-mode,body.vscode-high-contrast-light .query-mode,body.vscode-high-contrast .query-text-result,body.vscode-high-contrast-light .query-text-result,body.vscode-high-contrast .query-json-result,body.vscode-high-contrast-light .query-json-result,body.vscode-high-contrast .query-table,body.vscode-high-contrast-light .query-table,body.vscode-high-contrast .query-composer-panel,body.vscode-high-contrast-light .query-composer-panel,body.vscode-high-contrast .query-editor-shell,body.vscode-high-contrast-light .query-editor-shell,body.vscode-high-contrast .query-prose-result,body.vscode-high-contrast-light .query-prose-result,body.vscode-high-contrast .query-traversal-summary,body.vscode-high-contrast-light .query-traversal-summary,body.vscode-high-contrast .query-node-results,body.vscode-high-contrast-light .query-node-results,body.vscode-high-contrast .query-diagnostics,body.vscode-high-contrast-light .query-diagnostics,body.vscode-high-contrast .query-explanation-card,body.vscode-high-contrast-light .query-explanation-card,body.vscode-high-contrast .query-connections,body.vscode-high-contrast-light .query-connections,body.vscode-high-contrast .query-object-result,body.vscode-high-contrast-light .query-object-result,body.vscode-high-contrast .query-suggestions,body.vscode-high-contrast-light .query-suggestions,body.vscode-high-contrast .query-completion-status,body.vscode-high-contrast-light .query-completion-status{border-width:2px;border-color:var(--vscode-contrastBorder,var(--ring))}body.vscode-high-contrast .query-mode button[aria-selected=true],body.vscode-high-contrast-light .query-mode button[aria-selected=true]{border:2px solid var(--vscode-contrastBorder,var(--ring));border-bottom:0}.history-shell{background:var(--background);height:100vh;min-height:440px;color:var(--foreground);grid-template-columns:minmax(270px,340px) minmax(0,1fr);display:grid;overflow:hidden}.history-bootstrap{background:var(--vscode-editor-background,var(--background));place-items:center;min-height:100vh;display:grid}.history-sidebar{border-right:1px solid var(--border);background:var(--sidebar);min-width:0;min-height:0;color:var(--sidebar-foreground);flex-direction:column;display:flex}.history-sidebar-header{border-bottom:1px solid var(--border);flex:none;padding:14px 12px 12px}.history-title{align-items:flex-start;gap:9px;display:flex}.history-title>svg{width:16px;height:16px;color:var(--muted-foreground);margin-top:1px}.history-title h1{margin:0;font-size:13px;font-weight:600;line-height:1.25}.history-title p{color:var(--muted-foreground);margin:3px 0 0;font-size:11px}.history-search{align-items:center;margin-top:12px;display:flex;position:relative}.history-search>svg{width:14px;height:14px;color:var(--vscode-input-placeholderForeground,var(--muted-foreground));pointer-events:none;position:absolute;left:8px}.history-search input,.history-mobile-select select{border:1px solid var(--vscode-input-border,transparent);background:var(--vscode-input-background,var(--input));width:100%;min-height:28px;color:var(--vscode-input-foreground,var(--foreground));font:inherit;border-radius:2px;outline:none;font-size:12px}.history-search input{padding:4px 8px 4px 28px}.history-search input::placeholder{color:var(--vscode-input-placeholderForeground,var(--muted-foreground))}.history-search input:focus-visible,.history-mobile-select select:focus-visible,.history-rail:focus-visible,.history-commit:focus-visible{border-color:var(--ring);outline:1px solid var(--ring);outline-offset:-1px}.history-mobile-select{display:none}.history-rail{outline:none;flex:auto;min-height:0;overflow:auto}.history-pagination{border-top:1px solid var(--border);color:var(--muted-foreground);flex:none;justify-items:start;gap:6px;padding:8px 10px;font-size:11px;display:grid}.history-pagination [role=alert]{color:var(--destructive)}.history-commit{border:0;border-bottom:1px solid var(--border);width:100%;color:inherit;text-align:left;background:0 0;border-radius:0;align-items:center;gap:.625rem;padding:8px 11px;display:flex;position:absolute;left:0;right:0}.history-commit:hover{background:var(--workbench-hover);color:var(--workbench-hover-foreground)}.history-commit[aria-selected=true]{background:var(--sidebar-accent);color:var(--sidebar-accent-foreground);box-shadow:inset 2px 0 var(--sidebar-primary)}.history-commit>svg{width:15px;height:15px;color:var(--muted-foreground);flex:none}.history-commit>svg[data-state=available]{color:var(--compass-success)}.history-commit>svg[data-state=building]{color:var(--vscode-progressBar-background,var(--ring))}.history-commit>svg[data-state=failed]{color:var(--destructive)}.history-commit-row-copy,.history-commit-subject,.history-commit-byline{min-width:0}.history-commit-row-copy{flex:1;display:block}.history-commit-subject{text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:1.4;display:block;overflow:hidden}.history-commit-byline{color:var(--muted-foreground);white-space:nowrap;align-items:center;gap:5px;margin-top:3px;font-size:10px;display:flex;overflow:hidden}.history-commit[aria-selected=true] .history-commit-byline{color:currentColor}@supports (color:color-mix(in lab,red,red)){.history-commit[aria-selected=true] .history-commit-byline{color:color-mix(in srgb,currentColor 72%,transparent)}}.history-commit-byline code{color:inherit;font-family:var(--compass-font-mono)}.history-commit-byline span{text-overflow:ellipsis;overflow:hidden}.history-commit-byline time{margin-left:auto}.history-content{background:var(--vscode-editor-background,var(--background));min-width:0;min-height:0;padding:16px;overflow:auto}.history-commit-details{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));padding:14px}.history-commit-heading{justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.history-commit-copy{min-width:0}.history-eyebrow{color:var(--muted-foreground);letter-spacing:.06em;text-transform:uppercase;font-size:10px;font-weight:600;display:block}.history-commit-copy h2{overflow-wrap:anywhere;margin:4px 0 0;font-size:16px;font-weight:600;line-height:1.35}.history-commit-metadata{color:var(--muted-foreground);flex-wrap:wrap;gap:4px 12px;margin-top:7px;font-size:11px;display:flex}.history-commit-metadata code{color:var(--vscode-textLink-foreground,var(--workbench-link));font-family:var(--compass-font-mono)}.history-state-badge{text-transform:capitalize;border-radius:2px;flex:none}.history-commit-actions,.history-change-counts{flex-wrap:wrap;margin-top:12px;display:flex}.history-commit-actions{align-items:flex-end;gap:10px}.history-change-counts{gap:6px}.history-change-counts-help{color:var(--vscode-descriptionForeground,#9aa7b7);margin:-.15rem 0 0;font-size:.78rem;line-height:1.45}.history-commit-actions:empty{display:none}.history-commit-actions button{border-radius:2px}.history-comparison-control{grid-template-columns:minmax(180px,1fr) auto;gap:5px 7px;min-width:min(100%,440px);display:grid}.history-comparison-control label{color:var(--muted-foreground);letter-spacing:.04em;text-transform:uppercase;grid-column:1/-1;font-size:10px;font-weight:600}.history-comparison-control select{border:1px solid var(--vscode-dropdown-border,var(--border));background:var(--vscode-dropdown-background,var(--background));min-width:0;height:28px;color:var(--vscode-dropdown-foreground,var(--foreground));border-radius:2px;outline:none;padding:0 26px 0 8px;font-size:11px}.history-comparison-control select option{background:var(--vscode-dropdown-background,var(--background));color:var(--vscode-dropdown-foreground,var(--foreground))}.history-comparison-control select:focus-visible{border-color:var(--vscode-focusBorder,var(--ring));outline:1px solid var(--vscode-focusBorder,var(--ring));outline-offset:-1px}.history-comparison-control select:disabled{color:var(--vscode-disabledForeground,var(--muted-foreground));cursor:not-allowed}.history-comparison-help,.history-inline-error{color:var(--muted-foreground);margin:9px 0 0;font-size:11px;line-height:1.45}.history-inline-error{color:var(--destructive)}.history-change-counts{color:var(--muted-foreground);font-size:11px}.history-change-counts span{border:1px solid var(--border);background:var(--vscode-badge-background,var(--muted));color:var(--vscode-badge-foreground,var(--foreground));border-radius:2px;padding:3px 6px}.history-change-counts strong{font-weight:600}.history-comparison,.history-diff-evidence{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));color:var(--vscode-editor-foreground,var(--foreground));margin-top:12px}.history-comparison{box-shadow:inset 3px 0 0 var(--vscode-focusBorder,var(--ring))}.history-comparison-heading{grid-template-columns:18px minmax(0,1fr) auto;align-items:start;gap:8px;padding:11px 12px 9px;display:grid}.history-comparison-heading>svg,.history-diff-heading>svg{width:15px;height:15px;color:var(--vscode-focusBorder,var(--ring));margin-top:2px}.history-comparison-heading h2{color:var(--vscode-editor-foreground,var(--foreground));margin:2px 0 0;font-size:13px;font-weight:600}.history-comparison-heading code{color:var(--vscode-textLink-foreground,var(--workbench-link));font-family:var(--compass-font-mono);background:0 0}.history-comparison-heading button{border:1px solid var(--border);min-height:26px;color:var(--foreground);background:0 0;border-radius:2px;align-items:center;gap:5px;padding:3px 7px;font-size:10px;display:inline-flex}.history-comparison-heading button:hover{border-color:var(--vscode-focusBorder,var(--ring));background:var(--workbench-hover)}.history-comparison-heading button svg{width:12px;height:12px}.history-comparison-legend{font:10px/1.4 var(--compass-font-mono);flex-wrap:wrap;gap:6px;padding:0 12px 10px 38px;display:flex}.history-delta-card{border:1px solid var(--border);background:var(--vscode-editor-foreground,var(--foreground));border-radius:2px;gap:4px;min-width:200px;padding:6px 8px;display:grid}@supports (color:color-mix(in lab,red,red)){.history-delta-card{background:color-mix(in srgb,var(--vscode-editor-foreground,var(--foreground)) 5%,var(--vscode-editor-background,var(--background)))}}.history-delta-card{color:var(--vscode-editor-foreground,var(--foreground))}.history-delta-card>span{flex-wrap:wrap;gap:5px 10px;display:flex}.history-delta-card strong{color:var(--vscode-editor-foreground,var(--foreground));text-transform:capitalize}.history-delta-card i{font-style:normal;font-weight:600}.history-delta-card i small{color:var(--muted-foreground);font-size:9px;font-weight:400}.history-delta-card i[data-change=added]{color:var(--vscode-gitDecoration-addedResourceForeground,#2ea043)}.history-delta-card i[data-change=removed]{color:var(--vscode-gitDecoration-deletedResourceForeground,#f85149)}.history-delta-card i[data-change=changed]{color:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922)}.history-comparison-empty{border-top:1px solid var(--border);color:var(--muted-foreground);gap:2px;padding:9px 12px 10px 38px;font-size:11px;display:grid}.history-comparison-empty strong{color:var(--foreground);font-size:12px}.history-comparison-workspace{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));min-width:0;color:var(--vscode-editor-foreground,var(--foreground));margin-top:12px;overflow:hidden}.history-comparison-tabs{border-bottom:1px solid var(--border);background:var(--vscode-editorGroupHeader-tabsBackground,var(--vscode-sideBar-background,var(--background)));scrollbar-width:thin;min-width:0;display:flex;overflow-x:auto}.history-comparison-tabs button{border:0;border-right:1px solid var(--border);min-width:max-content;min-height:41px;color:var(--vscode-tab-inactiveForeground,var(--muted-foreground));font:11px/1 var(--compass-font-sans);background:0 0;align-items:center;gap:7px;padding:0 14px;display:inline-flex;position:relative}.history-comparison-tabs button:hover{background:var(--workbench-hover);color:var(--vscode-tab-activeForeground,var(--foreground))}.history-comparison-tabs button[aria-selected=true]{background:var(--vscode-tab-activeBackground,var(--vscode-editor-background,var(--background)));color:var(--vscode-tab-activeForeground,var(--foreground));box-shadow:inset 0 2px 0 var(--vscode-tab-activeBorder,var(--vscode-focusBorder,var(--ring)))}.history-comparison-tabs button:focus-visible{z-index:1;outline:1px solid var(--vscode-focusBorder,var(--ring));outline-offset:-2px}.history-comparison-tabs button>svg{width:14px;height:14px;color:var(--vscode-focusBorder,var(--ring))}.history-comparison-tab-count{border:1px solid var(--border);background:var(--vscode-badge-background,var(--muted));min-width:19px;height:19px;color:var(--vscode-badge-foreground,var(--foreground));font:9px/1 var(--compass-font-mono);border-radius:9px;justify-content:center;align-items:center;padding:0 5px;display:inline-flex}.history-comparison-tab-panel{background:var(--vscode-editor-background,var(--background));min-width:0}.history-evidence-panel{min-width:0;padding:15px 15px 17px}.history-evidence-header{border-bottom:1px solid var(--border);padding-bottom:12px}.history-evidence-header>p,.history-findings-header>div>p{color:var(--muted-foreground);margin:4px 0 0 22px;font-size:11px;line-height:1.45}.history-diff-heading{align-items:center;gap:7px;display:flex}.history-diff-heading h2{margin:0;font-size:13px;font-weight:600}.history-findings-header{justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.history-findings-expand{border:1px solid var(--border);min-height:27px;color:var(--foreground);background:0 0;border-radius:2px;flex:none;padding:4px 9px;font-size:10px}.history-findings-expand:hover{border-color:var(--vscode-focusBorder,var(--ring));background:var(--workbench-hover)}.history-source-changes{gap:6px;margin-top:12px;display:grid}.history-source-changes details{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));color:var(--vscode-editor-foreground,var(--foreground));border-radius:2px;overflow:hidden}.history-diff-toolbar{align-items:center;gap:6px;margin-top:12px;display:flex}.history-diff-layout{border:1px solid var(--border);border-radius:2px;display:inline-flex;overflow:hidden}.history-diff-toolbar button{min-height:25px;color:var(--muted-foreground);background:0 0;border:0;padding:3px 8px;font-size:10px}.history-diff-layout button+button{border-left:1px solid var(--border)}.history-diff-toolbar button:hover:not(:disabled){background:var(--workbench-hover);color:var(--foreground)}.history-diff-toolbar button[aria-pressed=true],.history-diff-toolbar button[aria-pressed=true]:hover{background:var(--vscode-tab-activeBackground,var(--vscode-editor-background,var(--background)));color:var(--vscode-tab-activeForeground,var(--vscode-editor-foreground,var(--foreground)));box-shadow:inset 0 2px 0 var(--vscode-tab-activeBorder,var(--vscode-focusBorder,var(--ring)))}.history-diff-toolbar button:disabled{cursor:not-allowed;opacity:.45}.history-diff-wrap{min-height:25px;color:var(--muted-foreground);align-items:center;gap:5px;font-size:10px;display:inline-flex}.history-diff-wrap input{margin:0}.history-diff-expand{border-radius:2px;margin-left:auto;border:1px solid var(--border)!important}.history-source-changes summary{cursor:pointer;border-bottom:1px solid var(--border);background:var(--vscode-editorGroupHeader-tabsBackground,var(--background));justify-content:space-between;align-items:center;gap:10px;padding:6px 8px;font-size:10px;display:flex}.history-source-path{align-items:center;gap:8px;min-width:0;display:inline-flex}.history-source-path code{color:var(--vscode-textLink-foreground,var(--workbench-link));font-family:var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.history-source-path small{color:var(--muted-foreground);text-transform:capitalize;font-size:9px}.history-source-stats{font-family:var(--compass-font-mono);flex:none;gap:6px;display:inline-flex}.history-source-stats i{font-style:normal;font-weight:600}.history-source-stats i[data-change=added]{color:var(--vscode-gitDecoration-addedResourceForeground,#2ea043)}.history-source-stats i[data-change=removed]{color:var(--vscode-gitDecoration-deletedResourceForeground,#f85149)}.history-source-diff{contain:inline-size;background:var(--vscode-editor-background,var(--background));width:100%;min-width:0;max-width:100%;display:block}.history-diff-fallback>p{border-bottom:1px solid var(--border);color:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922);margin:0;padding:7px 8px}.history-diff-fallback pre{max-height:260px;color:var(--vscode-editor-foreground,var(--foreground));font:10px/1.5 var(--compass-font-mono);white-space:pre;margin:0;padding:8px;overflow:auto}.history-source-changes p,.history-diff-empty{color:var(--muted-foreground);margin:12px 0 0;font-size:11px}.history-finding-list{gap:10px;margin-top:14px;display:grid}.history-finding-list details{border:1px solid var(--border);background:var(--vscode-editor-foreground,var(--foreground));border-radius:4px;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.history-finding-list details{background:color-mix(in srgb,var(--vscode-editor-foreground,var(--foreground)) 2%,var(--vscode-editor-background,var(--background)))}}.history-finding-list details{color:var(--vscode-editor-foreground,var(--foreground))}.history-finding-list details[open]{border-color:var(--vscode-focusBorder,var(--ring))}@supports (color:color-mix(in lab,red,red)){.history-finding-list details[open]{border-color:color-mix(in srgb,var(--vscode-focusBorder,var(--ring)) 58%,var(--border))}}.history-finding-list details[open]{box-shadow:inset 3px 0 0 var(--vscode-focusBorder,var(--ring))}.history-finding-list summary{cursor:pointer;grid-template-columns:28px minmax(0,1fr) 16px;align-items:center;gap:11px;min-height:58px;padding:11px 13px;list-style:none;display:grid}.history-finding-list summary::-webkit-details-marker{display:none}.history-finding-list summary:hover{background:var(--workbench-hover)}.history-finding-list summary:focus-visible{outline:1px solid var(--vscode-focusBorder,var(--ring));outline-offset:-2px}.history-finding-index{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));width:27px;height:27px;color:var(--vscode-focusBorder,var(--ring));font:600 10px/1 var(--compass-font-mono);border-radius:3px;justify-content:center;align-items:center;display:inline-flex}.history-finding-summary{gap:4px;min-width:0;display:grid}.history-finding-summary strong{text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:600;line-height:1.35;overflow:hidden}.history-finding-summary small{color:var(--muted-foreground);font-size:10px}.history-finding-list summary>svg{width:15px;height:15px;color:var(--muted-foreground);transition:transform .12s}.history-finding-list details[open] summary>svg{transform:rotate(90deg)}.history-finding-body{border-top:1px solid var(--border);padding:0 14px 15px 52px}.history-finding-body>p{color:var(--muted-foreground);margin:13px 0 0;font-size:11px}.history-finding-body dl{gap:0;margin:0;display:grid}.history-finding-body dl>div{border-bottom:1px solid var(--border);grid-template-columns:minmax(110px,170px) minmax(0,1fr);gap:16px;padding:12px 0;display:grid}.history-finding-body dl>div:last-child{border-bottom:0;padding-bottom:0}.history-finding-body dt{color:var(--muted-foreground);letter-spacing:.06em;text-transform:uppercase;font-size:9px;font-weight:600}.history-finding-body dd{min-width:0;margin:0;font-size:11px;line-height:1.5}.history-finding-body dd ul{gap:5px;margin:0;padding-left:17px;display:grid}.history-finding-body dd pre{border:1px solid var(--border);background:var(--vscode-textCodeBlock-background,var(--muted));max-height:280px;color:var(--vscode-editor-foreground,var(--foreground));font:10px/1.55 var(--compass-font-mono);white-space:pre-wrap;border-radius:3px;margin:0;padding:9px 10px;overflow:auto}.history-finding-body dd code{font-family:var(--compass-font-mono)}.history-finding-muted{color:var(--muted-foreground);font-style:italic}.history-findings-empty{border:1px dashed var(--border);color:var(--muted-foreground);border-radius:4px;align-items:flex-start;gap:10px;margin-top:14px;padding:15px;display:flex}.history-findings-empty>svg{width:17px;height:17px;color:var(--vscode-focusBorder,var(--ring))}.history-findings-empty strong{color:var(--foreground);font-size:12px}.history-findings-empty p{margin:4px 0 0;font-size:11px}.history-standalone-evidence{gap:12px;margin-top:12px;display:grid}.history-standalone-evidence>section{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background))}.history-graph-frame{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));height:max(400px,100vh - 190px);min-height:360px;margin-top:12px;display:grid;overflow:hidden}.history-graph-frame-tabbed{border:0;height:max(460px,100vh - 230px);min-height:420px;margin-top:0}.history-graph-ready,.history-graph-canvas{min-width:0;min-height:0}.history-graph-ready{flex-direction:column;display:flex}.history-graph-status{border-bottom:1px solid var(--border);background:var(--vscode-editorGroupHeader-tabsBackground,var(--background));min-height:30px;color:var(--muted-foreground);flex:none;padding:7px 10px;font-size:11px}.history-graph-status span{color:var(--foreground);font-family:var(--compass-font-mono)}.history-graph-canvas{isolation:isolate;flex:1;position:relative}.history-graph-canvas .compass-workspace{height:100%;min-height:0}.history-content>section:last-child{margin-top:12px}body.vscode-high-contrast .history-sidebar,body.vscode-high-contrast-light .history-sidebar,body.vscode-high-contrast .history-commit-details,body.vscode-high-contrast-light .history-commit-details,body.vscode-high-contrast .history-graph-frame,body.vscode-high-contrast-light .history-graph-frame,body.vscode-high-contrast .history-comparison,body.vscode-high-contrast-light .history-comparison,body.vscode-high-contrast .history-diff-evidence,body.vscode-high-contrast-light .history-diff-evidence,body.vscode-high-contrast .history-comparison-workspace,body.vscode-high-contrast-light .history-comparison-workspace,body.vscode-high-contrast .history-finding-list details,body.vscode-high-contrast-light .history-finding-list details,body.vscode-high-contrast .history-source-changes details,body.vscode-high-contrast-light .history-source-changes details,body.vscode-high-contrast .history-change-counts span,body.vscode-high-contrast-light .history-change-counts span,body.vscode-high-contrast .history-comparison-control select,body.vscode-high-contrast-light .history-comparison-control select,body.vscode-high-contrast .compass-change-legend,body.vscode-high-contrast-light .compass-change-legend,body.vscode-high-contrast .compass-semantic-legend,body.vscode-high-contrast-light .compass-semantic-legend,body.vscode-high-contrast .compass-change-badge,body.vscode-high-contrast-light .compass-change-badge{border-color:var(--vscode-contrastBorder,var(--ring));border-width:2px}@media(max-width:760px){.query-header{padding:10px}.query-heading-row,.query-composer{flex-direction:column;align-items:stretch}.query-mode{align-self:flex-start}.query-mode button{min-width:180px}.query-mode small{display:none}.query-suggestions button{grid-template-columns:1fr;gap:2px}.query-suggestions button>small,.query-suggestions-hint{display:none}.query-explanation-card{grid-template-columns:1fr}.query-explanation-card dl{grid-column:auto}.history-diff-toolbar{flex-wrap:wrap}.history-comparison-control{grid-template-columns:1fr;width:100%}.history-commit-actions{flex-direction:column;align-items:stretch}.history-commit-actions>button{align-self:flex-start}.history-comparison-control label{grid-column:auto}.history-diff-expand{margin-left:0}.history-comparison-tabs button{min-height:39px;padding-inline:11px}.history-evidence-panel{padding:12px}.history-findings-header{flex-direction:column;align-items:stretch}.history-findings-expand{align-self:flex-start}.history-finding-body{padding-left:14px}.history-finding-body dl>div{grid-template-columns:1fr;gap:5px}.query-composer-footer{flex-wrap:wrap}.query-params{flex:1 0 100%;max-width:none}.query-params input{max-width:none}.query-footer-actions{justify-content:flex-end;width:100%}.query-examples{padding-bottom:2px}.compass-load-shell[data-variant=architecture]{text-align:center;grid-template-rows:auto auto auto;grid-template-columns:1fr}.compass-load-shell[data-variant=architecture] .compass-load-visual,.compass-load-shell[data-variant=architecture] .compass-load-copy,.architecture-load-skeleton{grid-column:1}.compass-load-shell[data-variant=architecture] .compass-load-visual{margin:0 auto}.compass-load-shell[data-variant=architecture] .compass-load-steps{justify-content:center}.architecture-load-skeleton{grid-row:3;width:min(88vw,460px);height:190px;margin-top:14px}.history-shell{grid-template-rows:auto minmax(0,1fr);grid-template-columns:1fr}.history-sidebar{border-right:0;border-bottom:1px solid var(--border)}.history-sidebar-header{padding:10px}.history-title p,.history-search,.history-rail{display:none}.history-mobile-select{color:var(--muted-foreground);gap:4px;margin-top:9px;font-size:10px;display:grid}.history-mobile-select select{padding:4px 7px}.history-content{padding:10px}.history-commit-heading{gap:8px}.history-commit-metadata{gap:3px;display:grid}.history-graph-frame{height:max(750px,102vh + 30px);margin-top:10px}.history-graph-canvas .compass-workspace{height:auto;min-height:max(720px,102vh)}}@media(max-width:420px){.query-params{flex-direction:column;align-items:stretch;gap:4px}.query-params input{flex:none;width:100%}}.architecture-nav{border-right:1px solid var(--border);background:var(--sidebar);min-height:0;color:var(--sidebar-foreground);flex-direction:column;display:flex}.architecture-nav-header{border-bottom:1px solid var(--border);padding:14px 14px 12px}.architecture-nav-header>span,.architecture-eyebrow{color:var(--muted-foreground);letter-spacing:.08em;text-transform:uppercase;font-size:10px;font-weight:600;display:block}.architecture-nav-header h1{text-overflow:ellipsis;white-space:nowrap;margin:4px 0 0;font-size:13px;font-weight:600;line-height:1.35;overflow:hidden}.architecture-section-list{flex:1;min-height:0;padding:5px;overflow:auto}.architecture-section-list>button{width:100%;min-height:48px;color:inherit;text-align:left;background:0 0;border:1px solid #0000;border-radius:3px;grid-template-columns:18px minmax(0,1fr);align-items:start;gap:7px;padding:7px 8px;display:grid}.architecture-section-list>button:hover{background:var(--workbench-hover);color:var(--workbench-hover-foreground)}.architecture-section-list>button[aria-current=page]{border-color:var(--vscode-list-activeSelectionBackground,var(--sidebar-primary));background:var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.architecture-section-list svg{width:14px;height:14px;margin-top:2px}.architecture-section-list strong,.architecture-section-list small{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.architecture-section-list strong{font-size:12px;font-weight:500}.architecture-section-list small{color:var(--muted-foreground);margin-top:2px;font-size:10px}.architecture-section-list>button[aria-current=page] small{color:inherit;opacity:.78}.architecture-stats{border-top:1px solid var(--border);color:var(--muted-foreground);text-align:center;grid-template-columns:repeat(3,1fr);gap:1px;padding:8px 6px;font-size:9px;display:grid}.architecture-stats strong{color:var(--sidebar-foreground);margin-bottom:1px;font-size:11px;display:block}.architecture-main{min-width:0;padding:14px clamp(14px,2.2vw,24px) 32px;overflow:auto}.architecture-global-search{z-index:20;max-width:760px;margin:0 auto 18px;position:sticky;top:0}.architecture-global-search>label{align-items:center;display:flex;position:relative}.architecture-global-search>label>svg{width:15px;height:15px;color:var(--vscode-input-placeholderForeground,var(--muted-foreground));position:absolute;left:10px}.architecture-global-search input{border:1px solid var(--vscode-input-border,var(--border));background:var(--vscode-input-background,var(--input));width:100%;height:34px;color:var(--vscode-input-foreground,var(--foreground));font:inherit;border-radius:3px;outline:none;padding:5px 84px 5px 33px;font-size:12px}.architecture-global-search input:focus-visible{border-color:var(--ring);outline:1px solid var(--ring);outline-offset:-1px}.architecture-global-search label>span{color:var(--muted-foreground);font-size:10px;position:absolute;right:8px}.architecture-search-results{border:1px solid var(--vscode-menu-border,var(--border));background:var(--vscode-menu-background,var(--popover));max-height:min(440px,65vh);color:var(--vscode-menu-foreground,var(--popover-foreground));box-shadow:0 4px 12px var(--vscode-widget-shadow,#00000047);border-radius:3px;position:absolute;top:calc(100% + 2px);left:0;right:0;overflow:auto}.architecture-search-results>p{color:var(--muted-foreground);margin:0;padding:14px;font-size:12px}.architecture-search-results section+section{border-top:1px solid var(--vscode-menu-separatorBackground,var(--border))}.architecture-search-results h2{color:var(--muted-foreground);letter-spacing:.06em;text-transform:uppercase;margin:0;padding:7px 10px 4px;font-size:10px;font-weight:600}.architecture-search-results button{width:100%;color:inherit;text-align:left;background:0 0;border:0;padding:6px 10px;display:block}.architecture-search-results button:hover,.architecture-search-results button:focus-visible{background:var(--vscode-menu-selectionBackground,var(--vscode-list-activeSelectionBackground,var(--accent)));color:var(--vscode-menu-selectionForeground,var(--vscode-list-activeSelectionForeground,var(--accent-foreground)));outline:none}.architecture-search-results button span,.architecture-search-results button small{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.architecture-search-results button span{font-size:12px}.architecture-search-results button small{color:inherit;opacity:.72;margin-top:2px;font-size:10px}.architecture-overview,.architecture-detail{max-width:1500px;margin-left:auto;margin-right:auto}.architecture-detail{margin-top:26px}.architecture-section-heading{justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:10px;display:flex}.architecture-section-heading h2{margin:0;font-size:15px;font-weight:600;line-height:1.35}.architecture-section-heading p{color:var(--muted-foreground);margin:3px 0 0;font-size:11px}.architecture-detail-count{color:var(--muted-foreground);white-space:nowrap;font-size:11px}.architecture-flow-grid,.architecture-symbol-grid{grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:6px;display:grid}.architecture-flow{border:1px solid var(--border);background:var(--vscode-editorWidget-background,var(--card));min-width:0;min-height:38px;color:var(--foreground);font:inherit;text-align:left;border-radius:3px;grid-template-columns:minmax(0,1fr) 14px minmax(0,1fr) auto;align-items:center;gap:6px;padding:6px 8px;font-size:11px;display:grid}.architecture-flow:hover{border-color:var(--vscode-focusBorder,var(--ring));background:var(--workbench-hover)}.architecture-flow>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.architecture-flow>svg{width:13px;height:13px;color:var(--muted-foreground)}.architecture-flow-footer{justify-content:space-between;align-items:center;gap:10px;margin-top:8px;display:flex}.architecture-flow-footer p{color:var(--muted-foreground);margin:0;font-size:10px}.architecture-flow-footer button{border:1px solid var(--border);color:var(--foreground);font:inherit;background:0 0;border-radius:3px;padding:3px 7px;font-size:10px}.architecture-tab-content{min-height:280px;padding-top:8px}.architecture-detail [data-slot=tabs-list]{border-bottom:1px solid var(--border);justify-content:flex-start;gap:0;width:100%;height:30px;padding:0}.architecture-detail [data-slot=tabs-trigger]{min-width:76px;height:30px;color:var(--muted-foreground);border-radius:0;flex:none;padding:4px 10px;font-size:11px;font-weight:500}.architecture-detail [data-slot=tabs-trigger][data-state=active]{color:var(--foreground)}.architecture-detail [data-slot=tabs-trigger]>span{background:var(--vscode-badge-background,var(--muted));min-width:22px;color:var(--vscode-badge-foreground,var(--muted-foreground));font:9px/1.4 var(--compass-font-mono);border-radius:9px;margin-left:4px;padding:1px 5px}.architecture-detail [data-slot=tabs-trigger][data-state=active]>span{color:var(--vscode-badge-foreground,var(--foreground))}.architecture-detail [data-slot=tabs-trigger]:after{background:var(--vscode-tab-activeBorder,var(--ring));bottom:-1px}.architecture-symbol-grid{grid-template-columns:repeat(auto-fill,minmax(210px,1fr));margin-top:8px}.architecture-symbol-card{border:1px solid var(--border);background:var(--vscode-editorWidget-background,var(--card));min-width:0;min-height:92px;color:var(--card-foreground);border-radius:3px;grid-template-rows:auto 1fr;grid-template-columns:18px minmax(0,1fr);gap:0 7px;padding:9px;display:grid}.architecture-symbol-card>svg{width:15px;height:15px;color:var(--vscode-symbolIcon-functionForeground,var(--muted-foreground));margin-top:1px}.architecture-symbol-card h3,.architecture-symbol-card p{text-overflow:ellipsis;white-space:nowrap;margin:0;overflow:hidden}.architecture-symbol-card h3{color:var(--vscode-editor-foreground,var(--foreground));font-size:12px;font-weight:600}.architecture-symbol-card p{color:var(--muted-foreground);margin-top:2px;font-size:10px}.architecture-symbol-card>button,.architecture-symbol-card>span{color:var(--workbench-link);font:10px/1.35 var(--compass-font-mono);text-align:left;text-overflow:ellipsis;white-space:nowrap;background:0 0;border:0;grid-column:1/span 2;align-self:end;margin-top:9px;padding:0;overflow:hidden}.architecture-symbol-card>button:hover{text-decoration:underline}.architecture-symbol-card>span{color:var(--vscode-disabledForeground,var(--compass-faint))}.architecture-call-table{border:1px solid var(--border);border-radius:3px;max-height:min(54vh,620px);margin-top:8px;overflow:auto}.architecture-call-table table{border-collapse:collapse;table-layout:fixed;width:100%;min-width:620px;font-size:11px}.architecture-call-table thead{z-index:2;background:var(--workbench-table-header);position:sticky;top:0}.architecture-call-table th,.architecture-call-table td{border-bottom:1px solid var(--border);text-align:left;text-overflow:ellipsis;white-space:nowrap;padding:7px 9px;overflow:hidden}.architecture-call-table th{color:var(--muted-foreground);padding:0;font-weight:500}.architecture-call-table th button{width:100%;min-height:30px;color:inherit;font:inherit;text-align:left;background:0 0;border:0;align-items:center;gap:5px;padding:6px 9px;display:flex}.architecture-call-table th button:hover{background:var(--workbench-hover);color:var(--foreground)}.architecture-call-table tbody tr:hover{background:var(--workbench-hover)}.architecture-call-table tr:last-child td{border-bottom:0}.architecture-call-table th:nth-child(2),.architecture-call-table th:nth-child(4),.architecture-call-table td:nth-child(2),.architecture-call-table td:nth-child(4){width:126px}.architecture-shell button:focus-visible,.architecture-shell input:focus-visible{outline:2px solid var(--ring);outline-offset:1px}body.vscode-high-contrast .architecture-section-list>button[aria-current=page],body.vscode-high-contrast-light .architecture-section-list>button[aria-current=page],body.vscode-high-contrast .architecture-flow:focus-visible,body.vscode-high-contrast-light .architecture-flow:focus-visible,body.vscode-high-contrast .architecture-symbol-card,body.vscode-high-contrast-light .architecture-symbol-card,body.vscode-high-contrast .architecture-call-table,body.vscode-high-contrast-light .architecture-call-table{border-width:2px;border-color:var(--vscode-contrastBorder,var(--ring))}@media(max-width:760px){.architecture-shell{grid-template-rows:auto 1fr;grid-template-columns:1fr}.architecture-nav{border-right:0;border-bottom:1px solid var(--border);max-height:38vh}.architecture-main{padding:10px 10px 24px}.architecture-global-search{margin-bottom:14px}.architecture-section-heading{align-items:flex-start}.architecture-flow-grid,.architecture-symbol-grid{grid-template-columns:1fr}.architecture-flow-footer,.workbench-pagination{flex-direction:column;align-items:flex-start}.workbench-collection-toolbar{flex-direction:column;align-items:stretch}.workbench-search{width:100%;max-width:none}}.architecture-workspace{--architecture-border:var(--vscode-panel-border,var(--border));--architecture-surface:var(--vscode-editor-background,var(--background));--architecture-raised:var(--vscode-editorWidget-background,var(--vscode-sideBar-background,var(--card)));background:var(--architecture-surface);height:100vh;min-height:520px;color:var(--vscode-editor-foreground,var(--foreground));grid-template-columns:minmax(210px,240px) minmax(520px,1fr) minmax(300px,350px);display:grid;overflow:hidden}.architecture-workspace[data-inspector-open=false]{grid-template-columns:minmax(210px,240px) minmax(520px,1fr)}.architecture-rail,.architecture-inspector{background:var(--vscode-sideBar-background,var(--sidebar));min-width:0;min-height:0}.architecture-rail{border-right:1px solid var(--architecture-border);grid-template-rows:auto 1fr auto;display:grid}.architecture-rail-header,.architecture-inspector-header{border-bottom:1px solid var(--architecture-border);padding:16px}.architecture-rail-header>span,.architecture-inspector-header>span{color:var(--vscode-descriptionForeground,var(--muted-foreground));font:700 9px/1.2 var(--compass-font-mono);letter-spacing:.13em;text-transform:uppercase}.architecture-rail-header h1,.architecture-inspector-header h2{text-overflow:ellipsis;margin:7px 0 0;font-size:14px;font-weight:650;line-height:1.35;overflow:hidden}.architecture-rail-header p,.architecture-inspector-header p{color:var(--vscode-descriptionForeground,var(--muted-foreground));margin:5px 0 0;font-size:10px}.architecture-rail nav{min-height:0;padding:6px;overflow:auto}.architecture-rail nav>button{width:100%;color:inherit;text-align:left;background:0 0;border:1px solid #0000;border-radius:5px;grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:7px;padding:8px;display:grid}.architecture-rail nav>button:hover,.architecture-rail nav>button:focus-visible{background:var(--vscode-list-hoverBackground,var(--workbench-hover))}.architecture-rail nav>button[aria-current=page]{border-color:var(--vscode-focusBorder,var(--ring))}@supports (color:color-mix(in lab,red,red)){.architecture-rail nav>button[aria-current=page]{border-color:color-mix(in srgb,var(--vscode-focusBorder,var(--ring)) 48%,transparent)}}.architecture-rail nav>button[aria-current=page]{background:var(--vscode-list-activeSelectionBackground,var(--vscode-sideBarSectionHeader-background,var(--sidebar-accent)));color:var(--vscode-list-activeSelectionForeground,inherit)}.architecture-rail nav>button[data-empty=true]{opacity:.57}.architecture-rail nav svg{width:14px;height:14px;color:var(--vscode-symbolIcon-moduleForeground,var(--compass-focus))}.architecture-rail nav strong,.architecture-rail nav small{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.architecture-rail nav strong{font-size:11px;font-weight:600}.architecture-rail nav small{color:var(--vscode-descriptionForeground,var(--muted-foreground));font:9px/1.35 var(--compass-font-mono);margin-top:2px}.architecture-rail nav i{background:var(--vscode-badge-background,var(--muted));min-width:24px;color:var(--vscode-badge-foreground,var(--muted-foreground));font:normal 9px/1.3 var(--compass-font-mono);text-align:center;border-radius:10px;padding:2px 5px}.architecture-scope-totals{border-top:1px solid var(--architecture-border);color:var(--vscode-descriptionForeground,var(--muted-foreground));text-align:center;grid-template-columns:repeat(3,1fr);padding:10px 6px;font-size:8px;display:grid}.architecture-scope-totals strong{color:var(--vscode-sideBar-foreground,var(--foreground));font:600 10px/1.2 var(--compass-font-mono);margin-bottom:2px;display:block}.architecture-stage{grid-template-rows:auto auto minmax(0,1fr);min-width:0;min-height:0;display:grid;overflow:hidden}.architecture-command-bar{border-bottom:1px solid var(--architecture-border);background:var(--architecture-surface);grid-template-columns:minmax(240px,1fr) auto auto 30px;align-items:center;gap:8px;padding:9px 12px;display:grid}.architecture-inspector-toggle{border:1px solid var(--architecture-border);background:var(--architecture-raised);width:30px;height:30px;color:var(--vscode-descriptionForeground,var(--muted-foreground));border-radius:4px;place-items:center;display:grid}.architecture-inspector-toggle:hover{background:var(--vscode-toolbar-hoverBackground,var(--workbench-hover));color:var(--foreground)}.architecture-inspector-toggle svg{width:14px;height:14px}.architecture-search{min-width:0;position:relative}.architecture-search>svg,.architecture-detail-filter>svg{z-index:1;width:13px;height:13px;color:var(--vscode-input-placeholderForeground,var(--muted-foreground));pointer-events:none;position:absolute;top:50%;left:9px;transform:translateY(-50%)}.architecture-search>input,.architecture-detail-filter>input,.architecture-evidence-filter select{border:1px solid var(--vscode-input-border,var(--architecture-border));background:var(--vscode-input-background,var(--input));width:100%;height:30px;color:var(--vscode-input-foreground,var(--foreground));font:11px/1.3 var(--vscode-font-family,system-ui);border-radius:4px;outline:none}.architecture-search>input,.architecture-detail-filter>input{padding:4px 72px 4px 29px}.architecture-search>input:focus,.architecture-detail-filter>input:focus,.architecture-evidence-filter select:focus{border-color:var(--vscode-focusBorder,var(--ring));outline:1px solid var(--vscode-focusBorder,var(--ring));outline-offset:-1px}.architecture-search>span{color:var(--vscode-descriptionForeground,var(--muted-foreground));font:9px/1.4 var(--compass-font-mono);position:absolute;top:8px;right:8px}.architecture-search-popover{z-index:30;border:1px solid var(--vscode-menu-border,var(--architecture-border));background:var(--vscode-menu-background,var(--popover));max-height:min(440px,70vh);box-shadow:0 8px 24px var(--vscode-widget-shadow,#00000047);border-radius:5px;position:absolute;top:calc(100% + 4px);left:0;right:0;overflow:auto}.architecture-search-popover>button{width:100%;color:var(--vscode-menu-foreground,var(--foreground));text-align:left;background:0 0;border:0;padding:7px 10px;display:block}.architecture-search-popover>button:hover,.architecture-search-popover>button:focus-visible{background:var(--vscode-menu-selectionBackground,var(--accent));color:var(--vscode-menu-selectionForeground,var(--accent-foreground))}.architecture-search-popover strong,.architecture-search-popover small{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.architecture-search-popover strong{font-size:11px}.architecture-search-popover small{opacity:.75;margin-top:2px;font-size:9px}.architecture-search-popover p{color:var(--muted-foreground);margin:0;padding:16px;font-size:11px}.architecture-scope-switch{border:1px solid var(--architecture-border);border-radius:4px;display:flex;overflow:hidden}.architecture-scope-switch button{min-height:28px;color:var(--vscode-descriptionForeground,var(--muted-foreground));font:10px/1.2 var(--compass-font-mono);background:0 0;border:0;padding:4px 9px}.architecture-scope-switch button+button{border-left:1px solid var(--architecture-border)}.architecture-scope-switch button[aria-pressed=true]{background:var(--vscode-button-secondaryBackground,var(--accent));color:var(--vscode-button-secondaryForeground,var(--accent-foreground))}.architecture-evidence-filter{align-items:center;gap:5px;display:flex}.architecture-evidence-filter>svg{width:13px;height:13px;color:var(--vscode-descriptionForeground,var(--muted-foreground))}.architecture-evidence-filter select{width:auto;min-width:110px;padding:3px 22px 3px 7px}.architecture-context-strip{border-bottom:1px solid var(--architecture-border);background:var(--vscode-breadcrumb-background,var(--architecture-raised));min-height:34px;color:var(--vscode-descriptionForeground,var(--muted-foreground));font:9px/1.3 var(--compass-font-mono);flex-wrap:wrap;align-items:center;gap:6px 14px;padding:6px 12px;display:flex}.architecture-context-strip strong{color:var(--vscode-foreground,var(--foreground));font-weight:600}.architecture-coverage-warning{color:var(--vscode-editorWarning-foreground,var(--warning));align-items:center;gap:4px;display:inline-flex}.architecture-coverage-warning svg{width:12px;height:12px}.architecture-map-panel{border:1px solid var(--architecture-border);background:var(--architecture-raised);border-radius:10px;grid-template-rows:auto minmax(0,1fr) auto;min-width:0;min-height:0;margin:clamp(14px,2vw,24px);display:grid;position:relative;overflow:hidden;box-shadow:0 12px 32px #0000001a}.architecture-map-header{border-bottom:1px solid var(--architecture-border);background:var(--architecture-raised);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px 24px;min-width:0;padding:14px 16px;display:flex}.architecture-map-intro{gap:3px;min-width:min(100%,260px);display:grid}.architecture-map-intro>span{color:var(--vscode-descriptionForeground,var(--muted-foreground));font:700 8px/1.2 var(--compass-font-mono);letter-spacing:.14em;text-transform:uppercase}.architecture-map-intro>strong{overflow-wrap:anywhere;font-size:12px;font-weight:650;line-height:1.35}.architecture-map-intro>small{max-width:560px;color:var(--vscode-descriptionForeground,var(--muted-foreground));font-size:9.5px;line-height:1.45}.architecture-map-actions{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;min-width:0;display:flex}.architecture-map-viewport{overscroll-behavior:contain;scrollbar-color:var(--vscode-scrollbarSlider-background,var(--muted)) transparent;scrollbar-gutter:stable;min-width:0;height:auto;min-height:0;box-shadow:inset -26px 0 22px -24px var(--foreground);position:relative;overflow:auto}@supports (color:color-mix(in lab,red,red)){.architecture-map-viewport{box-shadow:inset -26px 0 22px -24px color-mix(in srgb,var(--foreground) 30%,transparent)}}.architecture-map-viewport{background:linear-gradient(var(--vscode-editorRuler-foreground,var(--border)) 1px,transparent 1px),linear-gradient(90deg,var(--vscode-editorRuler-foreground,var(--border)) 1px,transparent 1px),var(--architecture-surface)}@supports (color:color-mix(in lab,red,red)){.architecture-map-viewport{background:linear-gradient(color-mix(in srgb,var(--vscode-editorRuler-foreground,var(--border)) 9%,transparent) 1px,transparent 1px),linear-gradient(90deg,color-mix(in srgb,var(--vscode-editorRuler-foreground,var(--border)) 9%,transparent) 1px,transparent 1px),var(--architecture-surface)}}.architecture-map-viewport{background-size:32px 32px}.architecture-map-viewport[data-scroll-position=end],.architecture-map-viewport[data-scroll-position=none]{box-shadow:none}.architecture-map-canvas{min-width:100%;min-height:100%}.architecture-route-mode{border:1px solid var(--architecture-border);background:var(--architecture-surface);border-radius:5px;display:flex;overflow:hidden}.architecture-route-mode button{min-width:66px;height:27px;color:var(--vscode-descriptionForeground,var(--muted-foreground));font:9px/1 var(--compass-font-mono);background:0 0;border:0;padding:0 9px}.architecture-route-mode button+button{border-left:1px solid var(--architecture-border)}.architecture-route-mode button:hover{background:var(--vscode-toolbar-hoverBackground,var(--workbench-hover));color:var(--vscode-foreground,var(--foreground))}.architecture-route-mode button[aria-pressed=true]{background:var(--vscode-list-activeSelectionBackground,var(--accent))}@supports (color:color-mix(in lab,red,red)){.architecture-route-mode button[aria-pressed=true]{background:color-mix(in srgb,var(--vscode-list-activeSelectionBackground,var(--accent)) 72%,var(--architecture-raised))}}.architecture-route-mode button[aria-pressed=true]{color:var(--vscode-list-activeSelectionForeground,var(--foreground))}.architecture-map-toolbar{border:1px solid var(--architecture-border);background:var(--architecture-surface);border-radius:5px;align-items:center;display:flex;overflow:hidden}.architecture-map-toolbar button{width:28px;height:27px;color:var(--foreground);background:0 0;border:0;place-items:center;display:grid}.architecture-map-toolbar button:hover{background:var(--workbench-hover)}.architecture-map-toolbar button:disabled{opacity:.38;pointer-events:none}.architecture-map-toolbar button+button,.architecture-map-toolbar span+button{border-left:1px solid var(--architecture-border)}.architecture-map-toolbar svg{width:13px;height:13px}.architecture-map-toolbar span{min-width:40px;color:var(--muted-foreground);font:9px/27px var(--compass-font-mono);text-align:center;padding:0 5px}.architecture-map{cursor:grab;touch-action:none;width:100%;height:100%;display:block}.architecture-map:active{cursor:grabbing}.architecture-arrow-default path{fill:var(--vscode-textLink-foreground,var(--compass-focus))}.architecture-arrow-incoming path{fill:var(--vscode-symbolIcon-interfaceForeground,#b7a1ff)}.architecture-arrow-outgoing path{fill:var(--vscode-charts-blue,#49a6ff)}.architecture-map-lanes{pointer-events:none}.architecture-map-lanes rect{fill:var(--architecture-raised)}@supports (color:color-mix(in lab,red,red)){.architecture-map-lanes rect{fill:color-mix(in srgb,var(--architecture-raised) 8%,transparent)}}.architecture-map-lanes rect{stroke:var(--architecture-border)}@supports (color:color-mix(in lab,red,red)){.architecture-map-lanes rect{stroke:color-mix(in srgb,var(--architecture-border) 20%,transparent)}}.architecture-map-lanes rect{stroke-width:1px}.architecture-map-lanes text{fill:var(--vscode-descriptionForeground,var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.architecture-map-lanes text{fill:color-mix(in srgb,var(--vscode-descriptionForeground,var(--muted-foreground)) 72%,transparent)}}.architecture-map-lanes text{font:700 8px/1 var(--compass-font-mono);letter-spacing:.12em;text-anchor:middle;text-transform:uppercase}.architecture-map-lanes .architecture-map-direction{fill:var(--vscode-descriptionForeground,var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.architecture-map-lanes .architecture-map-direction{fill:color-mix(in srgb,var(--vscode-descriptionForeground,var(--muted-foreground)) 52%,transparent)}}.architecture-map-lanes .architecture-map-direction{letter-spacing:.16em;text-anchor:start;font-size:7px}.architecture-route-line{fill:none;stroke:var(--vscode-textLink-foreground,var(--compass-focus));opacity:var(--architecture-route-opacity,.2);stroke-linecap:round;stroke-linejoin:round;transition:opacity .14s,stroke-width .14s}.architecture-routes g[data-evidence=inferred] .architecture-route-line{stroke:var(--vscode-editorWarning-foreground,var(--warning));stroke-dasharray:6 5}.architecture-routes g[data-direction=backward] .architecture-route-line{stroke-dasharray:3 5}.architecture-route-hit{fill:none;stroke:#0000;stroke-width:16px;cursor:pointer}.architecture-routes g[data-selected=true] .architecture-route-line{opacity:1;filter:drop-shadow(0 0 3px var(--compass-focus))}@supports (color:color-mix(in lab,red,red)){.architecture-routes g[data-selected=true] .architecture-route-line{filter:drop-shadow(0 0 3px color-mix(in srgb,var(--compass-focus) 55%,transparent))}}.architecture-routes g[data-focus-direction=incoming] .architecture-route-line{stroke:var(--vscode-symbolIcon-interfaceForeground,#b7a1ff);opacity:.86}.architecture-routes g[data-focus-direction=outgoing] .architecture-route-line{stroke:var(--vscode-charts-blue,#49a6ff);opacity:.9}.architecture-routes g[data-dimmed=true]{opacity:.09}.architecture-map-panel[data-route-mode=key] .architecture-routes g[data-dimmed=true]{opacity:.38}.architecture-map-nodes g[data-dimmed=true]{opacity:.27}.architecture-map-panel[data-route-mode=key] .architecture-map-nodes g[data-dimmed=true]{opacity:.48}.architecture-routes g:focus-visible .architecture-route-line{stroke:var(--vscode-focusBorder,var(--ring));opacity:1}.architecture-map-nodes g{cursor:grab;touch-action:none;transition:opacity .12s}.architecture-map-nodes g[data-dragging=true]{cursor:grabbing}.architecture-map-node-card{fill:var(--vscode-editorWidget-background,var(--card));stroke:var(--vscode-symbolIcon-moduleForeground,var(--compass-focus))}@supports (color:color-mix(in lab,red,red)){.architecture-map-node-card{stroke:color-mix(in srgb,var(--vscode-symbolIcon-moduleForeground,var(--compass-focus)) 25%,var(--architecture-border))}}.architecture-map-node-card{stroke-width:1px}.architecture-map-node-shadow{fill:#0000002b;stroke:none;transform:translateY(3px)}.architecture-map-node-accent{fill:var(--vscode-symbolIcon-moduleForeground,var(--compass-focus));opacity:.62;pointer-events:none}.architecture-map-nodes g:hover .architecture-map-node-card,.architecture-map-nodes g:focus-visible .architecture-map-node-card,.architecture-map-nodes g[data-selected=true] .architecture-map-node-card,.architecture-map-nodes g[data-dragging=true] .architecture-map-node-card{fill:var(--vscode-list-activeSelectionBackground,var(--accent))}@supports (color:color-mix(in lab,red,red)){.architecture-map-nodes g:hover .architecture-map-node-card,.architecture-map-nodes g:focus-visible .architecture-map-node-card,.architecture-map-nodes g[data-selected=true] .architecture-map-node-card,.architecture-map-nodes g[data-dragging=true] .architecture-map-node-card{fill:color-mix(in srgb,var(--vscode-list-activeSelectionBackground,var(--accent)) 38%,var(--vscode-editorWidget-background,var(--card)))}}.architecture-map-nodes g:hover .architecture-map-node-card,.architecture-map-nodes g:focus-visible .architecture-map-node-card,.architecture-map-nodes g[data-selected=true] .architecture-map-node-card,.architecture-map-nodes g[data-dragging=true] .architecture-map-node-card{stroke:var(--vscode-focusBorder,var(--ring));stroke-width:1.6px}.architecture-map-nodes g[data-selected=true] .architecture-map-node-accent,.architecture-map-nodes g[data-dragging=true] .architecture-map-node-accent{opacity:1}.architecture-map-nodes g[data-dragging=true] .architecture-map-node-shadow{transform:translateY(7px)}.architecture-map-node-name{fill:var(--vscode-editor-foreground,var(--foreground));font:650 12px/1.2 var(--vscode-font-family,system-ui);pointer-events:none}.architecture-map-node-meta{fill:var(--vscode-descriptionForeground,var(--muted-foreground));font:8.5px/1.2 var(--compass-font-mono);pointer-events:none}.architecture-map-node-grip{fill:var(--vscode-descriptionForeground,var(--muted-foreground));opacity:.45;pointer-events:none}.architecture-map-nodes g:hover .architecture-map-node-grip,.architecture-map-nodes g[data-dragging=true] .architecture-map-node-grip{opacity:.9}.architecture-map-legend{min-width:0;color:var(--muted-foreground);font:8px/1.2 var(--compass-font-mono);flex-wrap:wrap;gap:7px 12px;display:flex}.architecture-map-legend span{align-items:center;gap:4px;display:inline-flex}.architecture-map-legend button{color:var(--vscode-textLink-foreground,var(--workbench-link));font:inherit;background:0 0;border:0;padding:0}.architecture-map-legend button:hover{text-decoration:underline}.architecture-map-legend i,.architecture-map-legend svg{background:var(--vscode-textLink-foreground,var(--compass-focus));flex:none;width:18px;height:2px}.architecture-map-legend svg{background:0 0;width:11px;height:11px}.architecture-map-legend i[data-evidence=inferred]{background:repeating-linear-gradient(90deg,var(--vscode-editorWarning-foreground,var(--warning)) 0 4px,transparent 4px 7px)}.architecture-map-legend i[data-direction=incoming]{background:var(--vscode-symbolIcon-interfaceForeground,#b7a1ff)}.architecture-map-legend i[data-direction=outgoing]{background:var(--vscode-charts-blue,#49a6ff)}.architecture-map-legend i[data-direction=bidirectional]{width:18px;height:12px;color:var(--vscode-textLink-foreground,var(--compass-focus));font:normal 10px/1 var(--compass-font-mono);background:0 0;place-items:center;display:grid}.architecture-map-legend i[data-direction=feedback]{background:repeating-linear-gradient(90deg,var(--vscode-textLink-foreground,var(--compass-focus)) 0 3px,transparent 3px 6px)}.architecture-map-table{flex:none;min-width:0;font-size:9px}.architecture-map-table summary{cursor:pointer;color:var(--muted-foreground);white-space:nowrap;padding:3px 0}.architecture-map-table[open]>div{z-index:8;border:1px solid var(--architecture-border);background:var(--architecture-raised);border-radius:6px;width:min(620px,100% - 24px);max-height:280px;position:absolute;bottom:42px;right:12px;overflow:auto;box-shadow:0 8px 24px #00000038}.architecture-map-table table{border-collapse:collapse;table-layout:fixed;width:100%}.architecture-map-table th,.architecture-map-table td{border-top:1px solid var(--architecture-border);overflow-wrap:anywhere;text-align:left;padding:5px 7px}.architecture-map-empty{min-width:min(100%,760px);min-height:100%;color:var(--muted-foreground);text-align:center;align-content:center;place-items:center;gap:5px;padding:30px;font-size:11px;display:grid}.architecture-map-empty strong{color:var(--foreground);font-size:12px}.architecture-map-footer{border-top:1px solid var(--architecture-border);background:var(--architecture-raised);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px 18px;min-width:0;min-height:40px;padding:8px 12px;display:flex;position:relative}.architecture-inspector{border-left:1px solid var(--architecture-border);grid-template-rows:auto auto auto 1fr auto;display:grid}.architecture-route-metrics,.architecture-evidence-counts{color:var(--muted-foreground);font:9px/1.3 var(--compass-font-mono);flex-wrap:wrap;gap:5px 12px;margin-top:9px;display:flex}.architecture-route-metrics span{align-items:center;gap:3px;display:inline-flex}.architecture-route-metrics svg{width:11px;height:11px}.architecture-inspector-tabs{border-bottom:1px solid var(--architecture-border);display:flex}.architecture-inspector-tabs button{min-height:32px;color:var(--muted-foreground);background:0 0;border:0;flex:1;font-size:10px;position:relative}.architecture-inspector-tabs button[aria-selected=true]{color:var(--foreground)}.architecture-inspector-tabs button[aria-selected=true]:after{background:var(--vscode-focusBorder,var(--ring));content:"";height:2px;position:absolute;bottom:-1px;left:10px;right:10px}.architecture-detail-filter{border-bottom:1px solid var(--architecture-border);padding:8px 10px;display:block;position:relative}.architecture-detail-filter>svg{left:19px}.architecture-inspector-scroll{min-height:0;padding:8px;overflow:auto}.architecture-symbol-list,.architecture-call-list{gap:6px;display:grid}.architecture-symbol-list article,.architecture-call-list article{border:1px solid var(--architecture-border);background:var(--vscode-editorWidget-background,var(--card));border-radius:5px;min-width:0;padding:9px}.architecture-symbol-list article{grid-template-columns:16px minmax(0,1fr);gap:7px;display:grid}.architecture-symbol-list svg{width:14px;height:14px;color:var(--vscode-symbolIcon-functionForeground,var(--compass-focus))}.architecture-symbol-list strong,.architecture-symbol-list small,.architecture-symbol-list article button,.architecture-symbol-list article span{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.architecture-symbol-list strong,.architecture-call-list strong{font-size:10px;font-weight:600}.architecture-symbol-list small,.architecture-call-list small{color:var(--muted-foreground);font:8.5px/1.35 var(--compass-font-mono);margin-top:2px}.architecture-symbol-list article button,.architecture-symbol-list article span{width:100%;color:var(--vscode-textLink-foreground,var(--workbench-link));font:8.5px/1.3 var(--compass-font-mono);text-align:left;background:0 0;border:0;margin-top:7px;padding:0}.architecture-symbol-list article span{color:var(--vscode-disabledForeground,var(--muted-foreground))}.architecture-call-list article>div:first-child{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:5px;display:grid}.architecture-call-list article>div:first-child strong{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.architecture-call-list article>div:first-child span{color:var(--vscode-textLink-foreground,var(--compass-focus))}.architecture-call-list article>div:last-child{gap:8px;margin-top:7px;display:flex}.architecture-call-list button{color:var(--vscode-textLink-foreground,var(--workbench-link));background:0 0;border:0;padding:0;font-size:8.5px}.architecture-call-list button:hover,.architecture-symbol-list button:hover{text-decoration:underline}.architecture-inspector>.workbench-pagination{border-top:1px solid var(--architecture-border);padding:7px 9px}.architecture-inspector-empty{min-height:160px;color:var(--muted-foreground);text-align:center;place-items:center;padding:24px;font-size:10px;line-height:1.5;display:grid}.architecture-loading-rows{gap:7px;display:grid}.architecture-loading-rows i{border:1px solid var(--architecture-border);background:linear-gradient(90deg,var(--architecture-raised),var(--architecture-raised),var(--architecture-raised));border-radius:5px;height:58px}@supports (color:color-mix(in lab,red,red)){.architecture-loading-rows i{background:linear-gradient(90deg,var(--architecture-raised),color-mix(in srgb,var(--architecture-raised) 72%,var(--foreground)),var(--architecture-raised))}}.architecture-loading-rows i{background-size:240% 100%;animation:1.3s infinite architecture-row-load}@keyframes architecture-row-load{to{background-position:-140% 0}}.architecture-workspace button:focus-visible,.architecture-workspace [role=button]:focus-visible,.architecture-workspace select:focus-visible,.architecture-workspace input:focus-visible,.architecture-workspace summary:focus-visible{outline:2px solid var(--vscode-focusBorder,var(--ring));outline-offset:-1px}body.vscode-high-contrast .architecture-map-node-card,body.vscode-high-contrast-light .architecture-map-node-card,body.vscode-high-contrast .architecture-map-panel,body.vscode-high-contrast-light .architecture-map-panel,body.vscode-high-contrast .architecture-symbol-list article,body.vscode-high-contrast-light .architecture-symbol-list article,body.vscode-high-contrast .architecture-call-list article,body.vscode-high-contrast-light .architecture-call-list article{stroke:var(--vscode-contrastBorder,var(--ring));border-color:var(--vscode-contrastBorder,var(--ring));stroke-width:2px}body.vscode-high-contrast .architecture-map-panel,body.vscode-high-contrast-light .architecture-map-panel{box-shadow:none;border-width:2px}@media(max-width:1100px){.architecture-workspace{grid-template-columns:200px minmax(440px,1fr) 300px}.architecture-workspace[data-inspector-open=false]{grid-template-columns:200px minmax(440px,1fr)}.architecture-command-bar{grid-template-columns:minmax(220px,1fr) auto 30px}.architecture-evidence-filter{grid-area:2/2}.architecture-inspector-toggle{grid-area:1/3}}@media(max-width:1180px){.architecture-workspace{grid-template-rows:minmax(650px,78vh) auto;grid-template-columns:minmax(190px,220px) minmax(0,1fr);height:auto;min-height:100vh;overflow:auto}.architecture-workspace[data-inspector-open=false]{grid-template-columns:minmax(190px,220px) minmax(0,1fr)}.architecture-rail{grid-row:1/span 2}.architecture-stage{min-height:650px}.architecture-inspector{border-top:1px solid var(--architecture-border);border-left:0;height:min(560px,72vh);min-height:440px;overflow:hidden}}@media(max-width:620px){.architecture-workspace{display:block}.architecture-rail{border-right:0;border-bottom:1px solid var(--architecture-border);max-height:310px}.architecture-rail nav{max-height:190px}.architecture-stage{min-height:650px}.architecture-command-bar{grid-template-columns:1fr}.architecture-evidence-filter,.architecture-inspector-toggle{grid-area:auto}.architecture-map-legend{display:none}}@media(prefers-reduced-motion:reduce){.architecture-route-line,.architecture-map-nodes g{transition:none}.architecture-loading-rows i{animation:none}}.call-guide-shell{box-sizing:border-box;background:radial-gradient(circle at 77% 8%,var(--compass-focus),transparent 28rem),var(--vscode-editor-background,var(--background));min-height:100vh;padding:clamp(28px,5vw,72px) clamp(20px,5vw,72px) 40px;position:relative;overflow:auto}@supports (color:color-mix(in lab,red,red)){.call-guide-shell{background:radial-gradient(circle at 77% 8%,color-mix(in srgb,var(--compass-focus) 9%,transparent),transparent 28rem),var(--vscode-editor-background,var(--background))}}.call-guide-shell{isolation:isolate}.call-guide-grid{z-index:-1;opacity:.19;background-image:linear-gradient(var(--compass-grid) 1px,transparent 1px),linear-gradient(90deg,var(--compass-grid) 1px,transparent 1px);pointer-events:none;background-size:32px 32px;position:fixed;inset:0;-webkit-mask-image:linear-gradient(#000,#0000 68%);mask-image:linear-gradient(#000,#0000 68%)}.call-guide-hero,.call-guide-section,.call-guide-footer{width:min(1120px,100%);margin-inline:auto}.call-guide-hero{border-bottom:1px solid var(--vscode-panel-border,var(--border));grid-template-columns:minmax(300px,.9fr) minmax(420px,1.1fr);align-items:center;gap:clamp(40px,7vw,96px);min-height:330px;padding-bottom:clamp(36px,5vw,64px);display:grid}.call-guide-kicker,.call-guide-overline,.call-guide-route-label,.call-guide-route-readout,.call-guide-shortcut,.call-guide-coverage-badge{font-family:var(--compass-font-mono);text-transform:uppercase;letter-spacing:.12em}.call-guide-kicker{color:var(--vscode-textLink-foreground,var(--compass-focus));align-items:center;gap:8px;font-size:10px;font-weight:700;display:inline-flex}.call-guide-kicker svg{width:14px;height:14px}.call-guide-intro h1{max-width:650px;color:var(--vscode-editor-foreground,var(--foreground));letter-spacing:-.052em;text-wrap:balance;margin:18px 0 0;font-size:clamp(34px,5vw,62px);font-weight:620;line-height:.98}.call-guide-lead{max-width:580px;color:var(--vscode-descriptionForeground,var(--muted-foreground));margin:22px 0 0;font-size:clamp(14px,1.7vw,17px);line-height:1.65}.call-guide-source{border:1px solid var(--vscode-panel-border,var(--border));background:var(--vscode-editorWidget-background,var(--card));border-radius:4px;align-items:center;gap:8px;max-width:min(100%,560px);min-height:34px;margin-top:24px;padding:0 10px;display:inline-flex}@supports (color:color-mix(in lab,red,red)){.call-guide-source{background:color-mix(in srgb,var(--vscode-editorWidget-background,var(--card)) 88%,transparent)}}.call-guide-source{color:var(--vscode-descriptionForeground,var(--muted-foreground));font:11px/1.3 var(--compass-font-mono)}.call-guide-lookup{max-width:620px;margin-top:26px;position:relative}.call-guide-lookup>label{color:var(--vscode-textLink-foreground,var(--compass-focus));font:700 9px/1 var(--compass-font-mono);letter-spacing:.12em;text-transform:uppercase;margin-bottom:8px;display:block}.call-guide-lookup-row{border:1px solid var(--vscode-input-border,var(--border));background:var(--vscode-input-background,var(--card));border-radius:5px;grid-template-columns:minmax(0,1fr) auto;display:grid;box-shadow:0 12px 32px #0000001f}.call-guide-lookup-row:focus-within{border-color:var(--vscode-focusBorder,var(--compass-focus));box-shadow:0 0 0 1px var(--vscode-focusBorder,var(--compass-focus)),0 12px 32px #0000001f}.call-guide-lookup-input{grid-template-columns:auto minmax(0,1fr);align-items:center;gap:9px;min-width:0;padding-inline:12px;display:grid}.call-guide-lookup-input svg{width:15px;height:15px;color:var(--vscode-textLink-foreground,var(--compass-focus))}.call-guide-lookup-input input{min-width:0;height:42px;color:var(--vscode-input-foreground,var(--foreground));font:12px/1 var(--compass-font-mono);background:0 0;border:0;outline:0;padding:0}.call-guide-lookup-input input::placeholder{color:var(--vscode-input-placeholderForeground,var(--muted-foreground))}.call-guide-lookup-row>button{background:var(--vscode-button-background,var(--compass-focus));color:var(--vscode-button-foreground,var(--primary-foreground));font:600 11px/1 var(--compass-font-sans);border:0;border-radius:3px;outline:0;align-items:center;gap:8px;margin:3px;padding:0 13px;display:inline-flex}.call-guide-lookup-row>button:hover:not(:disabled){background:var(--vscode-button-hoverBackground,var(--primary))}.call-guide-lookup-row>button:focus-visible,.call-guide-lookup-directions button:focus-visible{outline:2px solid var(--vscode-focusBorder,var(--ring));outline-offset:2px}.call-guide-lookup-row>button:disabled{cursor:not-allowed;opacity:.5}.call-guide-lookup-row>button svg{width:13px;height:13px}.call-guide-suggestions{border:1px solid var(--vscode-editorSuggestWidget-border,var(--vscode-panel-border,var(--border)));background:var(--vscode-editorSuggestWidget-background,var(--card));max-height:230px;color:var(--vscode-editorSuggestWidget-foreground,var(--foreground));border-radius:4px;margin-top:4px;display:grid;overflow-y:auto;box-shadow:0 12px 32px #00000029}.call-guide-suggestions-label,.call-guide-suggestions-hint{color:var(--vscode-descriptionForeground,var(--muted-foreground));font:9px/1.25 var(--compass-font-mono);padding-block:6px;padding-inline:10px}.call-guide-suggestions-label{letter-spacing:.08em;text-transform:uppercase}.call-guide-suggestions-hint{border-top:1px solid var(--vscode-editorSuggestWidget-border,var(--border));text-align:end}.call-guide-suggestions>button{min-width:0;color:inherit;text-align:start;background:0 0;border:0;outline:0;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:16px;padding-block:8px;padding-inline:10px;display:grid}.call-guide-suggestions>button:hover,.call-guide-suggestions>button[aria-selected=true]{background:var(--vscode-editorSuggestWidget-selectedBackground,var(--accent));color:var(--vscode-editorSuggestWidget-selectedForeground,var(--foreground))}.call-guide-suggestions>button:focus-visible{outline:2px solid var(--vscode-focusBorder,var(--ring));outline-offset:-2px}.call-guide-suggestions>button>span{min-width:0;font:11px/1.35 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.call-guide-suggestions>button>small{color:var(--vscode-descriptionForeground,var(--muted-foreground));text-overflow:ellipsis;white-space:nowrap;font-size:10px;overflow:hidden}.call-guide-completion-status{border:1px solid var(--vscode-editorSuggestWidget-border,var(--vscode-panel-border,var(--border)));background:var(--vscode-editorSuggestWidget-background,var(--card));min-width:0;min-height:34px;color:var(--vscode-descriptionForeground,var(--muted-foreground));border-radius:4px;justify-content:space-between;align-items:center;gap:12px;margin-top:4px;padding-block:7px;padding-inline:10px;font-size:10px;display:flex}.call-guide-completion-status>span{overflow-wrap:anywhere;min-width:0}.call-guide-completion-status>button{border:1px solid var(--vscode-button-border,var(--border));background:var(--vscode-button-secondaryBackground,var(--secondary));color:var(--vscode-button-secondaryForeground,var(--secondary-foreground));font:inherit;border-radius:3px;flex:none;padding-block:3px;padding-inline:7px}.call-guide-completion-status>button:hover{background:var(--vscode-button-secondaryHoverBackground,var(--workbench-hover))}.call-guide-lookup-directions{border:0;align-items:center;gap:3px;margin:8px 0 0;padding:0;display:flex}.call-guide-lookup-directions legend{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.call-guide-lookup-directions button{min-height:25px;color:var(--vscode-descriptionForeground,var(--muted-foreground));font:9px/1 var(--compass-font-mono);text-transform:uppercase;background:0 0;border:1px solid #0000;border-radius:3px;outline:0;padding:0 9px}.call-guide-lookup-directions button:hover,.call-guide-lookup-directions button[aria-pressed=true]{border-color:var(--vscode-panel-border,var(--border));background:var(--vscode-list-hoverBackground,var(--workbench-hover));color:var(--vscode-editor-foreground,var(--foreground))}.call-guide-lookup-directions button[aria-pressed=true]{border-color:var(--vscode-focusBorder,var(--compass-focus))}@supports (color:color-mix(in lab,red,red)){.call-guide-lookup-directions button[aria-pressed=true]{border-color:color-mix(in srgb,var(--vscode-focusBorder,var(--compass-focus)) 65%,var(--border))}}.call-guide-lookup-directions>span{color:var(--vscode-disabledForeground,var(--compass-faint));font:9px/1 var(--compass-font-mono);margin-left:auto}.call-guide-source>span:not(.call-guide-source-light){text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.call-guide-source>svg{flex:none;width:14px;height:14px}.call-guide-source code{border-left:1px solid var(--vscode-panel-border,var(--border));color:var(--vscode-textLink-foreground,var(--compass-focus));font:inherit;flex:none;margin-left:3px;padding-left:9px}.call-guide-source-light{background:var(--vscode-disabledForeground,var(--compass-faint));border-radius:50%;flex:none;width:6px;height:6px}.call-guide-source[data-ready=true] .call-guide-source-light{background:var(--vscode-testing-iconPassed,var(--compass-success));box-shadow:0 0 9px var(--vscode-testing-iconPassed,var(--compass-success))}@supports (color:color-mix(in lab,red,red)){.call-guide-source[data-ready=true] .call-guide-source-light{box-shadow:0 0 9px color-mix(in srgb,var(--vscode-testing-iconPassed,var(--compass-success)) 60%,transparent)}}.call-guide-route{border:1px solid var(--vscode-panel-border,var(--border));background:linear-gradient(135deg,var(--vscode-editorWidget-background,var(--card)),var(--vscode-editor-background,var(--background)));border-radius:8px;padding:16px;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.call-guide-route{background:linear-gradient(135deg,color-mix(in srgb,var(--vscode-editorWidget-background,var(--card)) 94%,transparent),color-mix(in srgb,var(--vscode-editor-background,var(--background)) 82%,transparent))}}.call-guide-route{box-shadow:0 24px 70px #00000038}.call-guide-route:before{content:"";border:1px solid var(--compass-focus);width:230px;height:230px;position:absolute;top:46%;left:50%}@supports (color:color-mix(in lab,red,red)){.call-guide-route:before{border:1px solid color-mix(in srgb,var(--compass-focus) 14%,transparent)}}.call-guide-route:before{box-shadow:0 0 0 44px var(--compass-focus),0 0 0 88px var(--compass-focus);border-radius:50%;transform:translate(-50%,-50%)}@supports (color:color-mix(in lab,red,red)){.call-guide-route:before{box-shadow:0 0 0 44px color-mix(in srgb,var(--compass-focus) 3%,transparent),0 0 0 88px color-mix(in srgb,var(--compass-focus) 2%,transparent)}}.call-guide-route:before{pointer-events:none}.call-guide-route-label,.call-guide-route-readout{z-index:2;color:var(--vscode-disabledForeground,var(--compass-faint));justify-content:space-between;font-size:9px;display:flex;position:relative}.call-guide-route-label code{color:var(--vscode-textLink-foreground,var(--compass-focus));font:inherit;text-transform:none}.call-guide-route-stage{z-index:1;grid-template-columns:repeat(3,minmax(0,1fr));align-items:center;gap:13%;min-height:226px;display:grid;position:relative}.call-guide-route-node{border:1px solid var(--vscode-panel-border,var(--border));background:var(--vscode-editor-background,var(--background));border-radius:5px;flex-direction:column;gap:4px;min-width:0;padding:12px;display:flex;position:relative;box-shadow:0 12px 32px #0003}.call-guide-route-node>span{color:var(--vscode-descriptionForeground,var(--muted-foreground));font:8px/1 var(--compass-font-mono);letter-spacing:.12em}.call-guide-route-node strong{color:var(--vscode-editor-foreground,var(--foreground));font:600 11px/1.3 var(--compass-font-mono);text-overflow:ellipsis;overflow:hidden}.call-guide-route-node small{color:var(--vscode-descriptionForeground,var(--muted-foreground));text-overflow:ellipsis;white-space:nowrap;font-size:9px;overflow:hidden}.call-guide-route-current{border-color:var(--vscode-focusBorder,var(--compass-focus));background:var(--vscode-focusBorder,var(--compass-focus));align-items:center;padding-block:17px}@supports (color:color-mix(in lab,red,red)){.call-guide-route-current{background:color-mix(in srgb,var(--vscode-focusBorder,var(--compass-focus)) 9%,var(--vscode-editor-background,var(--background)))}}.call-guide-route-current{text-align:center;box-shadow:0 0 0 1px var(--compass-focus),0 15px 40px var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.call-guide-route-current{box-shadow:0 0 0 1px color-mix(in srgb,var(--compass-focus) 16%,transparent),0 15px 40px color-mix(in srgb,var(--compass-focus) 14%,transparent)}}.call-guide-route-current>svg{width:17px;height:17px;color:var(--vscode-textLink-foreground,var(--compass-focus));margin-bottom:3px}.call-guide-route-line{z-index:-1;background:var(--compass-focus);width:32%;height:1px;position:absolute;top:50%;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.call-guide-route-line{background:color-mix(in srgb,var(--compass-focus) 44%,var(--border))}}.call-guide-route-line-in{left:18%}.call-guide-route-line-out{right:18%}.call-guide-route-line i{background:var(--vscode-focusBorder,var(--compass-focus));width:5px;height:5px;box-shadow:0 0 9px var(--vscode-focusBorder,var(--compass-focus));border-radius:50%;animation:2.2s linear infinite call-guide-trace;position:absolute;top:-2px}.call-guide-route-line-out i{animation-delay:1.1s}@keyframes call-guide-trace{0%{left:-8px}to{left:calc(100% + 8px)}}.call-guide-route-readout{border-top:1px solid var(--vscode-panel-border,var(--border));letter-spacing:.08em;padding-top:11px}.call-guide-section{border-bottom:1px solid var(--vscode-panel-border,var(--border));padding-block:clamp(34px,5vw,58px)}.call-guide-heading{justify-content:space-between;align-items:flex-end;gap:28px;margin-bottom:24px;display:flex}.call-guide-overline{color:var(--vscode-textLink-foreground,var(--compass-focus));margin-bottom:7px;font-size:9px;font-weight:700;display:block}.call-guide-heading h2{color:var(--vscode-editor-foreground,var(--foreground));letter-spacing:-.025em;margin:0;font-size:clamp(19px,2.4vw,26px);font-weight:600}.call-guide-heading>p{max-width:420px;color:var(--vscode-descriptionForeground,var(--muted-foreground));text-align:right;margin:0;font-size:11px;line-height:1.5}.call-guide-shortcut{color:var(--vscode-descriptionForeground,var(--muted-foreground));white-space:nowrap;align-items:center;gap:7px;font-size:9px;display:inline-flex}.call-guide-shortcut svg{width:12px;height:12px;color:var(--vscode-textLink-foreground,var(--compass-focus))}.call-guide-steps{grid-template-columns:minmax(170px,.8fr) minmax(340px,1.45fr) minmax(170px,.8fr);gap:10px;margin:0;padding:0;list-style:none;display:grid}.call-guide-steps>li{border:1px solid var(--vscode-panel-border,var(--border));background:var(--vscode-editorWidget-background,var(--card));border-radius:5px;align-content:start;gap:17px;min-height:168px;padding:18px;display:grid;position:relative}@supports (color:color-mix(in lab,red,red)){.call-guide-steps>li{background:color-mix(in srgb,var(--vscode-editorWidget-background,var(--card)) 72%,transparent)}}.call-guide-steps>li>svg{width:22px;height:22px;color:var(--vscode-textLink-foreground,var(--compass-focus))}.call-guide-step-number{color:var(--vscode-disabledForeground,var(--compass-faint));font:9px/1 var(--compass-font-mono);letter-spacing:.1em;position:absolute;top:17px;right:17px}.call-guide-steps h3{color:var(--vscode-editor-foreground,var(--foreground));margin:0;font-size:13px;font-weight:600}.call-guide-steps p{color:var(--vscode-descriptionForeground,var(--muted-foreground));margin:6px 0 0;font-size:11px;line-height:1.5}.call-guide-step-menu{grid-template-columns:minmax(150px,.85fr) minmax(195px,1.15fr);align-items:center}.call-guide-menu-preview{min-width:0;padding-right:44%;font-size:10px;position:relative}.call-guide-menu-parent,.call-guide-submenu{border:1px solid var(--vscode-menu-border,var(--border));background:var(--vscode-menu-background,var(--popover));color:var(--vscode-menu-foreground,var(--popover-foreground));border-radius:4px;box-shadow:0 12px 30px #00000040}.call-guide-menu-parent{border-color:var(--vscode-focusBorder,var(--compass-focus));background:var(--vscode-menu-selectionBackground,var(--accent));min-height:31px;color:var(--vscode-menu-selectionForeground,var(--accent-foreground));grid-template-columns:15px 1fr 13px;align-items:center;gap:7px;padding:0 8px;display:grid}.call-guide-menu-parent svg,.call-guide-submenu svg{width:13px;height:13px}.call-guide-submenu{z-index:2;width:58%;min-width:165px;padding:4px;position:absolute;top:22px;right:0}.call-guide-submenu span{white-space:nowrap;border-radius:2px;align-items:center;gap:7px;min-height:26px;padding:0 7px;display:flex}.call-guide-submenu span.is-active{background:var(--vscode-menu-selectionBackground,var(--accent));color:var(--vscode-menu-selectionForeground,var(--accent-foreground))}.call-guide-actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;display:grid}.call-guide-action{border:1px solid var(--vscode-panel-border,var(--border));background:var(--vscode-editorWidget-background,var(--card));min-height:104px;color:var(--vscode-editor-foreground,var(--foreground));font:inherit;text-align:left;border-radius:5px;outline:none;grid-template-columns:auto 1fr auto;align-items:center;gap:13px;padding:18px;transition:border-color .14s,background .14s,transform .14s;display:grid;position:relative}.call-guide-action:not(:disabled):hover{border-color:var(--vscode-focusBorder,var(--compass-focus));background:var(--vscode-list-hoverBackground,var(--workbench-hover))}@supports (color:color-mix(in lab,red,red)){.call-guide-action:not(:disabled):hover{background:color-mix(in srgb,var(--vscode-list-hoverBackground,var(--workbench-hover)) 70%,var(--vscode-editorWidget-background,var(--card)))}}.call-guide-action:not(:disabled):hover{transform:translateY(-2px)}.call-guide-action:focus-visible,.call-guide-walkthrough:focus-visible{outline:2px solid var(--vscode-focusBorder,var(--ring));outline-offset:2px}.call-guide-action:disabled{cursor:not-allowed;opacity:.46}.call-guide-action[data-primary=true]{border-color:var(--vscode-focusBorder,var(--compass-focus))}@supports (color:color-mix(in lab,red,red)){.call-guide-action[data-primary=true]{border-color:color-mix(in srgb,var(--vscode-focusBorder,var(--compass-focus)) 72%,var(--border))}}.call-guide-action[data-primary=true]{background:linear-gradient(130deg,var(--vscode-focusBorder,var(--compass-focus)),transparent 58%),var(--vscode-editorWidget-background,var(--card))}@supports (color:color-mix(in lab,red,red)){.call-guide-action[data-primary=true]{background:linear-gradient(130deg,color-mix(in srgb,var(--vscode-focusBorder,var(--compass-focus)) 13%,transparent),transparent 58%),var(--vscode-editorWidget-background,var(--card))}}.call-guide-action-icon{border:1px solid var(--vscode-panel-border,var(--border));background:var(--vscode-editor-background,var(--background));width:34px;height:34px;color:var(--vscode-textLink-foreground,var(--compass-focus));border-radius:4px;place-items:center;display:grid}.call-guide-action-icon svg{width:16px;height:16px}.call-guide-action strong,.call-guide-action small{display:block}.call-guide-action strong{font-size:12px;font-weight:600}.call-guide-action small{color:var(--vscode-descriptionForeground,var(--muted-foreground));margin-top:5px;font-size:10px}.call-guide-action-arrow{width:15px;height:15px;color:var(--vscode-disabledForeground,var(--compass-faint));transition:transform .14s}.call-guide-action:not(:disabled):hover .call-guide-action-arrow{color:var(--vscode-textLink-foreground,var(--compass-focus));transform:translate(3px)}.call-guide-action em{color:var(--vscode-textLink-foreground,var(--compass-focus));font:normal 8px/1 var(--compass-font-mono);letter-spacing:.08em;text-transform:uppercase;position:absolute;top:8px;right:8px}.call-guide-footer{justify-content:space-between;align-items:center;gap:30px;padding-top:24px;display:flex}.call-guide-coverage{align-items:center;gap:13px;max-width:760px;display:flex}.call-guide-coverage-badge{border:1px solid var(--vscode-testing-iconPassed,var(--compass-success));flex:none;padding:5px 7px}@supports (color:color-mix(in lab,red,red)){.call-guide-coverage-badge{border:1px solid color-mix(in srgb,var(--vscode-testing-iconPassed,var(--compass-success)) 50%,var(--border))}}.call-guide-coverage-badge{color:var(--vscode-testing-iconPassed,var(--compass-success));border-radius:3px;font-size:8px;font-weight:700}.call-guide-coverage p{color:var(--vscode-descriptionForeground,var(--muted-foreground));margin:0;font-size:10px;line-height:1.55}.call-guide-walkthrough{color:var(--vscode-textLink-foreground,var(--compass-focus));font:11px/1 var(--compass-font-sans);background:0 0;border:0;outline:none;flex:none;align-items:center;gap:7px;padding:7px 0;display:inline-flex}.call-guide-walkthrough svg{width:14px;height:14px}.call-guide-walkthrough svg:last-child{width:12px;transition:transform .14s}.call-guide-walkthrough:hover svg:last-child{transform:translate(2px)}body.vscode-high-contrast .call-guide-route,body.vscode-high-contrast-light .call-guide-route,body.vscode-high-contrast .call-guide-steps>li,body.vscode-high-contrast-light .call-guide-steps>li,body.vscode-high-contrast .call-guide-action,body.vscode-high-contrast-light .call-guide-action,body.vscode-high-contrast .call-guide-lookup-row,body.vscode-high-contrast-light .call-guide-lookup-row,body.vscode-high-contrast .call-guide-suggestions,body.vscode-high-contrast-light .call-guide-suggestions,body.vscode-high-contrast .call-guide-completion-status,body.vscode-high-contrast-light .call-guide-completion-status{border-width:2px;border-color:var(--vscode-contrastBorder,var(--ring))}@media(max-width:900px){.call-guide-hero{grid-template-columns:1fr;gap:32px}.call-guide-route{box-sizing:border-box;width:min(620px,100%)}.call-guide-steps{grid-template-columns:1fr 1fr}.call-guide-step-menu{grid-area:2/1/auto/-1}}@media(max-width:680px){.call-guide-shell{padding-inline:16px}.call-guide-heading,.call-guide-footer{flex-direction:column;align-items:flex-start}.call-guide-heading>p{text-align:left}.call-guide-shortcut{display:none}.call-guide-steps,.call-guide-actions{grid-template-columns:1fr}.call-guide-step-menu{grid-area:auto;grid-template-columns:1fr}.call-guide-menu-preview{padding-right:min(42%,180px)}.call-guide-coverage{flex-direction:column;align-items:flex-start}}@media(max-width:440px){.call-guide-lookup-row{grid-template-columns:1fr}.call-guide-lookup-row>button{justify-content:center;min-height:36px}.call-guide-lookup-directions{flex-wrap:wrap}.call-guide-lookup-directions>span{width:100%;margin:5px 0 0}.call-guide-suggestions>button{grid-template-columns:minmax(0,1fr);gap:2px}.call-guide-suggestions>button>small{white-space:normal}.call-guide-route-stage{gap:5%}.call-guide-route-node{padding:9px 7px}.call-guide-route-node small{display:none}.call-guide-menu-preview{padding:0}.call-guide-submenu{width:auto;margin:6px 0 0 18px;position:relative;top:auto}}@media(prefers-reduced-motion:reduce){.call-guide-route-line i{animation:none}.call-guide-action,.call-guide-action-arrow,.call-guide-walkthrough svg:last-child{transition:none}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}} +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-content:"";--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--spacing:.25rem;--container-xs:20rem;--container-md:28rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--font-weight-medium:500;--radius-md:calc(var(--radius) - 2px);--radius-4xl:2rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--compass-font-sans);--default-mono-font-family:var(--compass-font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.top-2{top:calc(var(--spacing) * 2)}.right-2{right:calc(var(--spacing) * 2)}.bottom-3{bottom:calc(var(--spacing) * 3)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-1\/2{left:50%}.left-3{left:calc(var(--spacing) * 3)}.left-4{left:calc(var(--spacing) * 4)}.isolate{isolation:isolate}.z-20{z-index:20}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mt-2{margin-top:calc(var(--spacing) * 2)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-full{width:100%;height:100%}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-\[calc\(100\%-1px\)\]{height:calc(100% - 1px)}.h-screen{height:100vh}.max-h-24{max-height:calc(var(--spacing) * 24)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\[min\(44rem\,calc\(100\%-1\.5rem\)\)\]{max-width:min(44rem,100% - 1.5rem)}.max-w-md{max-width:var(--container-md)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-7{min-width:calc(var(--spacing) * 7)}.min-w-8{min-width:calc(var(--spacing) * 8)}.min-w-9{min-width:calc(var(--spacing) * 9)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.origin-\(--radix-tooltip-content-transform-origin\){transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[calc\(-50\%_-_2px\)\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-45{rotate:45deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.touch-none{touch-action:none}.resize{resize:both}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-\[--spacing\(var\(--gap\)\)\]{gap:calc(var(--spacing) * var(--gap))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.rounded-4xl{border-radius:var(--radius-4xl)}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-\[min\(var\(--radius-md\)\,10px\)\]{border-radius:min(var(--radius-md),10px)}.rounded-\[min\(var\(--radius-md\)\,12px\)\]{border-radius:min(var(--radius-md),12px)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-border{border-color:var(--border)}.border-destructive\/50{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.border-destructive\/50{border-color:color-mix(in oklab,var(--destructive) 50%,transparent)}}.border-input{border-color:var(--input)}.border-transparent{border-color:#0000}.bg-background,.bg-background\/95{background-color:var(--background)}@supports (color:color-mix(in lab,red,red)){.bg-background\/95{background-color:color-mix(in oklab,var(--background) 95%,transparent)}}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-destructive\/10{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\/10{background-color:color-mix(in oklab,var(--destructive) 10%,transparent)}}.bg-foreground{background-color:var(--foreground)}.bg-muted{background-color:var(--muted)}.bg-popover\/95{background-color:var(--popover)}@supports (color:color-mix(in lab,red,red)){.bg-popover\/95{background-color:color-mix(in oklab,var(--popover) 95%,transparent)}}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.bg-clip-padding{background-clip:padding-box}.fill-foreground{fill:var(--foreground)}.p-1{padding:var(--spacing)}.p-3{padding:calc(var(--spacing) * 3)}.p-\[3px\]{padding:3px}.p-px{padding:1px}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.text-left{text-align:left}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[0\.8rem\]{font-size:.8rem}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-balance{text-wrap:balance}.whitespace-nowrap{white-space:nowrap}.text-background{color:var(--background)}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-foreground,.text-foreground\/60{color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.text-foreground\/60{color:color-mix(in oklab,var(--foreground) 60%,transparent)}}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-secondary-foreground{color:var(--secondary-foreground)}.underline-offset-4{text-underline-offset:4px}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.paused{animation-play-state:paused}.running{animation-play-state:running}.group-has-\[\>svg\]\/alert\:col-start-2:is(:where(.group\/alert):has(>svg) *){grid-column-start:2}.group-data-\[orientation\=horizontal\]\/tabs\:h-8:is(:where(.group\/tabs)[data-orientation=horizontal] *){height:calc(var(--spacing) * 8)}.group-data-\[orientation\=vertical\]\/tabs\:h-fit:is(:where(.group\/tabs)[data-orientation=vertical] *){height:fit-content}.group-data-\[orientation\=vertical\]\/tabs\:w-full:is(:where(.group\/tabs)[data-orientation=vertical] *){width:100%}.group-data-\[orientation\=vertical\]\/tabs\:flex-col:is(:where(.group\/tabs)[data-orientation=vertical] *){flex-direction:column}.group-data-\[orientation\=vertical\]\/tabs\:justify-start:is(:where(.group\/tabs)[data-orientation=vertical] *){justify-content:flex-start}.group-data-\[spacing\=0\]\/toggle-group\:rounded-none:is(:where(.group\/toggle-group)[data-spacing="0"] *){border-radius:0}.group-data-\[spacing\=0\]\/toggle-group\:px-2:is(:where(.group\/toggle-group)[data-spacing="0"] *){padding-inline:calc(var(--spacing) * 2)}.group-data-\[variant\=line\]\/tabs-list\:bg-transparent:is(:where(.group\/tabs-list)[data-variant=line] *){background-color:#0000}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-6::file-selector-button{height:calc(var(--spacing) * 6)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:bg-foreground:after{content:var(--tw-content);background-color:var(--foreground)}.after\:opacity-0:after{content:var(--tw-content);opacity:0}.after\:transition-opacity:after{content:var(--tw-content);transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.group-data-\[orientation\=horizontal\]\/tabs\:after\:inset-x-0:is(:where(.group\/tabs)[data-orientation=horizontal] *):after{content:var(--tw-content);inset-inline:0}.group-data-\[orientation\=horizontal\]\/tabs\:after\:bottom-\[-5px\]:is(:where(.group\/tabs)[data-orientation=horizontal] *):after{content:var(--tw-content);bottom:-5px}.group-data-\[orientation\=horizontal\]\/tabs\:after\:h-0\.5:is(:where(.group\/tabs)[data-orientation=horizontal] *):after{content:var(--tw-content);height:calc(var(--spacing) * .5)}.group-data-\[orientation\=vertical\]\/tabs\:after\:inset-y-0:is(:where(.group\/tabs)[data-orientation=vertical] *):after{content:var(--tw-content);inset-block:0}.group-data-\[orientation\=vertical\]\/tabs\:after\:-right-1:is(:where(.group\/tabs)[data-orientation=vertical] *):after{content:var(--tw-content);right:calc(var(--spacing) * -1)}.group-data-\[orientation\=vertical\]\/tabs\:after\:w-0\.5:is(:where(.group\/tabs)[data-orientation=vertical] *):after{content:var(--tw-content);width:calc(var(--spacing) * .5)}@media(hover:hover){.hover\:bg-\[color-mix\(in_oklch\,var\(--secondary\)\,var\(--foreground\)_5\%\)\]:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[color-mix\(in_oklch\,var\(--secondary\)\,var\(--foreground\)_5\%\)\]:hover{background-color:color-mix(in oklch,var(--secondary),var(--foreground) 5%)}}.hover\:bg-destructive\/20:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/20:hover{background-color:color-mix(in oklab,var(--destructive) 20%,transparent)}}.hover\:bg-muted:hover{background-color:var(--muted)}.hover\:bg-primary\/80:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/80:hover{background-color:color-mix(in oklab,var(--primary) 80%,transparent)}}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:text-muted-foreground:hover{color:var(--muted-foreground)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:z-10:focus,.focus-visible\:z-10:focus-visible{z-index:10}.focus-visible\:border-destructive\/40:focus-visible{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:border-destructive\/40:focus-visible{border-color:color-mix(in oklab,var(--destructive) 40%,transparent)}}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-3:focus-visible,.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.focus-visible\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-ring:focus-visible{outline-color:var(--ring)}.active\:not-aria-\[haspopup\]\:translate-y-px:active:not([aria-haspopup]){--tw-translate-y:1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-input\/50:disabled{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.disabled\:bg-input\/50:disabled{background-color:color-mix(in oklab,var(--input) 50%,transparent)}}.disabled\:opacity-50:disabled{opacity:.5}:where([data-slot=button-group]) .in-data-\[slot\=button-group\]\:rounded-lg{border-radius:var(--radius)}.has-data-\[icon\=inline-end\]\:pr-1:has([data-icon=inline-end]){padding-right:var(--spacing)}.has-data-\[icon\=inline-end\]\:pr-1\.5:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 1.5)}.has-data-\[icon\=inline-end\]\:pr-2:has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 2)}.group-data-\[spacing\=0\]\/toggle-group\:has-data-\[icon\=inline-end\]\:pr-1\.5:is(:where(.group\/toggle-group)[data-spacing="0"] *):has([data-icon=inline-end]){padding-right:calc(var(--spacing) * 1.5)}.has-data-\[icon\=inline-start\]\:pl-1:has([data-icon=inline-start]){padding-left:var(--spacing)}.has-data-\[icon\=inline-start\]\:pl-1\.5:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 1.5)}.has-data-\[icon\=inline-start\]\:pl-2:has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 2)}.group-data-\[spacing\=0\]\/toggle-group\:has-data-\[icon\=inline-start\]\:pl-1\.5:is(:where(.group\/toggle-group)[data-spacing="0"] *):has([data-icon=inline-start]){padding-left:calc(var(--spacing) * 1.5)}.has-data-\[slot\=alert-action\]\:relative:has([data-slot=alert-action]){position:relative}.has-data-\[slot\=alert-action\]\:pr-18:has([data-slot=alert-action]){padding-right:calc(var(--spacing) * 18)}.has-data-\[slot\=kbd\]\:pr-1\.5:has([data-slot=kbd]){padding-right:calc(var(--spacing) * 1.5)}.has-\[\>svg\]\:grid-cols-\[auto_1fr\]:has(>svg){grid-template-columns:auto 1fr}.has-\[\>svg\]\:gap-x-2:has(>svg){column-gap:calc(var(--spacing) * 2)}.aria-expanded\:bg-muted[aria-expanded=true]{background-color:var(--muted)}.aria-expanded\:bg-secondary[aria-expanded=true]{background-color:var(--secondary)}.aria-expanded\:text-foreground[aria-expanded=true]{color:var(--foreground)}.aria-expanded\:text-secondary-foreground[aria-expanded=true]{color:var(--secondary-foreground)}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-3[aria-invalid=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.aria-pressed\:bg-muted[aria-pressed=true]{background-color:var(--muted)}.data-closed\:animate-out[data-closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-closed\:fade-out-0[data-closed]{--tw-exit-opacity:0}.data-closed\:zoom-out-95[data-closed]{--tw-exit-scale:.95}.data-horizontal\:h-2\.5[data-horizontal]{height:calc(var(--spacing) * 2.5)}.data-horizontal\:h-px[data-horizontal]{height:1px}.data-horizontal\:w-full[data-horizontal]{width:100%}.data-horizontal\:flex-col[data-horizontal]{flex-direction:column}.data-horizontal\:border-t[data-horizontal]{border-top-style:var(--tw-border-style);border-top-width:1px}.data-horizontal\:border-t-transparent[data-horizontal]{border-top-color:#0000}.data-open\:animate-in[data-open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-open\:fade-in-0[data-open]{--tw-enter-opacity:0}.data-open\:zoom-in-95[data-open]{--tw-enter-scale:.95}.data-vertical\:h-full[data-vertical]{height:100%}.data-vertical\:w-2\.5[data-vertical]{width:calc(var(--spacing) * 2.5)}.data-vertical\:w-px[data-vertical]{width:1px}.data-vertical\:flex-col[data-vertical]{flex-direction:column}.data-vertical\:items-stretch[data-vertical]{align-items:stretch}.data-vertical\:self-stretch[data-vertical]{align-self:stretch}.data-vertical\:border-l[data-vertical]{border-left-style:var(--tw-border-style);border-left-width:1px}.data-vertical\:border-l-transparent[data-vertical]{border-left-color:#0000}.data-\[orientation\=horizontal\]\:flex-col[data-orientation=horizontal]{flex-direction:column}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[size\=sm\]\:rounded-\[min\(var\(--radius-md\)\,10px\)\][data-size=sm]{border-radius:min(var(--radius-md),10px)}:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:color-mix(in oklab,var(--destructive) 90%,transparent)}}:is(.\*\*\:data-\[slot\=kbd\]\:relative *)[data-slot=kbd]{position:relative}:is(.\*\*\:data-\[slot\=kbd\]\:isolate *)[data-slot=kbd]{isolation:isolate}:is(.\*\*\:data-\[slot\=kbd\]\:z-50 *)[data-slot=kbd]{z-index:50}:is(.\*\*\:data-\[slot\=kbd\]\:rounded-sm *)[data-slot=kbd]{border-radius:calc(var(--radius) - 4px)}.group-data-horizontal\/toggle-group\:data-\[spacing\=0\]\:first\:rounded-l-lg:is(:where(.group\/toggle-group)[data-horizontal] *)[data-spacing="0"]:first-child{border-top-left-radius:var(--radius);border-bottom-left-radius:var(--radius)}.group-data-vertical\/toggle-group\:data-\[spacing\=0\]\:first\:rounded-t-lg:is(:where(.group\/toggle-group)[data-vertical] *)[data-spacing="0"]:first-child{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.group-data-horizontal\/toggle-group\:data-\[spacing\=0\]\:last\:rounded-r-lg:is(:where(.group\/toggle-group)[data-horizontal] *)[data-spacing="0"]:last-child{border-top-right-radius:var(--radius);border-bottom-right-radius:var(--radius)}.group-data-vertical\/toggle-group\:data-\[spacing\=0\]\:last\:rounded-b-lg:is(:where(.group\/toggle-group)[data-vertical] *)[data-spacing="0"]:last-child{border-bottom-right-radius:var(--radius);border-bottom-left-radius:var(--radius)}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:var(--background)}.data-\[state\=active\]\:text-foreground[data-state=active]{color:var(--foreground)}.group-data-\[variant\=default\]\/tabs-list\:data-\[state\=active\]\:shadow-sm:is(:where(.group\/tabs-list)[data-variant=default] *)[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:bg-transparent:is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]{background-color:#0000}.group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:shadow-none:is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:after\:opacity-100:is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]:after{content:var(--tw-content);opacity:1}.data-\[state\=delayed-open\]\:animate-in[data-state=delayed-open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=delayed-open\]\:fade-in-0[data-state=delayed-open]{--tw-enter-opacity:0}.data-\[state\=delayed-open\]\:zoom-in-95[data-state=delayed-open]{--tw-enter-scale:.95}.data-\[state\=on\]\:bg-muted[data-state=on]{background-color:var(--muted)}.data-\[variant\=line\]\:rounded-none[data-variant=line]{border-radius:0}.group-data-horizontal\/toggle-group\:data-\[spacing\=0\]\:data-\[variant\=outline\]\:border-l-0:is(:where(.group\/toggle-group)[data-horizontal] *)[data-spacing="0"][data-variant=outline]{border-left-style:var(--tw-border-style);border-left-width:0}.group-data-vertical\/toggle-group\:data-\[spacing\=0\]\:data-\[variant\=outline\]\:border-t-0:is(:where(.group\/toggle-group)[data-vertical] *)[data-spacing="0"][data-variant=outline]{border-top-style:var(--tw-border-style);border-top-width:0}.group-data-horizontal\/toggle-group\:data-\[spacing\=0\]\:data-\[variant\=outline\]\:first\:border-l:is(:where(.group\/toggle-group)[data-horizontal] *)[data-spacing="0"][data-variant=outline]:first-child{border-left-style:var(--tw-border-style);border-left-width:1px}.group-data-vertical\/toggle-group\:data-\[spacing\=0\]\:data-\[variant\=outline\]\:first\:border-t:is(:where(.group\/toggle-group)[data-vertical] *)[data-spacing="0"][data-variant=outline]:first-child{border-top-style:var(--tw-border-style);border-top-width:1px}@media(min-width:48rem){.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.md\:text-pretty{text-wrap:pretty}}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:bg-destructive\/20:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-destructive\/20:is(.dark *){background-color:color-mix(in oklab,var(--destructive) 20%,transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:text-muted-foreground:is(.dark *){color:var(--muted-foreground)}@media(hover:hover){.dark\:hover\:bg-destructive\/30:is(.dark *):hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-destructive\/30:is(.dark *):hover{background-color:color-mix(in oklab,var(--destructive) 30%,transparent)}}.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input) 50%,transparent)}}.dark\:hover\:bg-muted\/50:is(.dark *):hover{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-muted\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}.dark\:hover\:text-foreground:is(.dark *):hover{color:var(--foreground)}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:disabled\:bg-input\/80:is(.dark *):disabled{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:disabled\:bg-input\/80:is(.dark *):disabled{background-color:color-mix(in oklab,var(--input) 80%,transparent)}}.dark\:aria-invalid\:border-destructive\/50:is(.dark *)[aria-invalid=true]{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:border-destructive\/50:is(.dark *)[aria-invalid=true]{border-color:color-mix(in oklab,var(--destructive) 50%,transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:data-\[state\=active\]\:border-input:is(.dark *)[data-state=active]{border-color:var(--input)}.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:data-\[state\=active\]\:text-foreground:is(.dark *)[data-state=active]{color:var(--foreground)}.dark\:group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:border-transparent:is(.dark *):is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]{border-color:#0000}.dark\:group-data-\[variant\=line\]\/tabs-list\:data-\[state\=active\]\:bg-transparent:is(.dark *):is(:where(.group\/tabs-list)[data-variant=line] *)[data-state=active]{background-color:#0000}.\[\&_a\]\:underline a{text-decoration-line:underline}.\[\&_a\]\:underline-offset-3 a{text-underline-offset:3px}@media(hover:hover){.\[\&_a\]\:hover\:text-foreground a:hover{color:var(--foreground)}}.\[\&_p\:not\(\:last-child\)\]\:mb-4 p:not(:last-child){margin-bottom:calc(var(--spacing) * 4)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3\.5 svg:not([class*=size-]){width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}@media(hover:hover){.\[a\]\:hover\:bg-destructive\/20:is(a):hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.\[a\]\:hover\:bg-destructive\/20:is(a):hover{background-color:color-mix(in oklab,var(--destructive) 20%,transparent)}}.\[a\]\:hover\:bg-muted:is(a):hover{background-color:var(--muted)}.\[a\]\:hover\:bg-primary\/80:is(a):hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.\[a\]\:hover\:bg-primary\/80:is(a):hover{background-color:color-mix(in oklab,var(--primary) 80%,transparent)}}.\[a\]\:hover\:bg-secondary\/80:is(a):hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.\[a\]\:hover\:bg-secondary\/80:is(a):hover{background-color:color-mix(in oklab,var(--secondary) 80%,transparent)}}.\[a\]\:hover\:text-muted-foreground:is(a):hover{color:var(--muted-foreground)}}:is(.\*\:\[svg\]\:row-span-2>*):is(svg){grid-row:span 2/span 2}:is(.\*\:\[svg\]\:translate-y-0\.5>*):is(svg){--tw-translate-y:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}:is(.\*\:\[svg\]\:text-current>*):is(svg){color:currentColor}:is(.\*\:\[svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4>*):is(svg:not([class*=size-])){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&\>svg\]\:pointer-events-none>svg{pointer-events:none}.\[\&\>svg\]\:size-3\!>svg{width:calc(var(--spacing) * 3)!important;height:calc(var(--spacing) * 3)!important}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}.init-shell{box-sizing:border-box;background:linear-gradient(var(--compass-grid) 1px,transparent 1px),linear-gradient(90deg,var(--compass-grid) 1px,transparent 1px),var(--background);height:100vh;min-height:100vh;color:var(--foreground);background-size:32px 32px;padding:clamp(28px,5vw,72px);overflow:auto}.init-header,.init-progress-header{justify-content:space-between;align-items:flex-end;gap:28px;width:min(1080px,100%);margin:0 auto clamp(26px,4vw,46px);display:flex}.init-eyebrow{color:var(--compass-focus);font:600 11px/1.3 var(--compass-font-mono);letter-spacing:.12em;text-transform:uppercase;margin:0 0 8px}.init-header h1,.init-progress-header h1,.init-result-card h1{color:var(--foreground);font:600 clamp(28px,4vw,44px)/1.08 var(--compass-font-sans);letter-spacing:-.035em;margin:0}.init-header-copy,.init-progress-header p:not(.init-eyebrow),.init-result-card>p:not(.init-eyebrow){max-width:650px;color:var(--muted-foreground);margin:13px 0 0;font-size:14px;line-height:1.65}.init-repository-badge{border:1px solid var(--compass-line);background:var(--vscode-editorWidget-background,var(--compass-panel));border-radius:5px;align-items:center;gap:11px;min-width:190px;max-width:320px;padding:11px 13px;display:flex}.init-repository-badge>svg{width:16px;color:var(--compass-focus)}.init-repository-badge span{min-width:0}.init-repository-badge small,.init-repository-badge strong{display:block}.init-repository-badge small{color:var(--compass-faint);font:10px/1.2 var(--compass-font-mono);text-transform:uppercase;margin-bottom:2px}.init-repository-badge strong{text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.init-layout{border:1px solid var(--compass-line-strong);background:var(--vscode-editorWidget-background,var(--compass-panel));width:min(1080px,100%);min-height:520px;box-shadow:0 22px 55px var(--vscode-widget-shadow,#0000003d);border-radius:7px;grid-template-columns:245px minmax(0,1fr);margin:0 auto;display:grid;overflow:hidden}.init-step-nav{border-right:1px solid var(--compass-line);background:var(--compass-panel);flex-direction:column;justify-content:space-between;min-width:0;padding:27px 20px 20px;display:flex}@supports (color:color-mix(in lab,red,red)){.init-step-nav{background:color-mix(in srgb,var(--compass-panel) 88%,var(--compass-canvas))}}.init-step-nav ol,.init-runway,.init-rule-list{margin:0;padding:0;list-style:none}.init-step-nav li{padding-bottom:10px;position:relative}.init-step-nav li:not(:last-child):after{background:var(--compass-line);content:"";width:1px;position:absolute;top:37px;bottom:-1px;left:22px}.init-step-nav li[data-state=complete]:after{background:var(--compass-success)}@supports (color:color-mix(in lab,red,red)){.init-step-nav li[data-state=complete]:after{background:color-mix(in srgb,var(--compass-success) 62%,var(--compass-line))}}.init-step-nav button{width:100%;color:var(--muted-foreground);text-align:left;background:0 0;border:0;border-radius:4px;align-items:center;gap:11px;padding:7px;display:flex}.init-step-nav button:not(:disabled):hover{background:var(--workbench-hover);color:var(--foreground)}.init-step-nav button:focus-visible{outline:2px solid var(--compass-focus);outline-offset:1px}.init-step-marker{z-index:1;border:1px solid var(--compass-line-strong);background:var(--compass-panel);border-radius:50%;flex:0 0 30px;place-items:center;width:30px;height:30px;display:grid}.init-step-marker svg{width:13px;height:13px}.init-step-nav li[data-state=active] button{color:var(--foreground)}.init-step-nav li[data-state=active] .init-step-marker{border-color:var(--compass-focus);background:var(--compass-focus-soft);color:var(--compass-focus);box-shadow:0 0 0 4px var(--compass-focus-soft)}.init-step-nav li[data-state=complete] .init-step-marker{border-color:var(--compass-success);color:var(--compass-success)}.init-step-nav button small,.init-step-nav button strong{display:block}.init-step-nav button small{color:var(--compass-faint);font:9px/1.2 var(--compass-font-mono);letter-spacing:.06em;text-transform:uppercase;margin-bottom:2px}.init-step-nav button strong{font-size:12px;font-weight:550}.init-local-note{border:1px solid var(--compass-line);background:var(--compass-focus);border-radius:5px;align-items:flex-start;gap:9px;padding:12px;display:flex}@supports (color:color-mix(in lab,red,red)){.init-local-note{background:color-mix(in srgb,var(--compass-focus) 6%,transparent)}}.init-local-note>svg{width:14px;color:var(--compass-focus);flex:0 0 14px}.init-local-note p{color:var(--muted-foreground);margin:0;font-size:10px;line-height:1.5}.init-local-note strong,.init-local-note code{display:block}.init-local-note strong{color:var(--foreground);margin-bottom:2px;font-size:10px}.init-local-note code{color:var(--compass-focus);font-family:var(--compass-font-mono);margin-top:4px}.init-stage{flex-direction:column;min-width:0;padding:clamp(28px,5vw,52px);display:flex}.init-stage-heading{align-items:flex-start;gap:16px;margin-bottom:28px;display:flex}.init-stage-heading>span{color:var(--compass-focus);font:600 11px/1 var(--compass-font-mono);padding-top:5px}.init-stage-heading h2{color:var(--foreground);font:600 clamp(21px,3vw,28px)/1.2 var(--compass-font-sans);letter-spacing:-.025em;margin:0}.init-stage-heading p{color:var(--muted-foreground);margin:8px 0 0;font-size:12px;line-height:1.55}.init-scope-grid,.init-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;display:grid}.init-choice{border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--background));cursor:pointer;border-radius:6px;align-items:flex-start;gap:12px;min-height:125px;padding:18px;display:flex;position:relative}.init-choice:hover{border-color:var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.init-choice:hover{border-color:color-mix(in srgb,var(--compass-focus) 48%,var(--compass-line))}}.init-choice[data-selected=true]{border-color:var(--compass-focus);background:var(--compass-focus-soft);box-shadow:inset 0 0 0 1px var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.init-choice[data-selected=true]{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--compass-focus) 30%,transparent)}}.init-choice input{opacity:0;width:1px;height:1px;position:absolute}.init-choice:has(input:focus-visible){outline:2px solid var(--compass-focus);outline-offset:2px}.init-choice-radio{width:20px;height:20px;color:var(--compass-faint);flex:0 0 20px;place-items:center;display:grid}.init-choice-radio svg{fill:#0000;width:16px}.init-choice[data-selected=true] .init-choice-radio svg{fill:var(--compass-focus);color:var(--compass-focus);stroke-width:4px}.init-choice strong,.init-choice small{display:block}.init-choice strong{color:var(--foreground);margin:1px 0 8px;font-size:13px}.init-choice small{color:var(--muted-foreground);font-size:11px;line-height:1.55}.init-scope-browser{border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--background));border-radius:6px;margin-top:16px;overflow:hidden}.init-scope-browser>header{border-bottom:1px solid var(--compass-line);background:var(--compass-panel);justify-content:space-between;align-items:center;gap:16px;min-height:47px;padding:0 14px;display:flex}@supports (color:color-mix(in lab,red,red)){.init-scope-browser>header{background:color-mix(in srgb,var(--compass-panel) 84%,transparent)}}.init-scope-browser>header strong,.init-scope-browser>header small{display:block}.init-scope-browser>header strong{color:var(--foreground);margin-bottom:3px;font-size:11px}.init-scope-browser>header small{color:var(--compass-faint);font-size:9px}.init-scope-browser>header>span{border:1px solid var(--compass-focus);flex:none;padding:4px 7px}@supports (color:color-mix(in lab,red,red)){.init-scope-browser>header>span{border:1px solid color-mix(in srgb,var(--compass-focus) 45%,var(--compass-line))}}.init-scope-browser>header>span{background:var(--compass-focus-soft);color:var(--compass-focus);font:600 9px/1 var(--compass-font-mono);border-radius:999px}.init-scope-toolbar{border-bottom:1px solid var(--compass-line);align-items:center;gap:7px;height:35px;padding:0 10px;display:flex}.init-scope-toolbar>svg{width:13px;color:var(--compass-faint)}.init-scope-toolbar input{min-width:0;color:var(--foreground);font:10px/1.3 var(--compass-font-sans);background:0 0;border:0;outline:0;flex:1}.init-scope-toolbar input::placeholder{color:var(--vscode-input-placeholderForeground,var(--compass-faint))}.init-scope-toolbar:focus-within{box-shadow:inset 0 0 0 1px var(--compass-focus)}.init-scope-toolbar button,.init-scope-ledger button{width:22px;height:22px;color:var(--compass-faint);background:0 0;border:0;border-radius:3px;place-items:center;padding:0;display:grid}.init-scope-toolbar button:hover,.init-scope-ledger button:hover{background:var(--workbench-hover);color:var(--foreground)}.init-scope-toolbar button svg,.init-scope-ledger button svg{width:12px}.init-scope-body{grid-template-rows:minmax(0,1fr);grid-template-columns:minmax(0,1.45fr) minmax(180px,.8fr);height:clamp(230px,38vh,310px);min-height:0;display:grid;overflow:hidden}.init-scope-tree{overscroll-behavior:contain;border-right:1px solid var(--compass-line);scrollbar-gutter:stable;min-width:0;min-height:0;padding:6px 0;overflow:auto}.init-scope-tree:focus-visible{outline:2px solid var(--compass-focus);outline-offset:-2px}.init-scope-row{box-sizing:border-box;align-items:center;min-width:max-content;height:27px;padding-right:9px;display:flex}.init-scope-row:hover{background:var(--workbench-hover)}.init-scope-disclosure{width:20px;height:22px;color:var(--compass-faint);background:0 0;border:0;border-radius:3px;flex:0 0 20px;place-items:center;padding:0;display:grid}button.init-scope-disclosure:hover{color:var(--foreground)}.init-scope-disclosure svg{width:13px}.init-scope-row label{min-width:0;color:var(--muted-foreground);cursor:pointer;flex:1;align-items:center;gap:7px;font-size:10px;display:flex}.init-scope-row label input{width:13px;height:13px;accent-color:var(--compass-focus);margin:0}.init-scope-row label svg{width:13px;height:13px;color:var(--compass-focus)}.init-scope-row label span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.init-scope-ledger{overscroll-behavior:contain;background:var(--compass-panel);min-width:0;min-height:0;padding:10px;overflow:auto}@supports (color:color-mix(in lab,red,red)){.init-scope-ledger{background:color-mix(in srgb,var(--compass-panel) 73%,transparent)}}.init-scope-ledger{scrollbar-gutter:stable}.init-scope-ledger>div{padding:2px 3px 9px}.init-scope-ledger strong,.init-scope-ledger small{display:block}.init-scope-ledger strong{color:var(--foreground);margin-bottom:3px;font-size:10px}.init-scope-ledger small,.init-scope-ledger>p,.init-scope-empty,.init-scope-notice{color:var(--compass-faint);font-size:9px;line-height:1.45}.init-scope-ledger>p,.init-scope-empty{margin:8px 3px}.init-scope-ledger ul{margin:0;padding:0;list-style:none}.init-scope-ledger li{border-top:1px solid var(--compass-line);align-items:center;gap:5px;min-width:0;padding:4px 3px 4px 7px;display:flex}.init-scope-ledger code{min-width:0;color:var(--foreground);font:9px/1.4 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.init-scope-notice{border-top:1px solid var(--compass-line);background:var(--compass-warning);margin:0;padding:7px 12px}@supports (color:color-mix(in lab,red,red)){.init-scope-notice{background:color-mix(in srgb,var(--compass-warning) 7%,transparent)}}.init-scope-notice{color:var(--compass-warning)}.init-facts{border:1px solid var(--compass-line);border-radius:5px;grid-template-columns:1.5fr 1fr 1fr;margin:22px 0 0;display:grid;overflow:hidden}.init-facts>div{background:var(--compass-panel);min-width:0;padding:11px 13px}@supports (color:color-mix(in lab,red,red)){.init-facts>div{background:color-mix(in srgb,var(--compass-panel) 82%,transparent)}}.init-facts>div:not(:last-child){border-right:1px solid var(--compass-line)}.init-facts dt,.init-review-row>span{color:var(--compass-faint);font:9px/1.2 var(--compass-font-mono);text-transform:uppercase}.init-facts dt{margin-bottom:4px}.init-facts dd{min-width:0;color:var(--muted-foreground);text-overflow:ellipsis;white-space:nowrap;margin:0;font-size:10px;overflow:hidden}.init-facts code,.init-review-row code{font-family:var(--compass-font-mono)}.init-fields{gap:18px}.init-fields label>span{margin-bottom:9px;display:block}.init-fields label strong,.init-fields label small{display:block}.init-fields label strong{color:var(--foreground);margin-bottom:3px;font-size:12px}.init-fields label small{color:var(--compass-faint);font-size:10px}.init-fields textarea{box-sizing:border-box;resize:vertical;border:1px solid var(--vscode-input-border,var(--compass-line));background:var(--vscode-input-background,var(--background));width:100%;min-height:142px;color:var(--vscode-input-foreground,var(--foreground));font:11px/1.6 var(--compass-font-mono);border-radius:4px;outline:none;padding:11px 12px}.init-fields textarea::placeholder{color:var(--vscode-input-placeholderForeground,var(--compass-faint))}.init-fields textarea:focus{border-color:var(--compass-focus);outline:1px solid var(--compass-focus)}.init-fields textarea:disabled{opacity:.55;cursor:not-allowed}.init-validation{color:var(--destructive);margin:12px 0 0;font-size:11px}.init-stage-actions{justify-content:space-between;align-items:center;gap:10px;margin-top:auto;padding-top:30px;display:flex}.init-button{min-height:32px;font:500 12px/1.3 var(--compass-font-sans);border:1px solid #0000;border-radius:3px;justify-content:center;align-items:center;gap:8px;padding:6px 13px;display:inline-flex}.init-button svg{width:14px;height:14px}.init-button:focus-visible{outline:2px solid var(--compass-focus);outline-offset:2px}.init-button:disabled{opacity:.45;cursor:not-allowed}.init-button-primary{border-color:var(--vscode-button-border,transparent);background:var(--vscode-button-background,var(--primary));color:var(--vscode-button-foreground,var(--primary-foreground))}.init-button-primary:not(:disabled):hover{background:var(--vscode-button-hoverBackground,var(--primary))}.init-button-secondary{border-color:var(--compass-line);background:var(--vscode-button-secondaryBackground,var(--secondary));color:var(--vscode-button-secondaryForeground,var(--secondary-foreground))}.init-button-secondary:not(:disabled):hover,.init-button-quiet:hover{border-color:var(--compass-line-strong);background:var(--workbench-hover);color:var(--foreground)}.init-button-quiet{color:var(--muted-foreground);background:0 0}.init-button-build{min-width:170px}.init-review{border:1px solid var(--compass-line);border-radius:5px;overflow:hidden}.init-review-row{border-bottom:1px solid var(--compass-line);grid-template-columns:130px minmax(0,1fr);align-items:start;min-height:42px;display:grid}.init-review-row:last-child{border-bottom:0}.init-review-row>span{background:var(--compass-panel);align-self:stretch;padding:12px 13px}@supports (color:color-mix(in lab,red,red)){.init-review-row>span{background:color-mix(in srgb,var(--compass-panel) 76%,transparent)}}.init-review-row>div{min-width:0;color:var(--foreground);padding:11px 13px;font-size:11px}.init-review-row code{overflow-wrap:anywhere;color:var(--foreground)}.init-rule-default{color:var(--muted-foreground)}.init-rule-list{flex-wrap:wrap;gap:6px;display:flex}.init-rule-list li{border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--background));border-radius:3px;padding:3px 7px}.init-build-callout{border-left:2px solid var(--compass-focus);background:var(--compass-focus-soft);align-items:flex-start;gap:12px;margin-top:16px;padding:13px 15px;display:flex}.init-build-callout>svg{width:17px;color:var(--compass-focus);flex:0 0 17px}.init-build-callout strong{color:var(--foreground);margin-bottom:3px;font-size:11px;display:block}.init-build-callout p{color:var(--muted-foreground);margin:0;font-size:10px;line-height:1.45}.init-replace-confirmation{border:1px solid var(--compass-warning);align-items:flex-start;gap:10px;margin-top:10px;padding:12px 14px;display:flex}@supports (color:color-mix(in lab,red,red)){.init-replace-confirmation{border:1px solid color-mix(in srgb,var(--compass-warning) 55%,var(--compass-line))}}.init-replace-confirmation{background:var(--compass-warning);border-radius:4px}@supports (color:color-mix(in lab,red,red)){.init-replace-confirmation{background:color-mix(in srgb,var(--compass-warning) 8%,transparent)}}.init-replace-confirmation{cursor:pointer}.init-replace-confirmation input{accent-color:var(--compass-focus);margin:2px 0 0}.init-replace-confirmation strong,.init-replace-confirmation small{display:block}.init-replace-confirmation strong{color:var(--compass-warning);margin-bottom:3px;font-size:11px}.init-replace-confirmation small{color:var(--muted-foreground);font-size:10px;line-height:1.45}.init-progress-shell{flex-direction:column;display:flex}.init-progress-header{align-items:center}.init-running-badge{border:1px solid var(--compass-focus);align-items:center;gap:7px;padding:6px 10px;display:inline-flex}@supports (color:color-mix(in lab,red,red)){.init-running-badge{border:1px solid color-mix(in srgb,var(--compass-focus) 46%,var(--compass-line))}}.init-running-badge{background:var(--compass-focus-soft);color:var(--compass-focus);font:600 10px/1 var(--compass-font-mono);text-transform:uppercase;border-radius:999px}.init-running-badge svg,.init-runway li[data-state=active] .init-runway-marker svg{animation:1.2s linear infinite init-spin}.init-progress-card{box-sizing:border-box;border:1px solid var(--compass-line-strong);background:var(--vscode-editorWidget-background,var(--compass-panel));width:min(880px,100%);box-shadow:0 22px 55px var(--vscode-widget-shadow,#0000003d);border-radius:7px;margin:auto;padding:clamp(26px,5vw,48px)}.init-progress-summary{justify-content:space-between;align-items:flex-end;gap:20px;display:flex}.init-progress-summary small,.init-progress-summary strong{display:block}.init-progress-summary small{color:var(--compass-faint);font:10px/1.2 var(--compass-font-mono);letter-spacing:.08em;text-transform:uppercase;margin-bottom:7px}.init-progress-summary strong{color:var(--foreground);font-size:18px;font-weight:580}.init-progress-summary>span{color:var(--compass-focus);font:600 24px/1 var(--compass-font-mono)}.init-progress-track{background:var(--foreground);border-radius:99px;height:7px;margin:18px 0 22px;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.init-progress-track{background:color-mix(in srgb,var(--foreground) 10%,transparent)}}.init-progress-track>span{border-radius:inherit;background:var(--workbench-progress);height:100%;box-shadow:0 0 15px var(--compass-focus);display:block}@supports (color:color-mix(in lab,red,red)){.init-progress-track>span{box-shadow:0 0 15px color-mix(in srgb,var(--compass-focus) 50%,transparent)}}.init-progress-track>span{transition:width .18s ease-out}.init-progress-track>span.is-indeterminate{width:28%;animation:1.35s ease-in-out infinite init-indeterminate}.init-current-file{border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--compass-canvas));border-radius:5px;align-items:center;gap:12px;min-width:0;padding:13px 15px;display:flex}.init-current-file>svg{width:16px;color:var(--compass-focus);flex:0 0 16px}.init-current-file span{min-width:0}.init-current-file small,.init-current-file code{display:block}.init-current-file small{color:var(--compass-faint);font:9px/1 var(--compass-font-mono);text-transform:uppercase;margin-bottom:4px}.init-current-file code{color:var(--foreground);font:11px/1.4 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.init-runway{grid-template-columns:repeat(3,minmax(0,1fr));margin-top:30px;display:grid}.init-runway li{align-items:flex-start;gap:10px;display:flex;position:relative}.init-runway li:not(:last-child):after{background:var(--compass-line);content:"";height:1px;position:absolute;top:13px;left:27px;right:8px}.init-runway li[data-state=complete]:after{background:var(--compass-success)}@supports (color:color-mix(in lab,red,red)){.init-runway li[data-state=complete]:after{background:color-mix(in srgb,var(--compass-success) 58%,var(--compass-line))}}.init-runway-marker{z-index:1;border:1px solid var(--compass-line-strong);background:var(--compass-panel);width:26px;height:26px;color:var(--compass-faint);border-radius:50%;flex:0 0 26px;place-items:center;display:grid}.init-runway-marker svg{width:12px;height:12px}.init-runway li[data-state=complete] .init-runway-marker{border-color:var(--compass-success);color:var(--compass-success)}.init-runway li[data-state=active] .init-runway-marker{border-color:var(--compass-focus);color:var(--compass-focus);box-shadow:0 0 0 4px var(--compass-focus-soft)}.init-runway li>span:last-child{min-width:0;padding-right:20px}.init-runway strong,.init-runway small{display:block}.init-runway strong{color:var(--foreground);margin:1px 0 4px;font-size:10px}.init-runway small{color:var(--compass-faint);font-size:9px;line-height:1.35}.init-progress-footer{box-sizing:border-box;justify-content:space-between;align-items:center;gap:20px;width:min(880px,100%);margin:22px auto 0;display:flex}.init-progress-footer p{color:var(--compass-faint);margin:0;font-size:10px}.init-result-shell{place-items:center;display:grid}.init-result-card{box-sizing:border-box;border:1px solid var(--compass-line-strong);background:var(--vscode-editorWidget-background,var(--compass-panel));width:min(580px,100%);box-shadow:0 22px 55px var(--vscode-widget-shadow,#0000003d);text-align:center;border-radius:7px;padding:clamp(32px,6vw,60px)}.init-result-icon{border:1px solid;border-radius:50%;place-items:center;width:54px;height:54px;margin:0 auto 22px;display:grid}.init-result-icon svg{width:24px}.init-result-icon-success{border-color:var(--compass-success);background:var(--compass-success)}@supports (color:color-mix(in lab,red,red)){.init-result-icon-success{background:color-mix(in srgb,var(--compass-success) 10%,transparent)}}.init-result-icon-success{color:var(--compass-success)}.init-result-icon-error{border-color:var(--destructive);background:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.init-result-icon-error{background:color-mix(in srgb,var(--destructive) 10%,transparent)}}.init-result-icon-error{color:var(--destructive)}.init-result-icon-cancelled{border-color:var(--compass-warning);background:var(--compass-warning)}@supports (color:color-mix(in lab,red,red)){.init-result-icon-cancelled{background:color-mix(in srgb,var(--compass-warning) 10%,transparent)}}.init-result-icon-cancelled{color:var(--compass-warning)}.init-result-card .init-eyebrow{text-align:center}.init-result-card>p:not(.init-eyebrow){margin-left:auto;margin-right:auto}.init-result-actions{flex-wrap:wrap;justify-content:center;gap:9px;margin-top:26px;display:flex}@keyframes init-spin{to{transform:rotate(360deg)}}@keyframes init-indeterminate{0%{transform:translate(-120%)}55%{transform:translate(180%)}to{transform:translate(320%)}}@media(max-width:760px){.init-shell{padding:24px 18px}.init-header,.init-progress-header{flex-direction:column;align-items:flex-start}.init-repository-badge{box-sizing:border-box;width:100%}.init-layout{grid-template-columns:1fr}.init-step-nav{border-right:0;border-bottom:1px solid var(--compass-line);padding:16px}.init-step-nav ol{grid-template-columns:repeat(3,1fr);display:grid}.init-step-nav li{padding:0}.init-step-nav li:not(:last-child):after{width:auto;height:1px;inset:22px -8px auto 37px}.init-step-nav button{flex-direction:column;align-items:flex-start}.init-step-nav button strong{font-size:10px}.init-local-note{display:none}.init-scope-grid,.init-fields{grid-template-columns:1fr}.init-scope-browser>header{flex-direction:column;align-items:flex-start;gap:8px;padding-block:10px}.init-scope-body{grid-template-rows:auto auto;grid-template-columns:1fr;height:auto;max-height:none;overflow:visible}.init-scope-tree{border-right:0;border-bottom:1px solid var(--compass-line);height:clamp(210px,42vh,300px);min-height:210px;max-height:none}.init-scope-ledger{max-height:150px}.init-facts{grid-template-columns:1fr}.init-facts>div:not(:last-child){border-right:0;border-bottom:1px solid var(--compass-line)}.init-review-row{grid-template-columns:95px minmax(0,1fr)}.init-runway{grid-template-columns:1fr;gap:13px}.init-runway li:not(:last-child):after{width:1px;height:auto;inset:26px auto -13px 13px}.init-progress-footer{flex-direction:column;align-items:flex-start}}@media(prefers-reduced-motion:reduce){.init-running-badge svg,.init-runway li[data-state=active] .init-runway-marker svg,.init-progress-track>span.is-indeterminate{animation:none}.init-progress-track>span{transition:none}}:root{color-scheme:light dark;--compass-font-sans:var(--vscode-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);--compass-font-mono:var(--vscode-editor-font-family,"SFMono-Regular", Consolas, monospace);--background:var(--vscode-editor-background,#0d131d);--foreground:var(--vscode-editor-foreground,#d7e1ed);--card:var(--vscode-sideBar-background,#121b28);--card-foreground:var(--vscode-sideBar-foreground,#d7e1ed);--popover:var(--vscode-menu-background,#172231);--popover-foreground:var(--vscode-menu-foreground,#d7e1ed);--primary:var(--vscode-button-background,#2f81f7);--primary-foreground:var(--vscode-button-foreground,#fff);--secondary:var(--vscode-button-secondaryBackground,#263448);--secondary-foreground:var(--vscode-button-secondaryForeground,#d7e1ed);--muted:var(--vscode-list-inactiveSelectionBackground,#1d2938);--muted-foreground:var(--vscode-descriptionForeground,#93a4b8);--accent:var(--vscode-list-activeSelectionBackground,#264f78);--accent-foreground:var(--vscode-list-activeSelectionForeground,#fff);--destructive:var(--vscode-errorForeground,#f47067);--border:var(--vscode-panel-border,#2c3a4d);--input:var(--vscode-input-border,#3b4a5e);--ring:var(--vscode-focusBorder,#4f9cf9);--radius:.625rem;--compass-canvas:var(--vscode-editor-background,#08111f);--compass-canvas-deep:var(--compass-canvas)}@supports (color:color-mix(in lab,red,red)){:root{--compass-canvas-deep:color-mix(in srgb, var(--compass-canvas) 82%, #000)}}:root{--compass-panel:var(--vscode-sideBar-background,#101b2d);--compass-panel-raised:var(--vscode-menu-background,#142236)}@supports (color:color-mix(in lab,red,red)){:root{--compass-panel-raised:color-mix(in srgb, var(--vscode-menu-background,#142236) 88%, transparent)}}:root{--compass-line:var(--vscode-panel-border,#9ab2d329);--compass-line-strong:var(--vscode-contrastBorder,#9ab2d34d);--compass-focus:var(--vscode-focusBorder,#76b7ff);--compass-focus-soft:var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){:root{--compass-focus-soft:color-mix(in srgb, var(--compass-focus) 14%, transparent)}}:root{--compass-faint:var(--vscode-disabledForeground,#60728b);--compass-grid:var(--foreground)}@supports (color:color-mix(in lab,red,red)){:root{--compass-grid:color-mix(in srgb, var(--foreground) 16%, transparent)}}:root{--compass-success:var(--vscode-testing-iconPassed,#3fb950);--compass-warning:var(--vscode-editorWarning-foreground,#d29922);--sidebar:var(--vscode-sideBar-background,var(--background));--sidebar-foreground:var(--vscode-sideBar-foreground,var(--foreground));--sidebar-accent:var(--vscode-list-activeSelectionBackground,var(--accent));--sidebar-accent-foreground:var(--vscode-list-activeSelectionForeground,var(--accent-foreground));--sidebar-primary:var(--vscode-focusBorder,var(--ring));--workbench-hover:var(--vscode-list-hoverBackground,var(--foreground))}@supports (color:color-mix(in lab,red,red)){:root{--workbench-hover:var(--vscode-list-hoverBackground,color-mix(in srgb, var(--foreground) 7%, transparent))}}:root{--workbench-hover-foreground:var(--vscode-list-hoverForeground,var(--foreground));--workbench-table-header:var(--vscode-editorStickyScroll-background,var(--background));--workbench-link:var(--vscode-textLink-foreground,var(--ring));--workbench-progress:var(--vscode-progressBar-background,var(--ring))}@media(prefers-color-scheme:light){:root{--background:var(--vscode-editor-background,#f7f9fc);--foreground:var(--vscode-editor-foreground,#172033);--card:var(--vscode-sideBar-background,#fff);--card-foreground:var(--vscode-sideBar-foreground,#172033);--popover:var(--vscode-menu-background,#fff);--popover-foreground:var(--vscode-menu-foreground,#172033);--primary:var(--vscode-button-background,#0969da);--primary-foreground:var(--vscode-button-foreground,#fff);--secondary:var(--vscode-button-secondaryBackground,#e8edf4);--secondary-foreground:var(--vscode-button-secondaryForeground,#172033);--muted:var(--vscode-list-inactiveSelectionBackground,#edf1f6);--muted-foreground:var(--vscode-descriptionForeground,#576579);--accent:var(--vscode-list-activeSelectionBackground,#dbeafe);--accent-foreground:var(--vscode-list-activeSelectionForeground,#172033);--border:var(--vscode-panel-border,#c8d1dc);--input:var(--vscode-input-border,#aeb9c8);--ring:var(--vscode-focusBorder,#0969da);--compass-canvas:var(--vscode-editor-background,#f4f7fb);--compass-canvas-deep:var(--compass-canvas)}@supports (color:color-mix(in lab,red,red)){:root{--compass-canvas-deep:color-mix(in srgb, var(--compass-canvas) 94%, #dbe3ed)}}:root{--compass-panel:var(--vscode-sideBar-background,#fff);--compass-panel-raised:var(--vscode-menu-background,#fff);--compass-line:var(--vscode-panel-border,#ccd6e1);--compass-line-strong:var(--vscode-contrastBorder,#9eacbd);--compass-faint:var(--vscode-disabledForeground,#68778a)}}body.vscode-light,body.vscode-high-contrast-light{color-scheme:light}body.vscode-dark,body.vscode-high-contrast{color-scheme:dark}.compass-source-notice{z-index:100;border:1px solid var(--compass-warning);max-width:min(420px,100vw - 32px);padding:12px 14px;position:fixed;bottom:16px;right:16px}@supports (color:color-mix(in lab,red,red)){.compass-source-notice{border:1px solid color-mix(in srgb,var(--compass-warning) 55%,var(--compass-line))}}.compass-source-notice{background:var(--compass-panel);border-radius:6px}@supports (color:color-mix(in lab,red,red)){.compass-source-notice{background:color-mix(in srgb,var(--compass-panel) 96%,transparent)}}.compass-source-notice{color:var(--foreground);font-size:13px;line-height:1.45;box-shadow:0 12px 32px #00000047}.visualization-workbench{background:var(--background);grid-template-columns:minmax(220px,268px) minmax(0,1fr);width:100vw;height:100vh;display:grid;overflow:hidden}.visualization-workbench[data-navigation-collapsed=true]{grid-template-columns:48px minmax(0,1fr)}.visualization-rail{border-right:1px solid var(--compass-line);background:linear-gradient(180deg,var(--compass-focus-soft),transparent 180px),var(--compass-panel);grid-template-rows:auto minmax(0,1fr) auto;min-width:0;display:grid}.visualization-rail>header{border-bottom:1px solid var(--compass-line);grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:11px;padding:18px 16px 16px;display:grid}.visualization-rail-disclosure{width:30px;height:30px;color:var(--muted-foreground);background:0 0;border:1px solid #0000;border-radius:3px;place-items:center;display:grid}.visualization-rail-disclosure:hover{border-color:var(--compass-line);background:var(--workbench-hover);color:var(--foreground)}.visualization-rail-disclosure svg{width:16px;height:16px}.visualization-rail[data-collapsed=true]>header{flex-direction:column;gap:9px;padding:12px 7px 10px;display:flex}.visualization-rail[data-collapsed=true]>header>span:nth-child(2),.visualization-rail[data-collapsed=true] nav button>span,.visualization-rail[data-collapsed=true] nav i,.visualization-rail[data-collapsed=true]>footer{display:none}.visualization-rail[data-collapsed=true] .visualization-bearing{width:30px;height:30px}.visualization-rail[data-collapsed=true] nav button{grid-template-columns:1fr;place-items:center;padding-inline:5px}.visualization-bearing{border:1px solid var(--compass-focus);place-items:center;width:34px;height:34px;display:grid}@supports (color:color-mix(in lab,red,red)){.visualization-bearing{border:1px solid color-mix(in srgb,var(--compass-focus) 48%,var(--border))}}.visualization-bearing{background:var(--compass-focus);border-radius:50%}@supports (color:color-mix(in lab,red,red)){.visualization-bearing{background:color-mix(in srgb,var(--compass-focus) 12%,transparent)}}.visualization-bearing{color:var(--compass-focus);box-shadow:inset 0 0 0 4px var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.visualization-bearing{box-shadow:inset 0 0 0 4px color-mix(in srgb,var(--compass-focus) 5%,transparent)}}.visualization-bearing svg{width:18px;height:18px}.visualization-rail header>span:nth-child(2),.visualization-rail nav button>span{gap:2px;min-width:0;display:grid}.visualization-rail header strong{letter-spacing:.02em;font-size:14px}.visualization-rail header small,.visualization-rail nav small{color:var(--muted-foreground);text-overflow:ellipsis;white-space:nowrap;font-size:10px;overflow:hidden}.visualization-rail nav{flex-direction:column;gap:3px;min-height:0;padding:10px 8px;display:flex;overflow:auto}.visualization-rail nav button{min-width:0;color:var(--foreground);text-align:left;background:0 0;border:1px solid #0000;border-radius:5px;grid-template-columns:24px minmax(0,1fr) 8px;align-items:center;gap:9px;padding:9px 8px;display:grid;position:relative}.visualization-rail nav button:hover{background:var(--workbench-hover)}.visualization-rail nav button[aria-current=page]{border-color:var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.visualization-rail nav button[aria-current=page]{border-color:color-mix(in srgb,var(--compass-focus) 28%,var(--border))}}.visualization-rail nav button[aria-current=page]{background:var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.visualization-rail nav button[aria-current=page]{background:color-mix(in srgb,var(--compass-focus) 13%,var(--compass-panel))}}.visualization-rail nav button[aria-current=page]{box-shadow:inset 2px 0 var(--compass-focus)}.visualization-rail nav svg{width:16px;height:16px;color:var(--muted-foreground)}.visualization-rail nav button[aria-current=page] svg{color:var(--compass-focus)}.visualization-rail nav strong{text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:600;overflow:hidden}.visualization-rail nav i{background:var(--compass-success);border-radius:50%;width:6px;height:6px}.visualization-rail nav i[data-status=summary]{background:var(--compass-warning)}.visualization-rail nav i[data-status=partial]{background:var(--destructive)}.visualization-rail>footer{border-top:1px solid var(--compass-line);color:var(--muted-foreground);justify-content:space-between;align-items:center;gap:10px;padding:11px 14px;font-size:10px;display:flex}.visualization-rail>footer code{color:var(--foreground);font-family:var(--compass-font-mono)}.visualization-main{grid-template-rows:49px minmax(0,1fr);min-width:0;min-height:0;display:grid}.visualization-context{border-bottom:1px solid var(--compass-line);background:var(--background);justify-content:space-between;align-items:center;gap:20px;min-width:0;padding:7px 14px 7px 16px;display:flex}@supports (color:color-mix(in lab,red,red)){.visualization-context{background:color-mix(in srgb,var(--background) 92%,var(--compass-panel))}}.visualization-context>div:first-child{gap:1px;min-width:0;display:grid}.visualization-context>div:first-child span{color:var(--muted-foreground);letter-spacing:.1em;text-transform:uppercase;font-size:9px;font-weight:650}.visualization-context>div:first-child strong{text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.visualization-coverage{color:var(--muted-foreground);align-items:center;gap:10px;font-size:10px;display:flex}.visualization-coverage strong{border:1px solid var(--compass-success);padding:3px 7px}@supports (color:color-mix(in lab,red,red)){.visualization-coverage strong{border:1px solid color-mix(in srgb,var(--compass-success) 36%,var(--border))}}.visualization-coverage strong{color:var(--compass-success);border-radius:999px;font-weight:600}.visualization-coverage[data-status=summary] strong{border-color:var(--compass-warning)}@supports (color:color-mix(in lab,red,red)){.visualization-coverage[data-status=summary] strong{border-color:color-mix(in srgb,var(--compass-warning) 42%,var(--border))}}.visualization-coverage[data-status=summary] strong{color:var(--compass-warning)}.visualization-coverage[data-status=partial] strong{border-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.visualization-coverage[data-status=partial] strong{border-color:color-mix(in srgb,var(--destructive) 42%,var(--border))}}.visualization-coverage[data-status=partial] strong{color:var(--destructive)}.visualization-stage,.workbench-graph-lens,.workbench-history-view,.workbench-architecture{min-width:0;height:100%;min-height:0}.workbench-architecture{grid-template-rows:39px minmax(0,1fr);display:grid}.workbench-graph-lens{position:relative}.workbench-graph-lens>.compass-workspace,.workbench-history-view .compass-workspace{height:100%;min-height:0}.visualization-stage .call-graph-view{height:100%}.visualization-stage .call-graph-direction{top:58px}.visualization-stage .call-graph-summary{max-height:min(42%,360px);overflow:auto}.workbench-filter-strip{border-bottom:1px solid var(--compass-line);background:var(--compass-panel);align-items:center;gap:7px;min-width:0;padding:5px 9px;display:flex;overflow-x:auto}.workbench-filter-strip label{color:var(--muted-foreground);white-space:nowrap;align-items:center;gap:5px;font-size:9px;display:flex}.workbench-filter-strip select{border:1px solid var(--input);background:var(--background);max-width:160px;height:27px;color:var(--foreground);font:inherit;border-radius:3px;padding:2px 22px 2px 7px;font-size:10px}.workbench-filter-strip>span{color:var(--muted-foreground);white-space:nowrap;margin-left:auto;font-size:9px}.compass-toolbar-leading{flex:none;align-items:center;min-width:0;display:flex}.workbench-filter-trigger{border:1px solid var(--compass-line);background:var(--vscode-dropdown-background,transparent);min-height:30px;color:var(--muted-foreground);cursor:pointer;font:inherit;white-space:nowrap;border-radius:3px;align-items:center;gap:6px;padding:0 8px;display:flex}.workbench-filter-trigger:hover,.workbench-filter-trigger[aria-expanded=true]{background:var(--workbench-hover);color:var(--foreground)}.workbench-filter-trigger:focus-visible{outline:2px solid var(--compass-focus);outline-offset:2px}.workbench-filter-trigger svg{width:15px;height:15px}.workbench-filter-trigger b{background:var(--compass-focus);min-width:17px;height:17px;color:var(--vscode-button-foreground,#fff);font:9px/1 var(--compass-font-mono);border-radius:9px;place-items:center;display:inline-grid}.workbench-filter-trigger small{color:var(--compass-faint);font:9px/1 var(--compass-font-mono)}.workbench-filter-popover{z-index:12;box-sizing:border-box;border:1px solid var(--compass-line-strong);background:var(--vscode-editorWidget-background,var(--compass-panel));width:min(310px,100%);max-height:calc(100vh - 84px);box-shadow:none;border-radius:5px;gap:10px;padding:12px;display:grid;position:absolute;top:calc(100% + 8px);right:6px;overflow-y:auto}.workbench-filter-popover>header{border-bottom:1px solid var(--compass-line);justify-content:space-between;align-items:flex-start;gap:12px;padding-bottom:9px;display:flex}.workbench-filter-popover>header span{gap:2px;display:grid}.workbench-filter-popover>header strong{font-size:11px}.workbench-filter-popover>header small,.workbench-filter-popover>footer{color:var(--compass-faint);font-size:10px}.workbench-filter-popover>header button{border:1px solid var(--compass-line);min-height:26px;color:var(--muted-foreground);white-space:nowrap;background:0 0;border-radius:3px;padding:0 7px;font-size:10px}.workbench-filter-popover>header button:disabled{opacity:.45}.workbench-filter-popover>label{color:var(--muted-foreground);grid-template-columns:88px minmax(0,1fr);align-items:center;gap:9px;font-size:10px;display:grid}.workbench-filter-popover select{border:1px solid var(--input);background:var(--vscode-dropdown-background,var(--background));width:100%;min-height:30px;color:var(--vscode-dropdown-foreground,var(--foreground));font:inherit;border-radius:3px;padding:2px 24px 2px 8px}.workbench-filter-popover select:focus-visible,.workbench-filter-popover button:focus-visible{outline:2px solid var(--compass-focus);outline-offset:2px}.workbench-filter-popover>footer{border-top:1px solid var(--compass-line);padding-top:8px}.workbench-graph-empty{z-index:3;box-sizing:border-box;border:1px solid var(--compass-line);background:var(--vscode-editorWidget-background,var(--compass-panel));width:min(360px,100% - 32px);color:var(--muted-foreground);text-align:center;border-radius:5px;justify-items:center;gap:7px;padding:18px;display:grid;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.workbench-graph-empty svg{width:24px;height:24px;color:var(--compass-faint);margin-bottom:3px}.workbench-graph-empty strong{color:var(--foreground);font-size:12px}.workbench-graph-empty span{max-width:290px;font-size:11px;line-height:1.45}.workbench-graph-empty button{border:1px solid var(--compass-line-strong);background:var(--vscode-button-background,var(--compass-focus));min-height:30px;color:var(--vscode-button-foreground,#fff);font:inherit;border-radius:3px;margin-top:5px;padding:0 10px;font-size:10px}.workbench-graph-empty button:hover{background:var(--vscode-button-hoverBackground,var(--compass-focus))}.workbench-graph-empty button:focus-visible{outline:2px solid var(--compass-focus);outline-offset:2px}.workbench-history-view{position:relative}.workbench-history-banner{z-index:24;border:1px solid var(--compass-line-strong);background:var(--compass-panel-raised);border-radius:5px;align-items:center;gap:9px;padding:8px 11px;display:flex;position:absolute;top:10px;left:50%;transform:translate(-50%);box-shadow:0 10px 28px #0000002e}.workbench-history-banner svg{width:17px;color:var(--compass-focus)}.workbench-history-banner span{gap:1px;display:grid}.workbench-history-banner strong{font-size:11px}.workbench-history-banner small{color:var(--muted-foreground);font-size:9px}.workbench-architecture-body{grid-template-columns:minmax(0,1fr) minmax(240px,310px);min-width:0;min-height:0;display:grid}.workbench-architecture-body>.architecture-map-panel{border:0;border-radius:0;min-width:0;height:100%;min-height:0}.workbench-architecture-body>aside{border-left:1px solid var(--compass-line);background:var(--compass-panel);min-width:0;padding:16px;overflow:auto}.workbench-architecture-body>aside>span{color:var(--muted-foreground);letter-spacing:.09em;text-transform:uppercase;font-size:9px;font-weight:650}.workbench-architecture-body>aside h2{margin:5px 0;font-size:15px}.workbench-architecture-body>aside p{color:var(--muted-foreground);font-size:10px;line-height:1.5}.workbench-symbol-list{gap:2px;margin-top:12px;display:grid}.workbench-symbol-list button{min-width:0;color:var(--foreground);text-align:left;background:0 0;border:1px solid #0000;border-radius:3px;gap:2px;padding:7px;display:grid}.workbench-symbol-list button:hover:not(:disabled){border-color:var(--border);background:var(--workbench-hover)}.workbench-symbol-list button:disabled{cursor:default}.workbench-symbol-list strong,.workbench-symbol-list small{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.workbench-symbol-list strong{font-size:10px}.workbench-symbol-list small{color:var(--muted-foreground);font-size:9px}.visualization-workbench button:focus-visible,.visualization-workbench select:focus-visible{outline:1px solid var(--compass-focus);outline-offset:1px}@media(max-width:760px){.visualization-workbench{grid-template-columns:58px minmax(0,1fr)}.visualization-rail>header{flex-direction:column;justify-content:center;gap:9px;padding-inline:8px;display:flex}.visualization-rail header>span:nth-child(2),.visualization-rail nav button>span,.visualization-rail nav i,.visualization-rail>footer{display:none}.visualization-rail nav button{grid-template-columns:1fr;place-items:center;display:grid}.visualization-coverage>span{display:none}.workbench-architecture-body{grid-template-columns:minmax(0,1fr)}.workbench-architecture-body>aside{display:none}}@media(prefers-reduced-motion:no-preference){.visualization-rail nav button[aria-current=page]{animation:.18s ease-out compass-bearing}}@keyframes compass-bearing{0%{opacity:.7;transform:translate(-3px)}to{opacity:1;transform:translate(0)}}*{border-color:var(--border)}html,body,#root,#compass-viewer-root{min-height:100%;margin:0}body{background:var(--background);color:var(--foreground);font-family:var(--compass-font-sans);overflow:hidden}button:not(:disabled),[role=button]:not(:disabled){cursor:pointer}[data-slot=button],[data-slot=input],[data-slot=tabs-list],[data-slot=tabs-trigger]{border-radius:4px}.workbench-collection-toolbar{justify-content:space-between;align-items:center;gap:10px;min-width:0;display:flex}.workbench-search{flex:1;align-items:center;min-width:180px;max-width:540px;display:flex;position:relative}.workbench-search>svg{width:14px;height:14px;color:var(--vscode-input-placeholderForeground,var(--muted-foreground));pointer-events:none;position:absolute;left:8px}.workbench-search input{border:1px solid var(--vscode-input-border,var(--border));background:var(--vscode-input-background,var(--input));width:100%;height:30px;color:var(--vscode-input-foreground,var(--foreground));font:inherit;border-radius:3px;outline:none;padding:4px 30px 4px 29px;font-size:12px}.workbench-search input::placeholder{color:var(--vscode-input-placeholderForeground,var(--muted-foreground))}.workbench-search input:focus-visible{border-color:var(--ring);outline:1px solid var(--ring);outline-offset:-1px}.workbench-search-clear{width:24px;height:24px;color:var(--muted-foreground);background:0 0;border:0;border-radius:3px;place-items:center;display:grid;position:absolute;right:3px}.workbench-search-clear:hover{background:var(--workbench-hover);color:var(--workbench-hover-foreground)}.workbench-search-clear svg{width:13px;height:13px}.workbench-result-count,.workbench-pagination-range{color:var(--muted-foreground);white-space:nowrap;font-size:11px}.workbench-pagination{justify-content:space-between;align-items:center;gap:12px;min-height:36px;padding-top:8px;display:flex}.workbench-pagination-actions{color:var(--muted-foreground);align-items:center;gap:4px;font-size:11px;display:flex}.workbench-pagination-actions button{width:26px;height:26px;color:var(--foreground);background:0 0;border:1px solid #0000;border-radius:3px;place-items:center;display:grid}.workbench-pagination-actions button:hover:not(:disabled){border-color:var(--border);background:var(--workbench-hover)}.workbench-pagination-actions button:disabled{color:var(--vscode-disabledForeground,var(--compass-faint))}.workbench-pagination-actions svg{width:14px;height:14px}.workbench-state{width:min(520px,100% - 32px);min-height:180px;color:var(--muted-foreground);text-align:center;align-content:center;place-items:center;gap:12px;margin:auto;padding:24px;display:grid}.workbench-state>svg{width:28px;height:28px}.workbench-state[data-kind=error]>svg{color:var(--destructive)}.workbench-state h2{color:var(--foreground);margin:0;font-size:14px;font-weight:600}.workbench-state p{margin:5px 0 0;font-size:12px;line-height:1.55}.workbench-button{border:1px solid var(--vscode-button-border,transparent);background:var(--vscode-button-background,var(--primary));min-height:30px;color:var(--vscode-button-foreground,var(--primary-foreground));font:inherit;border-radius:3px;padding:4px 11px;font-size:12px}.workbench-button:hover{background:var(--vscode-button-hoverBackground,var(--primary))}.workbench-button:focus-visible,.workbench-search-clear:focus-visible,.workbench-pagination-actions button:focus-visible{outline:2px solid var(--ring);outline-offset:1px}.workbench-state-spinner{animation:1s linear infinite spin}.compass-load-shell{background:radial-gradient(circle at 50% 43%,var(--compass-focus),transparent 28%),radial-gradient(circle at 68% 62%,var(--compass-success),transparent 24%),linear-gradient(145deg,var(--compass-canvas) 0%,var(--compass-canvas-deep) 100%);place-content:center;min-height:100vh;padding:40px 24px;display:grid;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.compass-load-shell{background:radial-gradient(circle at 50% 43%,color-mix(in srgb,var(--compass-focus) 16%,transparent),transparent 28%),radial-gradient(circle at 68% 62%,color-mix(in srgb,var(--compass-success) 8%,transparent),transparent 24%),linear-gradient(145deg,var(--compass-canvas) 0%,var(--compass-canvas-deep) 100%)}}.compass-load-shell{text-align:center}.compass-load-shell:before{content:"";opacity:.18;background-image:radial-gradient(var(--compass-grid) .65px,transparent .65px);pointer-events:none;background-size:24px 24px;position:absolute;inset:0}.compass-load-visual{place-items:start center;width:92px;height:88px;margin:0 auto;display:grid;position:relative}.compass-load-mark{width:58px;height:58px;color:var(--compass-focus);place-items:center;display:grid;position:relative}.compass-load-logo{filter:drop-shadow(0 10px 22px);width:54px;height:54px}@supports (color:color-mix(in lab,red,red)){.compass-load-logo{filter:drop-shadow(0 10px 22px color-mix(in srgb,currentColor 24%,transparent))}}.compass-load-logo{transform-origin:50%;animation:2.4s ease-in-out infinite compass-load-logo-breathe}.compass-load-visual[data-state=error] .compass-load-mark{border:1px solid var(--destructive);width:48px;height:48px}@supports (color:color-mix(in lab,red,red)){.compass-load-visual[data-state=error] .compass-load-mark{border:1px solid color-mix(in srgb,var(--destructive) 66%,var(--compass-line))}}.compass-load-visual[data-state=error] .compass-load-mark{color:var(--destructive);box-shadow:0 18px 48px var(--destructive);border-radius:12px}@supports (color:color-mix(in lab,red,red)){.compass-load-visual[data-state=error] .compass-load-mark{box-shadow:0 18px 48px color-mix(in srgb,var(--destructive) 20%,transparent)}}.compass-load-visual[data-state=error] .compass-load-mark svg{width:22px;height:22px}.compass-load-copy{z-index:1;width:min(620px,100vw - 48px);position:relative}.compass-load-eyebrow{color:var(--compass-focus);letter-spacing:.16em;text-transform:uppercase;margin-bottom:10px;font-size:11px;font-weight:700;display:block}.compass-load-copy h1{color:var(--foreground);letter-spacing:-.035em;margin:0;font-size:clamp(24px,4vw,38px);font-weight:650;line-height:1.08}.compass-load-steps,.compass-load-error{color:var(--muted-foreground);margin:16px auto 0;font-size:13px;line-height:1.65}.compass-load-steps{flex-wrap:wrap;justify-content:center;gap:6px;display:flex}.compass-load-steps b{color:var(--compass-focus);font-weight:700}.compass-load-error{overflow-wrap:anywhere;max-width:560px}.compass-load-actions{flex-wrap:wrap;justify-content:center;gap:10px;margin-top:22px;display:flex}.compass-load-action{border:1px solid var(--compass-line-strong);background:var(--compass-panel-raised);min-height:38px;color:var(--foreground);font:inherit;border-radius:9px;outline:none;align-items:center;gap:8px;padding:0 14px;font-size:12px;display:inline-flex}.compass-load-action:hover{border-color:var(--compass-focus);background:var(--compass-focus-soft)}.compass-load-action-primary{border-color:var(--vscode-button-background,var(--compass-focus));background:var(--vscode-button-background,var(--compass-focus));color:var(--vscode-button-foreground,#fff)}.compass-load-action-primary:hover{background:var(--vscode-button-hoverBackground,var(--compass-focus))}.compass-load-action svg{width:15px;height:15px}@keyframes compass-load-logo-breathe{50%{opacity:.72;transform:scale(.94)}}.compass-load-shell{background:var(--vscode-editor-background,var(--background));grid-template-rows:auto auto;gap:18px}.compass-load-shell:before{display:none}.compass-load-visual{width:92px;height:88px;margin:0 auto}.compass-load-mark{color:var(--vscode-symbolIcon-classForeground,var(--vscode-progressBar-background,var(--compass-focus)));box-shadow:none}.compass-load-logo{filter:drop-shadow(0 9px 20px var(--vscode-progressBar-background,var(--workbench-progress)))}@supports (color:color-mix(in lab,red,red)){.compass-load-logo{filter:drop-shadow(0 9px 20px color-mix(in srgb,var(--vscode-progressBar-background,var(--workbench-progress)) 28%,transparent))}}.compass-load-progress{background:var(--vscode-progressBar-background,var(--workbench-progress));width:96px;height:2px;position:absolute;bottom:0;left:50%;overflow:hidden;transform:translate(-50%)}@supports (color:color-mix(in lab,red,red)){.compass-load-progress{background:var(--vscode-progressBar-background,color-mix(in srgb, var(--workbench-progress) 28%, transparent))}}.compass-load-progress i{background:var(--workbench-progress);width:45%;height:100%;animation:1.4s ease-in-out infinite compass-native-progress;display:block}@keyframes compass-native-progress{0%{transform:translate(-110%)}to{transform:translate(330%)}}.compass-load-copy{width:min(520px,100vw - 40px)}.compass-load-eyebrow{color:var(--muted-foreground);letter-spacing:.08em;margin-bottom:7px;font-size:10px}.compass-load-copy h1{letter-spacing:-.015em;font-size:clamp(19px,3vw,25px);font-weight:600;line-height:1.2}.compass-load-steps,.compass-load-error{margin-top:10px;font-size:12px}.compass-load-steps{gap:8px 14px}.compass-load-step{color:var(--vscode-disabledForeground,var(--muted-foreground));align-items:center;gap:6px;display:inline-flex}.compass-load-step>i{border:1px solid;border-radius:50%;width:6px;height:6px;display:block}.compass-load-step[data-state=complete]{color:var(--vscode-descriptionForeground,var(--muted-foreground))}.compass-load-step[data-state=complete]>i{border-color:var(--vscode-progressBar-background,var(--workbench-progress));background:var(--vscode-progressBar-background,var(--workbench-progress))}.compass-load-step[data-state=active]{color:var(--vscode-editor-foreground,var(--foreground))}.compass-load-step[data-state=active]>i{border-color:var(--vscode-progressBar-background,var(--workbench-progress));background:var(--vscode-progressBar-background,var(--workbench-progress));box-shadow:0 0 7px var(--vscode-progressBar-background,var(--workbench-progress))}@supports (color:color-mix(in lab,red,red)){.compass-load-step[data-state=active]>i{box-shadow:0 0 7px color-mix(in srgb,var(--vscode-progressBar-background,var(--workbench-progress)) 46%,transparent)}}.compass-load-action{background:var(--vscode-button-secondaryBackground,var(--secondary));min-height:30px;color:var(--vscode-button-secondaryForeground,var(--secondary-foreground));border-radius:3px;padding:0 11px}.compass-load-action-primary{background:var(--vscode-button-background,var(--primary));color:var(--vscode-button-foreground,var(--primary-foreground))}.compass-load-shell[data-variant=architecture]{text-align:left;grid-template-rows:auto auto;grid-template-columns:minmax(220px,390px) minmax(280px,560px);column-gap:clamp(24px,6vw,72px)}.compass-load-shell[data-variant=architecture] .compass-load-visual{grid-column:1;margin:0}.compass-load-shell[data-variant=architecture] .compass-load-copy{grid-column:1;width:auto}.compass-load-shell[data-variant=architecture] .compass-load-steps{justify-content:flex-start}.architecture-load-skeleton{border:1px solid var(--vscode-panel-border,var(--border));background:var(--vscode-editor-background,var(--background));border-radius:4px;grid-area:1/2/span 2;grid-template-rows:54px 1fr;grid-template-columns:92px 1fr;width:min(46vw,560px);height:min(46vh,360px);display:grid;overflow:hidden}.architecture-load-skeleton span{background-image:linear-gradient(90deg,transparent,var(--foreground),transparent)}@supports (color:color-mix(in lab,red,red)){.architecture-load-skeleton span{background-image:linear-gradient(90deg,transparent,color-mix(in srgb,var(--foreground) 7%,transparent),transparent)}}.architecture-load-skeleton span{background-size:220% 100%;animation:1.8s ease-in-out infinite compass-skeleton}.architecture-load-rail{border-right:1px solid var(--border);background-color:var(--vscode-sideBar-background,var(--sidebar));grid-row:1/span 2}.architecture-load-flow{border-bottom:1px solid var(--border)}.architecture-load-content{border:1px solid var(--border);border-radius:3px;margin:14px}@keyframes compass-skeleton{to{background-position:-220% 0}}.compass-workspace{isolation:isolate;background:var(--compass-canvas);height:100vh;min-height:30rem;position:relative;overflow:hidden}.compass-workspace-content{grid-template-columns:minmax(0,1fr) 8px var(--compass-inspector-width,340px);width:100%;height:100%;min-height:inherit;display:grid;overflow:hidden}.compass-workspace-content[data-inspector-collapsed=true]{grid-template-columns:minmax(0,1fr) 48px}.compass-graph-transition{z-index:30;background:var(--vscode-editor-background,var(--background));color:var(--foreground);text-align:center;grid-template-rows:auto auto;place-content:center;gap:18px;padding:40px 24px;display:grid;position:absolute;inset:0;overflow:hidden}.compass-graph-transition .compass-load-copy{width:min(520px,100vw - 40px)}.compass-graph-transition-description{max-width:470px;color:var(--vscode-descriptionForeground,var(--muted-foreground));margin:10px auto 0;font-size:12px;line-height:1.6}.compass-graph-transition .compass-load-action:focus-visible{outline:2px solid var(--vscode-focusBorder,var(--ring));outline-offset:2px}.compass-graph-stage{background:radial-gradient(circle at 45% 42%,var(--compass-focus),transparent 34%),radial-gradient(circle at 76% 75%,var(--compass-success),transparent 28%),linear-gradient(145deg,var(--compass-canvas) 0%,var(--compass-canvas-deep) 100%);min-width:0;min-height:0;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.compass-graph-stage{background:radial-gradient(circle at 45% 42%,color-mix(in srgb,var(--compass-focus) 21%,transparent),transparent 34%),radial-gradient(circle at 76% 75%,color-mix(in srgb,var(--compass-success) 10%,transparent),transparent 28%),linear-gradient(145deg,var(--compass-canvas) 0%,var(--compass-canvas-deep) 100%)}}.compass-graph-stage:after{content:"";pointer-events:none;opacity:.16;background-image:radial-gradient(var(--compass-grid) .55px,transparent .55px);background-size:22px 22px;position:absolute;inset:0}.compass-graph-stage[data-comparison=true]{background:var(--vscode-editor-background,var(--compass-canvas))}.compass-graph-stage[data-comparison=true]:after{opacity:.09}.compass-canvas{z-index:1;min-width:0;min-height:0;position:absolute;inset:0}.compass-glass-panel{background:var(--vscode-editorWidget-background,var(--compass-panel));border:1px solid var(--compass-line);box-shadow:none;-webkit-backdrop-filter:none}.compass-graph-toolbar{z-index:4;border-radius:4px;justify-content:space-between;align-items:center;gap:10px;min-height:42px;padding:5px 6px 5px 10px;display:flex;position:absolute;top:12px;left:12px;right:12px}.compass-viewer-status{min-width:0;color:var(--muted-foreground);letter-spacing:.015em;align-items:center;gap:10px;font-size:12px;display:flex}.compass-viewer-status-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.compass-viewer-status-dot{background:var(--compass-focus);width:8px;height:8px;box-shadow:0 0 0 4px var(--compass-focus);border-radius:50%;flex:none}@supports (color:color-mix(in lab,red,red)){.compass-viewer-status-dot{box-shadow:0 0 0 4px color-mix(in srgb,var(--compass-focus) 12%,transparent)}}.compass-viewer-status[data-state=running] .compass-viewer-status-dot{animation:1.6s ease-in-out infinite compass-status-pulse}@keyframes compass-status-pulse{50%{box-shadow:0 0 0 8px color-mix(in srgb,var(--compass-focus) 0%,transparent)}}.compass-toolbar-actions{scrollbar-width:none;align-items:center;gap:6px;min-width:0;display:flex;overflow-x:auto}.compass-physics-button{border-color:var(--compass-line);background:var(--vscode-dropdown-background,transparent)}.compass-physics-button[aria-pressed=true]{border-color:var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.compass-physics-button[aria-pressed=true]{border-color:color-mix(in srgb,var(--compass-focus) 55%,var(--compass-line))}}.compass-physics-button[aria-pressed=true]{background:var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.compass-physics-button[aria-pressed=true]{background:color-mix(in srgb,var(--compass-focus) 13%,transparent)}}.compass-physics-button[aria-pressed=true]{color:var(--foreground)}.compass-toolbar-actions::-webkit-scrollbar{display:none}.compass-toolbar-separator{background:var(--compass-line);flex:none;width:1px;height:18px}.compass-zoom-controls{border:1px solid var(--compass-line);background:var(--vscode-dropdown-background,transparent);border-radius:3px;flex:none;min-height:30px;display:inline-flex;overflow:hidden}.compass-zoom-controls .compass-tool-button{border:0;border-radius:0;min-height:28px}.compass-zoom-controls .compass-tool-button+.compass-tool-button{border-left:1px solid var(--compass-line)}.compass-layout-picker{border:1px solid var(--compass-line);min-height:30px;color:var(--muted-foreground);background:var(--vscode-dropdown-background,transparent);border-radius:3px;align-items:center;gap:6px;padding-left:8px;display:inline-flex}.compass-layout-picker svg{flex:none;width:15px;height:15px}.compass-layout-picker select{min-height:28px;color:var(--vscode-dropdown-foreground,var(--foreground));font:inherit;background:0 0;border:0;outline:0;padding:0 24px 0 0}.compass-layout-picker:focus-within{outline:1px solid var(--vscode-focusBorder,var(--compass-focus));outline-offset:1px}.compass-tool-button:disabled{cursor:default;opacity:.55}.compass-tool-button{min-height:30px;color:var(--muted-foreground);white-space:nowrap;background:0 0;border:1px solid #0000;border-radius:3px;align-items:center;gap:7px;padding:0 8px;transition:none;display:inline-flex}.compass-tool-button svg{width:15px;height:15px}.compass-tool-icon-button{flex:0 0 30px;justify-content:center;width:30px;padding:0}.compass-zoom-reset{min-width:42px;color:var(--compass-faint);font:9px/1 var(--compass-font-mono);letter-spacing:.02em;justify-content:center;padding:0 7px}.compass-tool-button:hover,.compass-tool-button[aria-pressed=true]{border-color:var(--compass-line);background:var(--workbench-hover);color:var(--foreground)}.compass-tool-button:focus-visible,.compass-explore-panel button:focus-visible,.compass-explore-panel select:focus-visible,.compass-minimap button:focus-visible,.compass-change-legend button:focus-visible,.compass-search-field input:focus-visible,.compass-search-item:focus-visible,.compass-inspector-action:focus-visible,.compass-source-card:focus-visible,.compass-inspector-disclosure:focus-visible,.compass-inspector-resizer:focus-visible,.compass-load-action:focus-visible,.compass-neighbor-link:focus-visible,.compass-community-item:focus-within{outline:2px solid var(--compass-focus);outline-offset:2px}.compass-explore-panel{z-index:8;width:min(330px,100vw - 24px);max-height:calc(100vh - 84px);color:var(--foreground);border-radius:5px;gap:10px;padding:12px;display:grid;position:absolute;top:calc(100% + 7px);right:0;overflow-y:auto}.compass-explore-heading{border-bottom:1px solid var(--compass-line);justify-content:space-between;align-items:flex-start;gap:16px;padding-bottom:10px;display:flex}.compass-explore-heading>div{gap:3px;display:grid}.compass-explore-heading strong,.compass-explore-toggle strong,.compass-shortcut-title strong{letter-spacing:.02em;font-size:11px;font-weight:600}.compass-explore-heading span,.compass-explore-toggle small{color:var(--compass-faint);font-size:10px;line-height:1.35}.compass-selection-prompt{border:1px solid var(--compass-focus);grid-template-columns:18px minmax(0,1fr);align-items:start;gap:9px;padding:9px;display:grid}@supports (color:color-mix(in lab,red,red)){.compass-selection-prompt{border:1px solid color-mix(in srgb,var(--compass-focus) 28%,var(--compass-line))}}.compass-selection-prompt{background:var(--compass-focus);border-radius:4px}@supports (color:color-mix(in lab,red,red)){.compass-selection-prompt{background:color-mix(in srgb,var(--compass-focus) 7%,transparent)}}.compass-selection-prompt{color:var(--muted-foreground)}.compass-selection-prompt>svg{width:16px;height:16px;color:var(--compass-focus)}.compass-selection-prompt>span{gap:3px;display:grid}.compass-selection-prompt strong{color:var(--foreground);font-size:10px}.compass-selection-prompt small{color:var(--compass-faint);font-size:10px;line-height:1.4}.compass-explore-panel kbd{border:1px solid var(--compass-line);border-bottom-color:var(--compass-line);justify-content:center;align-items:center;min-width:20px;min-height:19px;padding:0 5px;display:inline-flex}@supports (color:color-mix(in lab,red,red)){.compass-explore-panel kbd{border-bottom-color:color-mix(in srgb,var(--compass-line) 72%,var(--foreground))}}.compass-explore-panel kbd{background:var(--vscode-keybindingLabel-background,var(--workbench-hover));color:var(--vscode-keybindingLabel-foreground,var(--foreground));font:9px/1 var(--compass-font-mono);border-radius:3px}.compass-explore-toggle{width:100%;color:var(--muted-foreground);text-align:left;background:0 0;border:1px solid #0000;border-radius:4px;grid-template-columns:18px minmax(0,1fr) 28px;align-items:center;gap:9px;padding:7px 8px;display:grid}.compass-explore-toggle:hover,.compass-explore-toggle[aria-pressed=true]{border-color:var(--compass-line);background:var(--workbench-hover);color:var(--foreground)}.compass-explore-toggle:disabled{cursor:default;opacity:.5}.compass-explore-toggle>svg{width:16px;height:16px}.compass-explore-toggle>span{gap:2px;min-width:0;display:grid}.compass-explore-toggle>i{border:1px solid var(--compass-line);background:var(--compass-canvas-deep);border-radius:8px;width:26px;height:14px;position:relative}.compass-explore-toggle>i:after{content:"";background:var(--compass-faint);border-radius:50%;width:8px;height:8px;position:absolute;top:2px;left:2px}.compass-explore-toggle[aria-pressed=true]>i{border-color:var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.compass-explore-toggle[aria-pressed=true]>i{border-color:color-mix(in srgb,var(--compass-focus) 65%,var(--compass-line))}}.compass-explore-toggle[aria-pressed=true]>i{background:var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.compass-explore-toggle[aria-pressed=true]>i{background:color-mix(in srgb,var(--compass-focus) 24%,var(--compass-canvas-deep))}}.compass-explore-toggle[aria-pressed=true]>i:after{background:var(--compass-focus);left:14px}.compass-explore-field{border:0;gap:6px;min-width:0;margin:0;padding:0;display:grid}.compass-explore-field:disabled{opacity:.5}.compass-explore-field legend,.compass-explore-select>span{color:var(--compass-faint);letter-spacing:.08em;text-transform:uppercase;margin-bottom:6px;font-size:9px;font-weight:600}.compass-segmented-control{border:1px solid var(--compass-line);border-radius:4px;grid-auto-columns:1fr;grid-auto-flow:column;display:grid;overflow:hidden}.compass-segmented-control button{min-height:28px;color:var(--compass-faint);font:10px/1 var(--compass-font-mono);background:0 0;border:0}.compass-segmented-control button+button{border-left:1px solid var(--compass-line)}.compass-segmented-control button:hover,.compass-segmented-control button[aria-pressed=true]{background:var(--workbench-hover);color:var(--foreground)}.compass-segmented-control button[aria-pressed=true]{box-shadow:inset 0 -2px var(--compass-focus)}.compass-explore-select{display:grid}.compass-explore-select select{border:1px solid var(--compass-line);background:var(--vscode-dropdown-background,var(--compass-canvas-deep));min-height:30px;color:var(--vscode-dropdown-foreground,var(--foreground));border-radius:4px;padding:0 28px 0 8px;font-size:10px}.compass-shortcut-guide{border-top:1px solid var(--compass-line);gap:9px;padding-top:10px;display:grid}.compass-shortcut-title{color:var(--muted-foreground);align-items:center;gap:7px;display:flex}.compass-shortcut-title svg{width:15px;height:15px}.compass-shortcut-guide dl{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 14px;margin:0;display:grid}.compass-shortcut-guide dl>div{grid-template-columns:52px minmax(0,1fr);align-items:center;gap:5px;display:grid}.compass-shortcut-guide dt,.compass-shortcut-guide dd{margin:0}.compass-shortcut-guide dt{gap:3px;display:flex}.compass-shortcut-guide dd{color:var(--compass-faint);font-size:9px}.compass-minimap{z-index:3;border-radius:4px;width:178px;position:absolute;bottom:12px;right:12px;overflow:hidden}.compass-minimap header{border-bottom:1px solid var(--compass-line);min-height:26px;color:var(--muted-foreground);font:9px/1 var(--compass-font-mono);letter-spacing:.08em;text-transform:uppercase;justify-content:space-between;align-items:center;padding:0 8px;display:flex}.compass-minimap header small{color:var(--compass-faint);font:inherit;letter-spacing:0;text-transform:none}.compass-minimap button{background:var(--compass-canvas);border:0;width:100%;height:108px;padding:0;display:block}@supports (color:color-mix(in lab,red,red)){.compass-minimap button{background:color-mix(in srgb,var(--compass-canvas) 90%,transparent)}}.compass-minimap button{color:var(--compass-faint)}.compass-minimap svg{width:100%;height:100%;display:block}.compass-minimap-edges line{stroke:var(--compass-line);stroke-width:.65px;vector-effect:non-scaling-stroke}.compass-minimap-nodes circle[data-focused=true]{stroke:var(--foreground);stroke-width:1.25px;vector-effect:non-scaling-stroke}.compass-minimap-viewport{fill:var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.compass-minimap-viewport{fill:color-mix(in srgb,var(--compass-focus) 8%,transparent)}}.compass-minimap-viewport{stroke:var(--compass-focus);stroke-width:1px;vector-effect:non-scaling-stroke}.compass-changed-symbols button:focus-visible,.compass-evidence-source-actions button:focus-visible,.compass-relationship-detail>button:focus-visible{outline:2px solid var(--compass-focus);outline-offset:2px}.compass-change-legend{z-index:4;border:1px solid var(--compass-line);background:var(--vscode-editorWidget-background,var(--compass-panel));border-radius:4px;flex-wrap:wrap;gap:5px;max-width:calc(100% - 24px);padding:5px;display:flex;position:absolute;top:64px;left:12px}.compass-change-legend button{min-height:27px;color:var(--muted-foreground);background:0 0;border:1px solid #0000;border-radius:3px;align-items:center;gap:6px;padding:3px 7px;font-size:10px;display:inline-flex}.compass-change-legend button:hover,.compass-change-legend button[aria-pressed=true]{border-color:var(--compass-line);background:var(--workbench-hover);color:var(--foreground)}.compass-change-legend button[aria-pressed=false]{opacity:.42}.compass-change-legend button>span{border:1px solid var(--vscode-descriptionForeground,#6e7781);background:var(--vscode-descriptionForeground,#6e7781);border-radius:50%;width:8px;height:8px}@supports (color:color-mix(in lab,red,red)){.compass-change-legend button>span{background:color-mix(in srgb,var(--vscode-descriptionForeground,#6e7781) 18%,var(--vscode-editor-background,var(--background)))}}.compass-change-legend button[data-change=added]>span{border-color:var(--vscode-gitDecoration-addedResourceForeground,#2ea043);background:var(--vscode-gitDecoration-addedResourceForeground,#2ea043)}@supports (color:color-mix(in lab,red,red)){.compass-change-legend button[data-change=added]>span{background:color-mix(in srgb,var(--vscode-gitDecoration-addedResourceForeground,#2ea043) 22%,var(--vscode-editor-background,var(--background)))}}.compass-change-legend button[data-change=removed]>span{border-color:var(--vscode-gitDecoration-deletedResourceForeground,#f85149);background:var(--vscode-gitDecoration-deletedResourceForeground,#f85149)}@supports (color:color-mix(in lab,red,red)){.compass-change-legend button[data-change=removed]>span{background:color-mix(in srgb,var(--vscode-gitDecoration-deletedResourceForeground,#f85149) 22%,var(--vscode-editor-background,var(--background)))}}.compass-change-legend button[data-change=changed]>span{border-color:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922);background:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922)}@supports (color:color-mix(in lab,red,red)){.compass-change-legend button[data-change=changed]>span{background:color-mix(in srgb,var(--vscode-gitDecoration-modifiedResourceForeground,#d29922) 22%,var(--vscode-editor-background,var(--background)))}}.compass-change-legend button small{color:var(--compass-faint);font:9px/1 var(--compass-font-mono)}.compass-semantic-legend{z-index:4;border:1px solid var(--compass-line);background:var(--vscode-editorWidget-background,var(--compass-panel));max-width:calc(100% - 24px);color:var(--muted-foreground);border-radius:4px;flex-wrap:wrap;gap:5px 12px;padding:7px 8px;font-size:10px;display:flex;position:absolute;top:64px;left:12px}.compass-semantic-legend section{flex-wrap:wrap;align-items:center;gap:5px 9px;min-height:20px;display:flex}.compass-semantic-legend section+section{border-left:1px solid var(--compass-line);padding-left:12px}.compass-semantic-legend strong{color:var(--compass-faint);font:9px/1 var(--compass-font-mono);letter-spacing:.08em;text-transform:uppercase}.compass-semantic-legend-item{white-space:nowrap;align-items:center;gap:5px;display:inline-flex}.compass-semantic-legend-item small{color:var(--compass-faint);font:9px/1 var(--compass-font-mono)}.compass-semantic-legend-item i[data-node-category]{border:1.5px solid var(--vscode-descriptionForeground,#8b949e);background:var(--vscode-descriptionForeground,#8b949e);width:9px;height:9px;display:inline-block}@supports (color:color-mix(in lab,red,red)){.compass-semantic-legend-item i[data-node-category]{background:color-mix(in srgb,var(--vscode-descriptionForeground,#8b949e) 22%,var(--vscode-editor-background,var(--background)))}}.compass-semantic-legend-item i[data-node-category=callable]{border-color:var(--vscode-symbolIcon-functionForeground,#5fa8ff);background:var(--vscode-symbolIcon-functionForeground,#5fa8ff);border-radius:50%}@supports (color:color-mix(in lab,red,red)){.compass-semantic-legend-item i[data-node-category=callable]{background:color-mix(in srgb,var(--vscode-symbolIcon-functionForeground,#5fa8ff) 22%,var(--vscode-editor-background,var(--background)))}}.compass-semantic-legend-item i[data-node-category=type]{border-color:var(--vscode-symbolIcon-classForeground,#e3b341);background:var(--vscode-symbolIcon-classForeground,#e3b341)}@supports (color:color-mix(in lab,red,red)){.compass-semantic-legend-item i[data-node-category=type]{background:color-mix(in srgb,var(--vscode-symbolIcon-classForeground,#e3b341) 22%,var(--vscode-editor-background,var(--background)))}}.compass-semantic-legend-item i[data-node-category=type]{transform:rotate(45deg)scale(.82)}.compass-semantic-legend-item i[data-node-category=module]{border-color:var(--vscode-symbolIcon-moduleForeground,#56d4b4);background:var(--vscode-symbolIcon-moduleForeground,#56d4b4);border-radius:1px}@supports (color:color-mix(in lab,red,red)){.compass-semantic-legend-item i[data-node-category=module]{background:color-mix(in srgb,var(--vscode-symbolIcon-moduleForeground,#56d4b4) 22%,var(--vscode-editor-background,var(--background)))}}.compass-semantic-legend-item i[data-node-category=boundary]{background:var(--vscode-symbolIcon-eventForeground,#ff9b87);clip-path:polygon(50% 0,100% 100%,0 100%);border:0;width:11px;height:10px}.compass-semantic-legend-item i[data-edge-category]{background:var(--vscode-descriptionForeground,#8b949e);width:16px;height:2px;display:inline-block;position:relative}.compass-semantic-legend-item i[data-edge-category]:after{content:"";border-top:3px solid #0000;border-bottom:3px solid #0000;border-left:4px solid;width:0;height:0;position:absolute;top:-2px;right:-1px}.compass-semantic-legend-item i[data-edge-category=execution]{background:var(--vscode-symbolIcon-functionForeground,#5fa8ff);color:var(--vscode-symbolIcon-functionForeground,#5fa8ff)}.compass-semantic-legend-item i[data-edge-category=dependency]{background:var(--vscode-symbolIcon-moduleForeground,#56d4b4);color:var(--vscode-symbolIcon-moduleForeground,#56d4b4)}.compass-semantic-legend-item i[data-edge-category=structure]{background:var(--vscode-symbolIcon-classForeground,#e3b341);color:var(--vscode-symbolIcon-classForeground,#e3b341)}.compass-semantic-legend-item i[data-edge-category=flow]{background:var(--vscode-symbolIcon-eventForeground,#ff9b87);color:var(--vscode-symbolIcon-eventForeground,#ff9b87)}.compass-inspector-resizer{z-index:6;background:var(--compass-panel);cursor:col-resize;touch-action:none;border:0;outline:none;min-width:8px;position:relative}.compass-inspector-resizer span{background:var(--compass-line-strong);border-radius:999px;width:2px;height:42px;transition:height .16s,background .16s;position:absolute;top:50%;left:3px;transform:translateY(-50%)}.compass-inspector-resizer:hover span,.compass-inspector-resizer:focus-visible span{background:var(--compass-focus);height:68px}.compass-graph-inspector{z-index:5;border-left:1px solid var(--compass-line);background:var(--vscode-sideBar-background,var(--compass-panel));min-width:0;box-shadow:none;flex-direction:column;display:flex;position:relative;overflow:hidden}.compass-graph-inspector-collapsed{border-left:1px solid var(--compass-line);box-shadow:none;align-items:center}.compass-inspector-header{border-bottom:1px solid var(--compass-line);align-items:center;gap:11px;min-height:52px;padding:8px 12px;display:flex}.compass-inspector-title{flex:1;min-width:0}.compass-inspector-header strong,.compass-inspector-header small{display:block}.compass-inspector-header strong{letter-spacing:.01em;font-size:14px}.compass-inspector-header small{color:var(--compass-faint);text-overflow:ellipsis;white-space:nowrap;margin-top:2px;font-size:11px;overflow:hidden}.compass-product-mark{background:linear-gradient(145deg,var(--vscode-button-foreground,#eff8ff),var(--compass-focus));border-radius:4px;flex:none;place-items:center;width:32px;height:32px;display:grid}@supports (color:color-mix(in lab,red,red)){.compass-product-mark{background:linear-gradient(145deg,var(--vscode-button-foreground,#eff8ff),color-mix(in srgb,var(--compass-focus) 64%,#fff))}}.compass-product-mark{color:var(--vscode-button-background,#09182c);box-shadow:inset 0 0 0 1px #ffffff7a}.compass-product-mark svg{width:19px;height:19px}.compass-inspector-disclosure{width:32px;height:32px;color:var(--muted-foreground);background:0 0;border:1px solid #0000;border-radius:3px;outline:none;flex:none;place-items:center;transition:none;display:grid}.compass-inspector-disclosure:hover{border-color:var(--compass-line);background:var(--workbench-hover);color:var(--foreground)}.compass-inspector-disclosure svg{width:17px;height:17px}.compass-inspector-expand{margin-top:18px}.compass-inspector-rail-label{color:var(--compass-faint);letter-spacing:.12em;text-transform:uppercase;writing-mode:vertical-rl;margin-top:16px;font-size:10px;font-weight:650}.compass-inspector-search{border-bottom:1px solid var(--compass-line);padding:10px 12px;position:relative}.compass-inspector-search-row{grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px;display:grid}.compass-inspector-search-row .compass-search-field:last-child{grid-column:1/-1}.compass-inspector-search-disclosure{border-color:var(--compass-line)}.compass-search-field{position:relative}.compass-search-field svg{width:15px;height:15px;color:var(--compass-faint);pointer-events:none;position:absolute;top:50%;left:13px;transform:translateY(-50%)}.compass-search-field input{border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--background));width:100%;min-height:30px;color:var(--vscode-input-foreground,var(--foreground));border-radius:3px;outline:none;padding:0 10px 0 34px}.compass-search-field input::placeholder{color:var(--vscode-input-placeholderForeground,var(--compass-faint))}.compass-search-results{z-index:8;border:1px solid var(--compass-line-strong);background:var(--vscode-menu-background,var(--compass-panel));max-height:230px;box-shadow:0 4px 12px var(--vscode-widget-shadow,#00000047);border-radius:3px;padding:6px;position:absolute;top:46px;left:12px;right:12px;overflow-y:auto}.compass-search-item{width:100%;min-height:42px;color:var(--muted-foreground);text-align:left;background:0 0;border:0;border-left:3px solid #0000;border-radius:2px;padding:7px 10px;display:block;overflow:hidden}.compass-search-item strong,.compass-search-item span{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.compass-search-item strong{color:var(--foreground);font-size:12px}.compass-search-item span{color:var(--compass-faint);font:10px/1.4 var(--compass-font-mono)}.compass-search-item:hover,.compass-search-item[aria-selected=true]{background:var(--vscode-list-activeSelectionBackground,var(--compass-focus-soft));color:var(--vscode-list-activeSelectionForeground,var(--foreground))}.compass-info-panel{border-bottom:1px solid var(--compass-line);max-height:48%;padding:18px 16px;overflow-y:auto}.compass-changed-symbols{border-bottom:1px solid var(--compass-line);max-height:30%;padding:14px 16px;overflow-y:auto}.compass-changed-symbol-list{gap:4px;display:grid}.compass-changed-symbol-list>button{width:100%;color:var(--foreground);text-align:left;background:0 0;border:1px solid #0000;border-radius:3px;grid-template-columns:auto minmax(0,1fr);gap:2px 8px;padding:7px 8px;display:grid}.compass-changed-symbol-list>button:hover,.compass-changed-symbol-list>button[aria-pressed=true]{border-color:var(--compass-line);background:var(--vscode-list-activeSelectionBackground,var(--compass-focus-soft))}.compass-changed-symbol-list strong,.compass-changed-symbol-list small{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.compass-changed-symbol-list small{color:var(--compass-faint);font:9px/1.35 var(--compass-font-mono);grid-column:2}.compass-changed-symbol-status{color:var(--vscode-descriptionForeground);letter-spacing:.06em;text-transform:uppercase;grid-row:1/span 2;align-self:center;font-size:8px;font-weight:700}.compass-changed-symbol-list>button[data-change=added] .compass-changed-symbol-status{color:var(--vscode-gitDecoration-addedResourceForeground,#2ea043)}.compass-changed-symbol-list>button[data-change=removed] .compass-changed-symbol-status{color:var(--vscode-gitDecoration-deletedResourceForeground,#f85149)}.compass-changed-symbol-list>button[data-change=changed] .compass-changed-symbol-status{color:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922)}.compass-changed-symbol-expand{border:1px solid var(--compass-line);width:100%;color:var(--vscode-textLink-foreground,var(--compass-focus));background:0 0;border-radius:3px;margin-top:8px;padding:6px 8px}.compass-record-evidence,.compass-relationship-evidence,.compass-code-evidence{margin-top:16px}.compass-code-query-actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin-top:10px;display:grid}.compass-code-query-actions button{border:1px solid var(--compass-line);color:var(--vscode-textLink-foreground,var(--compass-focus));background:0 0;border-radius:3px;padding:5px 4px;font-size:9px}.compass-code-query-actions button:focus-visible{outline:2px solid var(--vscode-focusBorder,var(--compass-focus));outline-offset:1px}.compass-code-evidence-ledger{gap:6px;display:grid}.compass-code-evidence-entry{border:1px solid var(--compass-line);background:var(--vscode-editorWidget-background,var(--background));border-left-width:3px;border-radius:3px;grid-template-columns:24px minmax(0,1fr);gap:8px;padding:8px;display:grid}.compass-code-evidence-entry[data-status=exact],.compass-code-evidence-entry[data-status=config],.compass-code-evidence-entry[data-status=convention]{border-left-color:var(--vscode-testing-iconPassed,#2ea043)}.compass-code-evidence-entry[data-status=heuristic]{border-left-color:var(--vscode-charts-blue,#58a6ff)}.compass-code-evidence-entry[data-status=ambiguous],.compass-code-evidence-entry[data-status=unresolved]{border-left-color:var(--vscode-editorWarning-foreground,#d29922)}.compass-code-evidence-icon{background:var(--vscode-badge-background,var(--muted));width:24px;height:24px;color:var(--vscode-badge-foreground,var(--foreground));border-radius:50%;place-items:center;display:grid}.compass-code-evidence-icon svg{width:13px;height:13px}.compass-code-evidence-copy{min-width:0}.compass-code-evidence-status{justify-content:space-between;align-items:baseline;gap:8px;display:flex}.compass-code-evidence-status strong{color:var(--foreground);font-size:10px}.compass-code-evidence-status span{color:var(--compass-faint);text-transform:uppercase;font-size:8px}.compass-code-evidence-copy dl{gap:3px;margin:7px 0 0;display:grid}.compass-code-evidence-copy dl>div{grid-template-columns:62px minmax(0,1fr);gap:6px;display:grid}.compass-code-evidence-copy dt{color:var(--compass-faint);text-transform:uppercase;font-size:8px}.compass-code-evidence-copy dd{overflow-wrap:anywhere;min-width:0;color:var(--foreground);font:9px/1.35 var(--compass-font-mono);margin:0}.compass-code-evidence-source{max-width:100%;color:var(--vscode-textLink-foreground,var(--compass-focus));font:9px/1.35 var(--compass-font-mono);overflow-wrap:anywhere;text-align:left;background:0 0;border:0;align-items:center;gap:5px;margin-top:7px;padding:0;display:inline-flex}button.compass-code-evidence-source{cursor:pointer}button.compass-code-evidence-source:focus-visible{outline:2px solid var(--vscode-focusBorder,var(--compass-focus));outline-offset:2px;border-radius:2px}.compass-code-evidence-source svg{width:11px;min-width:11px;height:11px}.compass-code-candidates{border-top:1px solid var(--compass-line);margin-top:8px;padding-top:7px}.compass-code-candidates>span{color:var(--compass-faint);text-transform:uppercase;font-size:8px}.compass-code-candidates ul{gap:5px;margin:6px 0 0;padding:0;list-style:none;display:grid}.compass-code-candidates li{grid-template-columns:minmax(0,1fr) auto;gap:1px 6px;display:grid}.compass-code-candidates code{overflow-wrap:anywhere;color:var(--foreground);font:9px/1.35 var(--compass-font-mono)}.compass-code-candidates li>span{color:var(--muted-foreground);grid-column:1/-1;font-size:9px}.compass-code-candidates small{color:var(--compass-faint);text-transform:uppercase;grid-area:1/2;font-size:8px}.compass-code-diagnostic{border:1px solid var(--vscode-editorWarning-foreground,#d29922);color:var(--muted-foreground);border-radius:3px;gap:7px;margin:0 0 6px;padding:7px 8px;font-size:9px;display:flex}.compass-code-diagnostic[data-severity=info]{border-color:var(--vscode-charts-blue,#58a6ff)}.compass-code-diagnostic svg{width:12px;min-width:12px;height:12px}.compass-code-diagnostic strong{color:var(--foreground);text-transform:capitalize}.compass-evidence-heading{justify-content:space-between;align-items:baseline;margin-bottom:7px;display:flex}.compass-evidence-heading h3{color:var(--foreground);font-size:11px}.compass-evidence-heading span{color:var(--compass-faint);font-size:9px}.compass-field-table-wrap{border:1px solid var(--compass-line);border-radius:3px;overflow-x:auto}.compass-field-table{border-collapse:collapse;table-layout:fixed;width:100%;min-width:360px}.compass-field-table th,.compass-field-table td{border-right:1px solid var(--compass-line);border-bottom:1px solid var(--compass-line);vertical-align:top;text-align:left;padding:6px 7px}.compass-field-table tr:last-child>*{border-bottom:0}.compass-field-table tr>:last-child{border-right:0}.compass-field-table thead th{background:var(--vscode-editorWidget-background,var(--background));color:var(--compass-faint);text-transform:uppercase;font-size:9px}.compass-field-table tbody th{width:27%;color:var(--foreground);font:9px/1.4 var(--compass-font-mono);overflow-wrap:anywhere}.compass-field-table code{color:var(--foreground);font:9px/1.4 var(--compass-font-mono);white-space:pre-wrap;overflow-wrap:anywhere}.compass-value-truncated{color:var(--vscode-editorWarning-foreground,#d29922);margin-top:4px;font-size:8px;display:block}.compass-evidence-source-actions{gap:6px;margin-top:8px;display:flex}.compass-evidence-source-actions button{border:1px solid var(--compass-line);color:var(--vscode-textLink-foreground,var(--compass-focus));background:0 0;border-radius:3px;align-items:center;gap:5px;padding:5px 7px;display:inline-flex}.compass-evidence-source-actions svg{width:12px;height:12px}.compass-relationship-list{gap:5px;margin-top:7px;display:grid}.compass-relationship-list details{border:1px solid var(--compass-line);background:var(--vscode-editorWidget-background,var(--background));border-radius:3px;padding:6px 7px}.compass-relationship-list summary{cursor:pointer;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:4px 7px;display:grid}.compass-relationship-target{color:var(--vscode-textLink-foreground,var(--compass-focus));text-align:left;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.compass-relationship-list summary small{color:var(--foreground);font:9px/1.3 var(--compass-font-mono);grid-column:2}.compass-relationship-list summary i{color:var(--compass-faint);text-transform:uppercase;grid-area:2/3;font-size:8px;font-style:normal}.compass-relationship-detail{margin-top:7px}.compass-relationship-detail>p{color:var(--compass-faint);font:9px/1.4 var(--compass-font-mono);margin:7px 0 0}.compass-relationship-detail>button{border:1px solid var(--compass-line);color:var(--vscode-textLink-foreground,var(--compass-focus));background:0 0;border-radius:3px;margin-top:7px;padding:4px 7px}.compass-bounded-notice{z-index:4;border:1px solid var(--vscode-editorWarning-foreground,#d29922);background:var(--vscode-editorWidget-background,var(--compass-panel));max-width:min(420px,100% - 24px);color:var(--foreground);border-radius:3px;gap:2px;padding:8px 10px;font-size:10px;display:grid;position:absolute;bottom:12px;right:12px}.compass-bounded-notice span{color:var(--muted-foreground)}.compass-hover-hint{border-top:1px solid var(--compass-line);color:var(--vscode-textLink-foreground,var(--compass-focus));align-items:center;gap:7px;margin-top:2px;padding-top:9px;font-size:11px;display:flex!important}.compass-hover-hint svg{flex:none;width:14px;height:14px}.compass-hover-hint strong{color:var(--vscode-editorHoverWidget-foreground,var(--foreground));font-weight:650}.compass-section-heading,.compass-neighbors-heading{justify-content:space-between;align-items:baseline;display:flex}.compass-section-heading{margin-bottom:15px}.compass-section-heading h2,.compass-community-panel h2{letter-spacing:.1em;text-transform:uppercase;font-size:11px;font-weight:700}.compass-section-heading span{color:var(--compass-faint);letter-spacing:.1em;text-transform:uppercase;font-size:9px}.compass-info-content{color:var(--muted-foreground);font-size:12px;line-height:1.45}.compass-node-identity{align-items:center;gap:11px;margin-bottom:15px;display:flex}.compass-node-identity>span:nth-child(2){flex:1;min-width:0}.compass-node-identity strong,.compass-node-identity small{display:block}.compass-node-identity strong{color:var(--foreground);text-overflow:ellipsis;white-space:nowrap;font-size:14px;overflow:hidden}.compass-node-identity small{background:var(--compass-success);border-radius:999px;width:max-content;margin-top:3px;padding:3px 7px}@supports (color:color-mix(in lab,red,red)){.compass-node-identity small{background:color-mix(in srgb,var(--compass-success) 20%,transparent)}}.compass-node-identity small{color:var(--compass-success);letter-spacing:.07em;text-transform:uppercase;font-size:9px;font-weight:800}.compass-node-swatch{border-radius:5px;flex:none;width:10px;height:36px}.compass-change-badge{width:max-content;color:var(--vscode-descriptionForeground,#6e7781);letter-spacing:.05em;text-transform:uppercase;border:1px solid;border-radius:999px;align-items:center;gap:5px;padding:3px 7px;font-size:9px;font-weight:700;display:inline-flex}.compass-node-identity .compass-change-badge{flex:none;margin-left:auto}.compass-change-badge[data-change=added]{color:var(--vscode-gitDecoration-addedResourceForeground,#2ea043)}.compass-change-badge[data-change=removed]{color:var(--vscode-gitDecoration-deletedResourceForeground,#f85149)}.compass-change-badge[data-change=changed]{color:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922)}.compass-metadata-grid{grid-template-columns:1fr 1fr;gap:8px;margin-bottom:15px;display:grid}.compass-metadata-grid>div{border:1px solid var(--compass-line);background:var(--vscode-editorWidget-background,var(--background));border-radius:3px;min-width:0;padding:9px 10px}.compass-metadata-grid .compass-metadata-wide{grid-column:1/-1}.compass-metadata-grid dt{color:var(--compass-faint);letter-spacing:.08em;text-transform:uppercase;font-size:9px}.compass-metadata-grid dd{color:var(--foreground);text-overflow:ellipsis;white-space:nowrap;margin-top:4px;overflow:hidden}.compass-source-metadata[data-interactive=true]{padding:0;transition:border-color .16s,background .16s}.compass-source-metadata[data-interactive=true]:hover,.compass-source-metadata[data-interactive=true]:focus-within{border-color:var(--compass-focus);background:var(--compass-focus-soft)}.compass-source-metadata[data-interactive=true] dd{white-space:normal;margin:0;overflow:visible}.compass-source-card{width:100%;min-height:58px;color:var(--foreground);text-align:left;background:0 0;border:0;border-radius:2px;outline:none;justify-content:space-between;align-items:center;gap:10px;padding:9px 10px;display:flex}.compass-source-copy{min-width:0;display:block}.compass-source-eyebrow,.compass-source-path,.compass-source-range{display:block}.compass-source-eyebrow{color:var(--compass-faint);font-family:var(--compass-font-sans);letter-spacing:.08em;text-transform:uppercase;font-size:9px}.compass-source-path{font:11px/1.35 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;margin-top:4px;overflow:hidden}.compass-source-range{color:var(--muted-foreground);font:10px/1.25 var(--compass-font-sans);margin-top:3px}.compass-source-card>svg{width:15px;height:15px;color:var(--compass-focus);flex:none}.compass-source-card:hover>svg{color:var(--foreground)}.compass-signature-block{overflow-wrap:anywhere;border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--background));color:var(--foreground);font:11px/1.45 var(--compass-font-mono);border-radius:3px;margin-bottom:15px;padding:10px;display:block}.compass-inspector-action{border:1px solid var(--compass-line);background:var(--workbench-hover);width:100%;min-height:36px;color:var(--foreground);border-radius:3px;justify-content:space-between;align-items:center;gap:8px;margin-bottom:14px;padding:0 10px;display:flex}.compass-inspector-action span{min-width:0;color:var(--muted-foreground);font:10px/1.2 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.compass-neighbors-heading{margin:3px 0 7px}.compass-neighbors-heading strong{color:var(--compass-faint);font-size:10px}.compass-neighbors-list{max-height:154px;overflow-y:auto}.compass-neighbor-link{width:100%;min-height:36px;color:var(--muted-foreground);text-align:left;background:0 0;border:0;border-radius:3px;align-items:center;gap:9px;margin:3px 0;padding:8px 9px;display:flex;overflow:hidden}.compass-neighbor-link:hover{background:var(--workbench-hover);color:var(--foreground)}.compass-neighbor-dot{width:8px;height:8px;box-shadow:0 0 0 1px var(--foreground);border-radius:50%;flex:none}@supports (color:color-mix(in lab,red,red)){.compass-neighbor-dot{box-shadow:0 0 0 1px color-mix(in srgb,var(--foreground) 10%,transparent)}}.compass-neighbor-label{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.compass-empty{color:var(--compass-faint);padding:8px 0;font-size:12px;display:block}.compass-community-panel{flex:1;min-height:0;padding:16px;overflow-y:auto}.compass-community-panel h2{margin-bottom:10px}.compass-community-panel[data-secondary=true]{flex:0 auto;padding-top:12px}.compass-community-panel details>summary{cursor:pointer;min-height:30px;color:var(--muted-foreground);letter-spacing:.1em;text-transform:uppercase;justify-content:space-between;align-items:center;font-size:11px;font-weight:700;display:flex}.compass-community-panel details>summary span{color:var(--compass-faint);font:9px/1 var(--compass-font-mono)}.compass-community-controls{min-height:0}.compass-community-search{align-items:center;margin:2px 0 8px;display:flex;position:relative}.compass-community-search>svg{width:13px;height:13px;color:var(--compass-faint);pointer-events:none;position:absolute;left:8px}.compass-community-search input{border:1px solid var(--compass-line);background:var(--vscode-input-background,var(--background));width:100%;height:30px;color:var(--foreground);font:11px/1.3 var(--compass-font-sans);border-radius:3px;padding:0 8px 0 28px}.compass-community-limit{color:var(--compass-faint);margin:8px 0 0;font-size:10px;line-height:1.45}.compass-community-control,.compass-community-item{min-height:34px;color:var(--muted-foreground);align-items:center;gap:8px;font-size:12px;display:flex}.compass-community-item{border-radius:3px}.compass-community-item:hover{background:var(--workbench-hover);color:var(--foreground)}.compass-community-item[data-hidden=true]{opacity:.36}.compass-community-item input,.compass-community-control input{width:15px;height:15px;accent-color:var(--compass-focus)}.compass-community-dot{border-radius:50%;flex:none;width:9px;height:9px}.compass-community-label{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.compass-community-item small{color:var(--compass-faint);font-size:10px}.compass-graph-stats{border-top:1px solid var(--compass-line);color:var(--compass-faint);letter-spacing:.025em;padding:11px 16px;font-size:10px}.compass-node-hover-card{z-index:7;top:clamp(86px,var(--compass-hover-y),calc(100% - 10rem));left:clamp(12px,var(--compass-hover-x),calc(100% - min(27rem,90%) - 12px));border:1px solid var(--compass-line-strong);background:var(--vscode-editorHoverWidget-background,var(--compass-panel));width:max-content;max-width:min(26rem,100% - 24px);color:var(--vscode-editorHoverWidget-foreground,var(--muted-foreground));box-shadow:0 4px 12px var(--vscode-widget-shadow,#00000047);pointer-events:none;border-radius:3px;gap:7px;padding:13px 15px;font-size:12px;line-height:1.35;display:grid;position:absolute;overflow:hidden}.compass-node-hover-card>.compass-change-badge{margin:0}.compass-hover-heading{align-items:center;gap:8px;display:flex}.compass-hover-heading strong{min-width:0;color:var(--foreground);text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.compass-hover-heading span{background:var(--compass-success);border-radius:999px;width:max-content;padding:3px 7px}@supports (color:color-mix(in lab,red,red)){.compass-hover-heading span{background:color-mix(in srgb,var(--compass-success) 20%,transparent)}}.compass-hover-heading span{color:var(--compass-success);letter-spacing:.07em;font-size:9px;font-weight:800}.compass-node-hover-card p,.compass-node-hover-card code{display:block}.compass-hover-source{color:var(--compass-focus)}.compass-node-hover-card code{max-width:395px;color:var(--foreground);font-family:var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.compass-edge-hover-card{z-index:8;top:clamp(86px,var(--compass-hover-y),calc(100% - 15rem));left:clamp(12px,var(--compass-hover-x),calc(100% - min(31rem,92%) - 12px));border:1px solid var(--compass-line-strong);background:var(--vscode-editorHoverWidget-background,var(--compass-panel));width:min(31rem,100% - 24px);color:var(--vscode-editorHoverWidget-foreground,var(--muted-foreground));box-shadow:0 8px 24px var(--vscode-widget-shadow,#00000057);pointer-events:none;border-radius:4px;gap:10px;padding:13px 15px;font-size:11px;line-height:1.35;animation:90ms ease-out both compass-edge-card-enter;display:grid;position:absolute;overflow:hidden}@keyframes compass-edge-card-enter{0%{opacity:0;transform:translateY(3px)}}.compass-edge-hover-heading,.compass-edge-relation-row{justify-content:space-between;align-items:center;gap:10px;display:flex}.compass-edge-hover-eyebrow{color:var(--compass-faint);letter-spacing:.09em;text-transform:uppercase;align-items:center;gap:6px;font-size:9px;font-weight:750;display:inline-flex}.compass-edge-hover-eyebrow svg{width:12px;height:12px;color:var(--compass-focus)}.compass-edge-confidence{border:1px solid;padding:3px 7px}@supports (color:color-mix(in lab,red,red)){.compass-edge-confidence{border:1px solid color-mix(in srgb,currentColor 28%,transparent)}}.compass-edge-confidence{background:currentColor;border-radius:999px}@supports (color:color-mix(in lab,red,red)){.compass-edge-confidence{background:color-mix(in srgb,currentColor 11%,transparent)}}.compass-edge-confidence{color:var(--compass-faint);letter-spacing:.055em;text-transform:uppercase;font-size:9px;font-weight:800}.compass-edge-confidence[data-confidence=extracted]{color:var(--compass-success)}.compass-edge-confidence[data-confidence=inferred]{color:var(--compass-focus)}.compass-edge-confidence[data-confidence=ambiguous]{color:var(--compass-warning)}.compass-edge-confidence[data-confidence=aggregated]{color:var(--compass-faint)}.compass-edge-trace{border:1px solid var(--compass-line);background:var(--compass-focus);border-radius:3px;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:9px;min-width:0;padding:9px 10px;display:grid}@supports (color:color-mix(in lab,red,red)){.compass-edge-trace{background:color-mix(in srgb,var(--compass-focus) 7%,transparent)}}.compass-edge-trace strong{min-width:0;color:var(--foreground);font:600 11px/1.35 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.compass-edge-trace strong:last-child{text-align:right}.compass-edge-trace>span{border:1px solid var(--compass-focus);place-items:center;width:22px;height:22px;display:grid}@supports (color:color-mix(in lab,red,red)){.compass-edge-trace>span{border:1px solid color-mix(in srgb,var(--compass-focus) 38%,transparent)}}.compass-edge-trace>span{background:var(--vscode-editorHoverWidget-background,var(--compass-panel));color:var(--compass-focus);border-radius:50%}.compass-edge-trace svg{width:12px;height:12px}.compass-edge-relation-row>strong{color:var(--foreground);font-size:12px;font-weight:700}.compass-edge-relation-row>.compass-change-badge{margin:0}.compass-edge-metadata{gap:5px;padding-top:1px;display:grid}.compass-edge-metadata p{grid-template-columns:54px minmax(0,1fr);align-items:baseline;gap:8px;display:grid}.compass-edge-metadata span{color:var(--compass-faint);letter-spacing:.06em;text-transform:uppercase;font-size:9px;font-weight:700}.compass-edge-metadata code{min-width:0;color:var(--vscode-textLink-foreground,var(--compass-focus));font:10px/1.4 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}body.vscode-high-contrast .compass-glass-panel,body.vscode-high-contrast .compass-graph-inspector,body.vscode-high-contrast .compass-inspector-resizer,body.vscode-high-contrast .compass-load-action,body.vscode-high-contrast .compass-load-step>i,body.vscode-high-contrast .compass-source-metadata,body.vscode-high-contrast .compass-node-hover-card,body.vscode-high-contrast .compass-edge-hover-card,body.vscode-high-contrast-light .compass-glass-panel,body.vscode-high-contrast-light .compass-graph-inspector,body.vscode-high-contrast-light .compass-inspector-resizer,body.vscode-high-contrast-light .compass-load-action,body.vscode-high-contrast-light .compass-load-step>i,body.vscode-high-contrast-light .compass-source-metadata,body.vscode-high-contrast-light .compass-node-hover-card,body.vscode-high-contrast-light .compass-edge-hover-card{border-width:2px;border-color:var(--vscode-contrastBorder,var(--compass-focus))}body.vscode-high-contrast .compass-load-logo,body.vscode-high-contrast-light .compass-load-logo{color:var(--vscode-contrastBorder,currentColor)}@media(max-width:980px){.compass-tool-button span{display:none}.compass-tool-button{padding:0 11px}}@media(max-width:760px){.compass-workspace{height:auto;min-height:100vh;overflow:auto}.compass-workspace-content,.compass-workspace-content[data-inspector-collapsed=true]{height:auto;min-height:inherit;grid-template-rows:minmax(360px,62vh) minmax(280px,40vh);grid-template-columns:1fr;overflow:visible}.compass-workspace-content[data-inspector-collapsed=true]{grid-template-rows:minmax(360px,calc(100vh - 48px)) 48px}.compass-inspector-resizer{display:none}.compass-graph-inspector{border-top:1px solid var(--compass-line);min-height:280px;box-shadow:none;border-left:0;border-radius:0}.compass-graph-inspector-collapsed{border-radius:0;flex-direction:row;justify-content:center;min-height:48px}.compass-inspector-expand{margin-top:0}.compass-inspector-rail-label{writing-mode:horizontal-tb;margin-top:0;margin-left:10px}.compass-graph-toolbar{top:12px;left:12px;right:12px}.compass-toolbar-actions{max-width:62%;overflow-x:auto}.compass-explore-panel{max-height:calc(62vh - 82px)}.compass-info-panel{max-height:none}}@media(prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}.compass-load-logo,.compass-load-progress i,.architecture-load-skeleton span,.workbench-state-spinner{animation:none!important}}.architecture-shell{background:var(--background);height:100vh;color:var(--foreground);grid-template-columns:minmax(220px,280px) minmax(0,1fr);display:grid}.query-shell{--query-surface:var(--vscode-editor-background,var(--background));--query-surface-raised:var(--vscode-editorWidget-background,var(--vscode-sideBar-background,var(--card)));--query-border:var(--vscode-panel-border,var(--border));--query-input:var(--vscode-input-background,var(--background));--query-input-foreground:var(--vscode-input-foreground,var(--foreground));--query-accent:var(--vscode-focusBorder,var(--ring));background:var(--background);height:100vh;min-height:420px;color:var(--foreground);grid-template-rows:auto 1fr;display:grid;overflow:hidden}.query-header{border-bottom:1px solid var(--query-border);background:var(--query-surface);padding:14px 18px 16px}.query-heading-row{justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.query-context{color:var(--muted-foreground);font:10px/1.35 var(--compass-font-mono);letter-spacing:.04em;text-transform:uppercase}.query-heading-row h1{margin:3px 0 0;font-size:16px;font-weight:600;line-height:1.3}.query-mode{border-bottom:1px solid var(--query-border);background:0 0;gap:0;width:100%;margin-top:14px;display:flex;overflow-x:auto}.query-mode button{min-width:min(250px,42vw);min-height:48px;color:var(--muted-foreground);font:inherit;text-align:left;background:0 0;border:0;border-radius:0;flex:1 0 220px;grid-template-columns:18px minmax(0,1fr);align-items:center;gap:8px;padding:7px 12px 8px;display:grid;position:relative}.query-mode-indicator{background:var(--query-accent);height:3px;box-shadow:0 1px 5px var(--query-accent);position:absolute;top:0;left:0;right:0}@supports (color:color-mix(in lab,red,red)){.query-mode-indicator{box-shadow:0 1px 5px color-mix(in srgb,var(--query-accent) 35%,transparent)}}.query-mode-indicator{opacity:0;pointer-events:none}.query-mode button:hover{background:var(--workbench-hover);color:var(--foreground)}.query-mode button[aria-selected=true]{background:var(--vscode-tab-activeBackground,var(--query-surface-raised));box-shadow:inset 1px 0 var(--query-border),inset -1px 0 var(--query-border);color:var(--vscode-tab-activeForeground,var(--foreground))}.query-mode button[aria-selected=true] .query-mode-indicator,.query-mode button[aria-selected=true] svg,.query-mode button[aria-selected=true] strong{opacity:1}.query-mode svg{width:15px;height:15px}.query-mode button>span,.query-mode strong,.query-mode small{min-width:0;display:block}.query-mode strong{font-size:12px;font-weight:600;line-height:1.3}.query-mode small{color:inherit;opacity:.78;text-overflow:ellipsis;white-space:nowrap;margin-top:2px;font-size:10px;font-weight:400;line-height:1.3;overflow:hidden}.query-composer-panel{border:1px solid var(--query-border);background:var(--query-surface-raised);border-top:0;padding:12px}.query-composer{display:block}.query-editor-shell{border:1px solid var(--vscode-input-border,var(--border));background:var(--query-input);color:var(--query-input-foreground);border-radius:3px;overflow:hidden}.query-editor-shell:focus-within{border-color:var(--ring);outline:1px solid var(--ring);outline-offset:-1px}.query-editor{min-width:0;position:relative}.query-editor textarea{resize:vertical;background:var(--query-input);width:100%;min-height:96px;max-height:260px;color:inherit;font:13px/1.55 var(--compass-font-sans);box-sizing:border-box;border:0;border-radius:0;outline:none;padding:11px 12px;display:block}.query-composer-panel[data-mode=cql] .query-editor textarea,.query-composer-panel[data-mode=explain] .query-editor textarea{font-family:var(--compass-font-mono);font-size:12px}.query-editor textarea::placeholder,.query-params input::placeholder{color:var(--vscode-input-placeholderForeground,var(--muted-foreground))}.query-suggestions{border-top:1px solid var(--query-border);background:var(--vscode-editorSuggestWidget-background,var(--query-surface-raised));max-height:210px;color:var(--vscode-editorSuggestWidget-foreground,var(--foreground));display:grid;overflow-y:auto}.query-suggestions-label,.query-suggestions-hint{color:var(--vscode-descriptionForeground,var(--muted-foreground));font:9px/1.2 var(--compass-font-sans);padding:6px 10px}.query-suggestions-label{letter-spacing:.06em;text-transform:uppercase}.query-suggestions-hint{border-top:1px solid var(--query-border);text-align:right}.query-suggestions button{min-width:0;color:inherit;font:inherit;text-align:left;background:0 0;border:0;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:16px;padding:7px 10px;display:grid}.query-suggestions button[aria-selected=true],.query-suggestions button:hover{background:var(--vscode-editorSuggestWidget-selectedBackground,var(--accent));color:var(--vscode-editorSuggestWidget-selectedForeground,var(--foreground))}.query-suggestions button>span{font:11px/1.35 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.query-suggestions button>small{color:var(--vscode-descriptionForeground,var(--muted-foreground));white-space:nowrap;font-size:10px}.query-completion-status{border-top:1px solid var(--query-border);background:var(--vscode-editorSuggestWidget-background,var(--query-surface-raised));min-width:0;min-height:34px;color:var(--vscode-descriptionForeground,var(--muted-foreground));justify-content:space-between;align-items:center;gap:12px;padding-block:7px;padding-inline:10px;font-size:10px;display:flex}.query-completion-status>span{overflow-wrap:anywhere;min-width:0}.query-completion-status button{border:1px solid var(--vscode-button-border,var(--query-border));background:var(--vscode-button-secondaryBackground,var(--secondary));color:var(--vscode-button-secondaryForeground,var(--secondary-foreground));font:inherit;border-radius:3px;flex:none;padding:3px 7px}.query-completion-status button:hover{background:var(--vscode-button-secondaryHoverBackground,var(--workbench-hover))}.query-params input:focus-visible{border-color:var(--ring);outline:1px solid var(--ring);outline-offset:-1px}.query-composer-footer{border-top:1px solid var(--query-border);background:var(--query-surface);align-items:center;gap:12px;min-height:40px;padding:5px 6px 5px 10px;display:flex}.query-footer-actions{flex:none;justify-content:flex-end;align-items:center;gap:8px;margin-left:auto;display:flex}.query-shortcut{color:var(--vscode-disabledForeground,var(--compass-faint));font:10px/1 var(--compass-font-sans);white-space:nowrap}.query-run{border:1px solid var(--vscode-button-border,transparent);background:var(--vscode-button-background,var(--primary));min-width:76px;min-height:30px;color:var(--vscode-button-foreground,var(--primary-foreground));font:inherit;border-radius:3px;justify-content:center;align-items:center;gap:6px;padding:5px 11px;font-size:12px;display:flex}.query-run:hover:not(:disabled){background:var(--vscode-button-hoverBackground,var(--primary))}.query-run:disabled{background:var(--vscode-button-secondaryBackground,var(--secondary));color:var(--vscode-disabledForeground,var(--compass-faint))}.query-run svg{width:13px;height:13px}.query-params{min-width:0;max-width:620px;color:var(--muted-foreground);flex:520px;align-items:center;gap:8px;font-size:10px;display:flex}.query-params>span{flex:none}.query-params input{border:1px solid var(--vscode-input-border,var(--border));background:var(--vscode-input-background,var(--input));min-width:0;max-width:520px;height:28px;color:var(--vscode-input-foreground,var(--foreground));font:11px var(--compass-font-mono);border-radius:3px;outline:none;flex:260px;padding:3px 8px}.query-examples{align-items:center;gap:5px;margin-top:9px;display:flex;overflow-x:auto}.query-examples>span{color:var(--muted-foreground);text-transform:uppercase;flex:none;font-size:10px;font-weight:600}.query-examples button,.query-history button{border:1px solid var(--border);color:var(--muted-foreground);font:inherit;white-space:nowrap;background:0 0;border-radius:3px;padding:4px 7px;font-size:10px}.query-examples button:hover,.query-history button:hover{background:var(--workbench-hover);color:var(--foreground)}.query-results{grid-template-rows:auto minmax(0,1fr);min-height:0;padding:0;display:grid;overflow:hidden}.query-result-stage{min-height:0;padding:clamp(12px,2vw,22px);overflow:auto}.query-result-stage>.workbench-state{min-height:100%}.query-result-tabs{border-bottom:1px solid var(--query-border);background:var(--vscode-editorGroupHeader-tabsBackground,var(--query-surface-raised));min-width:0;display:flex;overflow-x:auto}.query-result-tab{border-right:1px solid var(--query-border);background:var(--vscode-tab-inactiveBackground,transparent);grid-template-columns:minmax(0,1fr) 26px;min-width:150px;max-width:300px;display:grid}.query-result-tab:has([aria-selected=true]){background:var(--vscode-tab-activeBackground,var(--query-surface));box-shadow:inset 0 2px var(--vscode-tab-activeBorderTop,var(--query-accent))}.query-result-tab[data-status=error]{box-shadow:inset 0 2px var(--vscode-testing-iconFailed,var(--destructive))}.query-result-tab>[role=tab]{min-width:0;color:var(--vscode-tab-inactiveForeground,var(--muted-foreground));font:inherit;text-align:left;background:0 0;border:0;gap:1px;padding:7px 4px 7px 10px;display:grid;overflow:hidden}.query-result-tab>[role=tab][aria-selected=true]{color:var(--vscode-tab-activeForeground,var(--foreground))}.query-result-tab>[role=tab] span{color:var(--query-accent);font:9px/1.2 var(--compass-font-mono);letter-spacing:.05em;text-transform:uppercase}.query-result-tab>[role=tab] strong{text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:500;line-height:1.3;overflow:hidden}.query-result-close{width:22px;height:22px;color:var(--muted-foreground);background:0 0;border:0;border-radius:3px;align-self:center;place-items:center;padding:0;display:grid}.query-result-close:hover{background:var(--workbench-hover);color:var(--foreground)}.query-result-close svg{width:13px;height:13px}.query-result{width:min(1180px,100%);margin:0 auto}.query-result>header{justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:9px;display:flex}.query-result>header span{color:var(--muted-foreground);font-size:10px}.query-result>header>span{font-family:var(--compass-font-mono);align-items:center;gap:5px;display:flex}.query-result>header svg{width:12px;height:12px}.query-result h2{margin:2px 0 0;font-size:14px;font-weight:600}.query-text-result,.query-json-result{border:1px solid var(--border);background:var(--vscode-textCodeBlock-background,var(--card));min-height:120px;color:var(--foreground);font:12px/1.6 var(--compass-font-mono);white-space:pre-wrap;overflow-wrap:anywhere;border-radius:3px;margin:0;padding:12px;overflow:auto}.query-prose-result{border:1px solid var(--query-border);background:var(--query-surface-raised);color:var(--foreground);border-radius:3px;padding:14px 16px;font-size:13px;line-height:1.65}.query-prose-result p,.query-prose-result ul{margin:0}.query-prose-result p+p,.query-prose-result p+ul,.query-prose-result ul+p{margin-top:10px}.query-prose-result ul{padding-left:20px}.query-traversal-result,.query-typed-result,.query-explanation{gap:10px;display:grid}.query-diagnostics{border:1px solid var(--query-border);border-left:3px solid var(--vscode-editorWarning-foreground,#cca700);background:var(--query-surface-raised);display:grid;overflow:hidden}.query-diagnostics>h3{border-bottom:1px solid var(--query-border);margin:0;padding:8px 11px;font-size:11px;font-weight:600}.query-diagnostics article{border-bottom:1px solid var(--query-border);grid-template-columns:16px minmax(0,1fr);gap:8px;min-width:0;padding:9px 11px;display:grid}.query-diagnostics article:last-child{border-bottom:0}.query-diagnostics article>svg{width:14px;height:14px;color:var(--vscode-editorWarning-foreground,#cca700);margin-top:1px}.query-diagnostics strong,.query-diagnostics p{overflow-wrap:anywhere;margin:0}.query-diagnostics strong{font-size:11px}.query-diagnostics p{color:var(--muted-foreground);margin-top:2px;font-size:11px;line-height:1.45}.query-explanation-card{border:1px solid var(--query-border);border-left:3px solid var(--query-accent);background:var(--query-surface-raised);grid-template-columns:minmax(180px,1fr) minmax(220px,1fr);gap:12px 18px;min-width:0;padding:13px 14px;display:grid}.query-explanation-card>div>span{color:var(--query-accent);font:9px/1.2 var(--compass-font-mono);letter-spacing:.05em;text-transform:uppercase}.query-explanation-card h3{margin:3px 0 4px;font-size:14px}.query-explanation-card code{color:var(--muted-foreground);font:10px/1.4 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.query-explanation-card>.query-source-action{align-self:center}.query-explanation-card dl{border-top:1px solid var(--query-border);grid-column:1/-1;gap:18px;margin:0;padding-top:10px;display:flex}.query-explanation-card dl>div{gap:6px;display:flex}.query-explanation-card dt,.query-explanation-card dd{margin:0;font-size:10px}.query-explanation-card dt{color:var(--muted-foreground)}.query-connections{border:1px solid var(--query-border);background:var(--query-surface);overflow:hidden}.query-connections>h3{border-bottom:1px solid var(--query-border);margin:0;padding:8px 11px;font-size:11px}.query-connections>h3 span{color:var(--muted-foreground);margin-left:4px;font-weight:400}.query-connections article{border-bottom:1px solid var(--query-border);grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:8px;padding:8px 10px;display:grid}.query-connections article:last-child{border-bottom:0}.query-connections article>svg{width:14px;color:var(--query-accent)}.query-connections strong,.query-connections p{margin:0;font-size:11px}.query-connections p,.query-connections article>span{color:var(--muted-foreground);font-size:9px}.query-connections article>span{font-family:var(--compass-font-mono);text-transform:uppercase}.query-guidance{border:1px solid var(--query-border);background:var(--query-surface-raised);color:var(--muted-foreground);margin:0;padding:9px 11px;font-size:11px}.query-object-result{border:1px solid var(--query-border);background:var(--query-surface);margin:0;display:grid;overflow:hidden}.query-object-result>div{border-bottom:1px solid var(--query-border);grid-template-columns:minmax(120px,.28fr) minmax(0,1fr);display:grid}.query-object-result>div:last-child{border-bottom:0}.query-object-result dt,.query-object-result dd{overflow-wrap:anywhere;margin:0;padding:8px 10px}.query-object-result dt{color:var(--muted-foreground);text-transform:capitalize;font-size:10px}.query-object-result dd{border-left:1px solid var(--query-border);font:11px/1.5 var(--compass-font-mono);white-space:pre-wrap}.query-traversal-summary{border:1px solid var(--query-border);border-left:3px solid var(--query-accent);background:var(--query-surface-raised);justify-content:space-between;align-items:center;gap:16px;min-height:54px;padding:10px 12px;display:flex}.query-traversal-summary p{color:var(--foreground);margin:0;font-size:12px;font-weight:600}.query-result-metrics{color:var(--muted-foreground);flex-wrap:wrap;gap:5px 14px;margin-top:5px;font-size:10px;display:flex}.query-result-metrics strong{color:var(--foreground);font-weight:600}.query-graph-action{border:1px solid var(--vscode-button-border,transparent);background:var(--vscode-button-secondaryBackground,var(--secondary));min-height:30px;color:var(--vscode-button-secondaryForeground,var(--secondary-foreground));font:11px var(--compass-font-sans);border-radius:3px;flex:none;align-items:center;gap:6px;padding:5px 9px;display:inline-flex}.query-graph-action:hover{background:var(--vscode-button-secondaryHoverBackground,var(--workbench-hover))}.query-graph-action svg{width:14px;height:14px}.query-node-results{border:1px solid var(--query-border);background:var(--query-surface);border-radius:3px;overflow:hidden}.query-node-result{border-bottom:1px solid var(--query-border);grid-template-columns:18px minmax(160px,.72fr) minmax(240px,1.28fr);align-items:center;gap:9px;min-width:0;min-height:48px;padding:7px 10px;display:grid}.query-node-result:last-child{border-bottom:0}.query-node-result:hover{background:var(--workbench-hover)}.query-node-result>svg{width:14px;height:14px;color:var(--vscode-symbolIcon-functionForeground,var(--query-accent))}.query-node-copy,.query-node-copy h3,.query-node-copy p{min-width:0}.query-node-copy h3,.query-node-copy p{text-overflow:ellipsis;white-space:nowrap;margin:0;overflow:hidden}.query-node-copy h3{color:var(--vscode-editor-foreground,var(--foreground));font-size:12px;font-weight:600}.query-node-copy p{color:var(--muted-foreground);margin-top:2px;font-size:10px}.query-source-action{min-width:0;color:var(--workbench-link);font:10px/1.4 var(--compass-font-mono);text-align:left;background:0 0;border:1px solid #0000;border-radius:3px;justify-content:space-between;align-items:center;gap:8px;padding:5px 7px;display:flex;overflow:hidden}.query-source-action:hover{border-color:var(--query-border);background:var(--vscode-editorHoverWidget-background,var(--query-surface-raised))}.query-source-action span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.query-source-action small{color:var(--muted-foreground);font:10px var(--compass-font-mono);flex:none}.query-source-missing{color:var(--vscode-disabledForeground,var(--compass-faint));font:10px var(--compass-font-mono)}.query-table{border:1px solid var(--border);border-radius:3px;overflow:auto}.query-table table{border-collapse:collapse;width:100%;min-width:480px;font-size:11px}.query-table thead{background:var(--workbench-table-header);position:sticky;top:0}.query-table th,.query-table td{border-bottom:1px solid var(--border);text-align:left;text-overflow:ellipsis;white-space:nowrap;max-width:380px;padding:7px 9px;overflow:hidden}.query-table th{color:var(--muted-foreground);font-weight:500}.query-table tbody tr:hover{background:var(--workbench-hover)}.query-table tr:last-child td{border-bottom:0}.query-empty{place-content:center;display:grid}.query-history{text-align:center;width:min(720px,100vw - 40px);margin:-28px auto 20px}.query-history h2{color:var(--muted-foreground);margin:0 0 7px;font-size:10px;font-weight:500}.query-history button{text-overflow:ellipsis;max-width:min(100%,460px);margin:2px;overflow:hidden}.query-shell button:focus-visible{outline:2px solid var(--ring);outline-offset:1px}body.vscode-high-contrast .query-mode,body.vscode-high-contrast-light .query-mode,body.vscode-high-contrast .query-text-result,body.vscode-high-contrast-light .query-text-result,body.vscode-high-contrast .query-json-result,body.vscode-high-contrast-light .query-json-result,body.vscode-high-contrast .query-table,body.vscode-high-contrast-light .query-table,body.vscode-high-contrast .query-composer-panel,body.vscode-high-contrast-light .query-composer-panel,body.vscode-high-contrast .query-editor-shell,body.vscode-high-contrast-light .query-editor-shell,body.vscode-high-contrast .query-prose-result,body.vscode-high-contrast-light .query-prose-result,body.vscode-high-contrast .query-traversal-summary,body.vscode-high-contrast-light .query-traversal-summary,body.vscode-high-contrast .query-node-results,body.vscode-high-contrast-light .query-node-results,body.vscode-high-contrast .query-diagnostics,body.vscode-high-contrast-light .query-diagnostics,body.vscode-high-contrast .query-explanation-card,body.vscode-high-contrast-light .query-explanation-card,body.vscode-high-contrast .query-connections,body.vscode-high-contrast-light .query-connections,body.vscode-high-contrast .query-object-result,body.vscode-high-contrast-light .query-object-result,body.vscode-high-contrast .query-suggestions,body.vscode-high-contrast-light .query-suggestions,body.vscode-high-contrast .query-completion-status,body.vscode-high-contrast-light .query-completion-status{border-width:2px;border-color:var(--vscode-contrastBorder,var(--ring))}body.vscode-high-contrast .query-mode button[aria-selected=true],body.vscode-high-contrast-light .query-mode button[aria-selected=true]{border:2px solid var(--vscode-contrastBorder,var(--ring));border-bottom:0}.history-shell{background:var(--background);height:100vh;min-height:440px;color:var(--foreground);grid-template-columns:minmax(270px,340px) minmax(0,1fr);display:grid;overflow:hidden}.history-bootstrap{background:var(--vscode-editor-background,var(--background));place-items:center;min-height:100vh;display:grid}.history-sidebar{border-right:1px solid var(--border);background:var(--sidebar);min-width:0;min-height:0;color:var(--sidebar-foreground);flex-direction:column;display:flex}.history-sidebar-header{border-bottom:1px solid var(--border);flex:none;padding:14px 12px 12px}.history-title{align-items:flex-start;gap:9px;display:flex}.history-title>svg{width:16px;height:16px;color:var(--muted-foreground);margin-top:1px}.history-title h1{margin:0;font-size:13px;font-weight:600;line-height:1.25}.history-title p{color:var(--muted-foreground);margin:3px 0 0;font-size:11px}.history-search{align-items:center;margin-top:12px;display:flex;position:relative}.history-search>svg{width:14px;height:14px;color:var(--vscode-input-placeholderForeground,var(--muted-foreground));pointer-events:none;position:absolute;left:8px}.history-search input,.history-mobile-select select{border:1px solid var(--vscode-input-border,transparent);background:var(--vscode-input-background,var(--input));width:100%;min-height:28px;color:var(--vscode-input-foreground,var(--foreground));font:inherit;border-radius:2px;outline:none;font-size:12px}.history-search input{padding:4px 8px 4px 28px}.history-search input::placeholder{color:var(--vscode-input-placeholderForeground,var(--muted-foreground))}.history-search input:focus-visible,.history-mobile-select select:focus-visible,.history-rail:focus-visible,.history-commit:focus-visible{border-color:var(--ring);outline:1px solid var(--ring);outline-offset:-1px}.history-mobile-select{display:none}.history-rail{outline:none;flex:auto;min-height:0;overflow:auto}.history-pagination{border-top:1px solid var(--border);color:var(--muted-foreground);flex:none;justify-items:start;gap:6px;padding:8px 10px;font-size:11px;display:grid}.history-pagination [role=alert]{color:var(--destructive)}.history-commit{border:0;border-bottom:1px solid var(--border);width:100%;color:inherit;text-align:left;background:0 0;border-radius:0;align-items:center;gap:.625rem;padding:8px 11px;display:flex;position:absolute;left:0;right:0}.history-commit:hover{background:var(--workbench-hover);color:var(--workbench-hover-foreground)}.history-commit[aria-selected=true]{background:var(--sidebar-accent);color:var(--sidebar-accent-foreground);box-shadow:inset 2px 0 var(--sidebar-primary)}.history-commit>svg{width:15px;height:15px;color:var(--muted-foreground);flex:none}.history-commit>svg[data-state=available]{color:var(--compass-success)}.history-commit>svg[data-state=building]{color:var(--vscode-progressBar-background,var(--ring))}.history-commit>svg[data-state=failed]{color:var(--destructive)}.history-commit-row-copy,.history-commit-subject,.history-commit-byline{min-width:0}.history-commit-row-copy{flex:1;display:block}.history-commit-subject{text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:1.4;display:block;overflow:hidden}.history-commit-byline{color:var(--muted-foreground);white-space:nowrap;align-items:center;gap:5px;margin-top:3px;font-size:10px;display:flex;overflow:hidden}.history-commit[aria-selected=true] .history-commit-byline{color:currentColor}@supports (color:color-mix(in lab,red,red)){.history-commit[aria-selected=true] .history-commit-byline{color:color-mix(in srgb,currentColor 72%,transparent)}}.history-commit-byline code{color:inherit;font-family:var(--compass-font-mono)}.history-commit-byline span{text-overflow:ellipsis;overflow:hidden}.history-commit-byline time{margin-left:auto}.history-content{background:var(--vscode-editor-background,var(--background));min-width:0;min-height:0;padding:16px;overflow:auto}.history-commit-details{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));padding:14px}.history-commit-heading{justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.history-commit-copy{min-width:0}.history-eyebrow{color:var(--muted-foreground);letter-spacing:.06em;text-transform:uppercase;font-size:10px;font-weight:600;display:block}.history-commit-copy h2{overflow-wrap:anywhere;margin:4px 0 0;font-size:16px;font-weight:600;line-height:1.35}.history-commit-metadata{color:var(--muted-foreground);flex-wrap:wrap;gap:4px 12px;margin-top:7px;font-size:11px;display:flex}.history-commit-metadata code{color:var(--vscode-textLink-foreground,var(--workbench-link));font-family:var(--compass-font-mono)}.history-state-badge{text-transform:capitalize;border-radius:2px;flex:none}.history-commit-actions,.history-change-counts{flex-wrap:wrap;margin-top:12px;display:flex}.history-commit-actions{align-items:flex-end;gap:10px}.history-change-counts{gap:6px}.history-change-counts-help{color:var(--vscode-descriptionForeground,#9aa7b7);margin:-.15rem 0 0;font-size:.78rem;line-height:1.45}.history-commit-actions:empty{display:none}.history-commit-actions button{border-radius:2px}.history-comparison-control{grid-template-columns:minmax(180px,1fr) auto;gap:5px 7px;min-width:min(100%,440px);display:grid}.history-comparison-control label{color:var(--muted-foreground);letter-spacing:.04em;text-transform:uppercase;grid-column:1/-1;font-size:10px;font-weight:600}.history-comparison-control select{border:1px solid var(--vscode-dropdown-border,var(--border));background:var(--vscode-dropdown-background,var(--background));min-width:0;height:28px;color:var(--vscode-dropdown-foreground,var(--foreground));border-radius:2px;outline:none;padding:0 26px 0 8px;font-size:11px}.history-comparison-control select option{background:var(--vscode-dropdown-background,var(--background));color:var(--vscode-dropdown-foreground,var(--foreground))}.history-comparison-control select:focus-visible{border-color:var(--vscode-focusBorder,var(--ring));outline:1px solid var(--vscode-focusBorder,var(--ring));outline-offset:-1px}.history-comparison-control select:disabled{color:var(--vscode-disabledForeground,var(--muted-foreground));cursor:not-allowed}.history-comparison-help,.history-inline-error{color:var(--muted-foreground);margin:9px 0 0;font-size:11px;line-height:1.45}.history-inline-error{color:var(--destructive)}.history-change-counts{color:var(--muted-foreground);font-size:11px}.history-change-counts span{border:1px solid var(--border);background:var(--vscode-badge-background,var(--muted));color:var(--vscode-badge-foreground,var(--foreground));border-radius:2px;padding:3px 6px}.history-change-counts strong{font-weight:600}.history-comparison,.history-diff-evidence{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));color:var(--vscode-editor-foreground,var(--foreground));margin-top:12px}.history-comparison{box-shadow:inset 3px 0 0 var(--vscode-focusBorder,var(--ring))}.history-comparison-heading{grid-template-columns:18px minmax(0,1fr) auto;align-items:start;gap:8px;padding:11px 12px 9px;display:grid}.history-comparison-heading>svg,.history-diff-heading>svg{width:15px;height:15px;color:var(--vscode-focusBorder,var(--ring));margin-top:2px}.history-comparison-heading h2{color:var(--vscode-editor-foreground,var(--foreground));margin:2px 0 0;font-size:13px;font-weight:600}.history-comparison-heading code{color:var(--vscode-textLink-foreground,var(--workbench-link));font-family:var(--compass-font-mono);background:0 0}.history-comparison-heading button{border:1px solid var(--border);min-height:26px;color:var(--foreground);background:0 0;border-radius:2px;align-items:center;gap:5px;padding:3px 7px;font-size:10px;display:inline-flex}.history-comparison-heading button:hover{border-color:var(--vscode-focusBorder,var(--ring));background:var(--workbench-hover)}.history-comparison-heading button svg{width:12px;height:12px}.history-comparison-legend{font:10px/1.4 var(--compass-font-mono);flex-wrap:wrap;gap:6px;padding:0 12px 10px 38px;display:flex}.history-delta-card{border:1px solid var(--border);background:var(--vscode-editor-foreground,var(--foreground));border-radius:2px;gap:4px;min-width:200px;padding:6px 8px;display:grid}@supports (color:color-mix(in lab,red,red)){.history-delta-card{background:color-mix(in srgb,var(--vscode-editor-foreground,var(--foreground)) 5%,var(--vscode-editor-background,var(--background)))}}.history-delta-card{color:var(--vscode-editor-foreground,var(--foreground))}.history-delta-card>span{flex-wrap:wrap;gap:5px 10px;display:flex}.history-delta-card strong{color:var(--vscode-editor-foreground,var(--foreground));text-transform:capitalize}.history-delta-card i{font-style:normal;font-weight:600}.history-delta-card i small{color:var(--muted-foreground);font-size:9px;font-weight:400}.history-delta-card i[data-change=added]{color:var(--vscode-gitDecoration-addedResourceForeground,#2ea043)}.history-delta-card i[data-change=removed]{color:var(--vscode-gitDecoration-deletedResourceForeground,#f85149)}.history-delta-card i[data-change=changed]{color:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922)}.history-comparison-empty{border-top:1px solid var(--border);color:var(--muted-foreground);gap:2px;padding:9px 12px 10px 38px;font-size:11px;display:grid}.history-comparison-empty strong{color:var(--foreground);font-size:12px}.history-comparison-workspace{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));min-width:0;color:var(--vscode-editor-foreground,var(--foreground));margin-top:12px;overflow:hidden}.history-comparison-tabs{border-bottom:1px solid var(--border);background:var(--vscode-editorGroupHeader-tabsBackground,var(--vscode-sideBar-background,var(--background)));scrollbar-width:thin;min-width:0;display:flex;overflow-x:auto}.history-comparison-tabs button{border:0;border-right:1px solid var(--border);min-width:max-content;min-height:41px;color:var(--vscode-tab-inactiveForeground,var(--muted-foreground));font:11px/1 var(--compass-font-sans);background:0 0;align-items:center;gap:7px;padding:0 14px;display:inline-flex;position:relative}.history-comparison-tabs button:hover{background:var(--workbench-hover);color:var(--vscode-tab-activeForeground,var(--foreground))}.history-comparison-tabs button[aria-selected=true]{background:var(--vscode-tab-activeBackground,var(--vscode-editor-background,var(--background)));color:var(--vscode-tab-activeForeground,var(--foreground));box-shadow:inset 0 2px 0 var(--vscode-tab-activeBorder,var(--vscode-focusBorder,var(--ring)))}.history-comparison-tabs button:focus-visible{z-index:1;outline:1px solid var(--vscode-focusBorder,var(--ring));outline-offset:-2px}.history-comparison-tabs button>svg{width:14px;height:14px;color:var(--vscode-focusBorder,var(--ring))}.history-comparison-tab-count{border:1px solid var(--border);background:var(--vscode-badge-background,var(--muted));min-width:19px;height:19px;color:var(--vscode-badge-foreground,var(--foreground));font:9px/1 var(--compass-font-mono);border-radius:9px;justify-content:center;align-items:center;padding:0 5px;display:inline-flex}.history-comparison-tab-panel{background:var(--vscode-editor-background,var(--background));min-width:0}.history-evidence-panel{min-width:0;padding:15px 15px 17px}.history-evidence-header{border-bottom:1px solid var(--border);padding-bottom:12px}.history-evidence-header>p,.history-findings-header>div>p{color:var(--muted-foreground);margin:4px 0 0 22px;font-size:11px;line-height:1.45}.history-diff-heading{align-items:center;gap:7px;display:flex}.history-diff-heading h2{margin:0;font-size:13px;font-weight:600}.history-findings-header{justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.history-findings-expand{border:1px solid var(--border);min-height:27px;color:var(--foreground);background:0 0;border-radius:2px;flex:none;padding:4px 9px;font-size:10px}.history-findings-expand:hover{border-color:var(--vscode-focusBorder,var(--ring));background:var(--workbench-hover)}.history-source-changes{gap:6px;margin-top:12px;display:grid}.history-source-changes details{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));color:var(--vscode-editor-foreground,var(--foreground));border-radius:2px;overflow:hidden}.history-diff-toolbar{align-items:center;gap:6px;margin-top:12px;display:flex}.history-diff-layout{border:1px solid var(--border);border-radius:2px;display:inline-flex;overflow:hidden}.history-diff-toolbar button{min-height:25px;color:var(--muted-foreground);background:0 0;border:0;padding:3px 8px;font-size:10px}.history-diff-layout button+button{border-left:1px solid var(--border)}.history-diff-toolbar button:hover:not(:disabled){background:var(--workbench-hover);color:var(--foreground)}.history-diff-toolbar button[aria-pressed=true],.history-diff-toolbar button[aria-pressed=true]:hover{background:var(--vscode-tab-activeBackground,var(--vscode-editor-background,var(--background)));color:var(--vscode-tab-activeForeground,var(--vscode-editor-foreground,var(--foreground)));box-shadow:inset 0 2px 0 var(--vscode-tab-activeBorder,var(--vscode-focusBorder,var(--ring)))}.history-diff-toolbar button:disabled{cursor:not-allowed;opacity:.45}.history-diff-wrap{min-height:25px;color:var(--muted-foreground);align-items:center;gap:5px;font-size:10px;display:inline-flex}.history-diff-wrap input{margin:0}.history-diff-expand{border-radius:2px;margin-left:auto;border:1px solid var(--border)!important}.history-source-changes summary{cursor:pointer;border-bottom:1px solid var(--border);background:var(--vscode-editorGroupHeader-tabsBackground,var(--background));justify-content:space-between;align-items:center;gap:10px;padding:6px 8px;font-size:10px;display:flex}.history-source-path{align-items:center;gap:8px;min-width:0;display:inline-flex}.history-source-path code{color:var(--vscode-textLink-foreground,var(--workbench-link));font-family:var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.history-source-path small{color:var(--muted-foreground);text-transform:capitalize;font-size:9px}.history-source-stats{font-family:var(--compass-font-mono);flex:none;gap:6px;display:inline-flex}.history-source-stats i{font-style:normal;font-weight:600}.history-source-stats i[data-change=added]{color:var(--vscode-gitDecoration-addedResourceForeground,#2ea043)}.history-source-stats i[data-change=removed]{color:var(--vscode-gitDecoration-deletedResourceForeground,#f85149)}.history-source-diff{contain:inline-size;background:var(--vscode-editor-background,var(--background));width:100%;min-width:0;max-width:100%;display:block}.history-diff-fallback>p{border-bottom:1px solid var(--border);color:var(--vscode-gitDecoration-modifiedResourceForeground,#d29922);margin:0;padding:7px 8px}.history-diff-fallback pre{max-height:260px;color:var(--vscode-editor-foreground,var(--foreground));font:10px/1.5 var(--compass-font-mono);white-space:pre;margin:0;padding:8px;overflow:auto}.history-source-changes p,.history-diff-empty{color:var(--muted-foreground);margin:12px 0 0;font-size:11px}.history-finding-list{gap:10px;margin-top:14px;display:grid}.history-finding-list details{border:1px solid var(--border);background:var(--vscode-editor-foreground,var(--foreground));border-radius:4px;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.history-finding-list details{background:color-mix(in srgb,var(--vscode-editor-foreground,var(--foreground)) 2%,var(--vscode-editor-background,var(--background)))}}.history-finding-list details{color:var(--vscode-editor-foreground,var(--foreground))}.history-finding-list details[open]{border-color:var(--vscode-focusBorder,var(--ring))}@supports (color:color-mix(in lab,red,red)){.history-finding-list details[open]{border-color:color-mix(in srgb,var(--vscode-focusBorder,var(--ring)) 58%,var(--border))}}.history-finding-list details[open]{box-shadow:inset 3px 0 0 var(--vscode-focusBorder,var(--ring))}.history-finding-list summary{cursor:pointer;grid-template-columns:28px minmax(0,1fr) 16px;align-items:center;gap:11px;min-height:58px;padding:11px 13px;list-style:none;display:grid}.history-finding-list summary::-webkit-details-marker{display:none}.history-finding-list summary:hover{background:var(--workbench-hover)}.history-finding-list summary:focus-visible{outline:1px solid var(--vscode-focusBorder,var(--ring));outline-offset:-2px}.history-finding-index{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));width:27px;height:27px;color:var(--vscode-focusBorder,var(--ring));font:600 10px/1 var(--compass-font-mono);border-radius:3px;justify-content:center;align-items:center;display:inline-flex}.history-finding-summary{gap:4px;min-width:0;display:grid}.history-finding-summary strong{text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:600;line-height:1.35;overflow:hidden}.history-finding-summary small{color:var(--muted-foreground);font-size:10px}.history-finding-list summary>svg{width:15px;height:15px;color:var(--muted-foreground);transition:transform .12s}.history-finding-list details[open] summary>svg{transform:rotate(90deg)}.history-finding-body{border-top:1px solid var(--border);padding:0 14px 15px 52px}.history-finding-body>p{color:var(--muted-foreground);margin:13px 0 0;font-size:11px}.history-finding-body dl{gap:0;margin:0;display:grid}.history-finding-body dl>div{border-bottom:1px solid var(--border);grid-template-columns:minmax(110px,170px) minmax(0,1fr);gap:16px;padding:12px 0;display:grid}.history-finding-body dl>div:last-child{border-bottom:0;padding-bottom:0}.history-finding-body dt{color:var(--muted-foreground);letter-spacing:.06em;text-transform:uppercase;font-size:9px;font-weight:600}.history-finding-body dd{min-width:0;margin:0;font-size:11px;line-height:1.5}.history-finding-body dd ul{gap:5px;margin:0;padding-left:17px;display:grid}.history-finding-body dd pre{border:1px solid var(--border);background:var(--vscode-textCodeBlock-background,var(--muted));max-height:280px;color:var(--vscode-editor-foreground,var(--foreground));font:10px/1.55 var(--compass-font-mono);white-space:pre-wrap;border-radius:3px;margin:0;padding:9px 10px;overflow:auto}.history-finding-body dd code{font-family:var(--compass-font-mono)}.history-finding-muted{color:var(--muted-foreground);font-style:italic}.history-findings-empty{border:1px dashed var(--border);color:var(--muted-foreground);border-radius:4px;align-items:flex-start;gap:10px;margin-top:14px;padding:15px;display:flex}.history-findings-empty>svg{width:17px;height:17px;color:var(--vscode-focusBorder,var(--ring))}.history-findings-empty strong{color:var(--foreground);font-size:12px}.history-findings-empty p{margin:4px 0 0;font-size:11px}.history-standalone-evidence{gap:12px;margin-top:12px;display:grid}.history-standalone-evidence>section{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background))}.history-graph-frame{border:1px solid var(--border);background:var(--vscode-editor-background,var(--background));height:max(400px,100vh - 190px);min-height:360px;margin-top:12px;display:grid;overflow:hidden}.history-graph-frame-tabbed{border:0;height:max(460px,100vh - 230px);min-height:420px;margin-top:0}.history-graph-ready,.history-graph-canvas{min-width:0;min-height:0}.history-graph-ready{flex-direction:column;display:flex}.history-graph-status{border-bottom:1px solid var(--border);background:var(--vscode-editorGroupHeader-tabsBackground,var(--background));min-height:30px;color:var(--muted-foreground);flex:none;padding:7px 10px;font-size:11px}.history-graph-status span{color:var(--foreground);font-family:var(--compass-font-mono)}.history-graph-canvas{isolation:isolate;flex:1;position:relative}.history-graph-canvas .compass-workspace{height:100%;min-height:0}.history-content>section:last-child{margin-top:12px}body.vscode-high-contrast .history-sidebar,body.vscode-high-contrast-light .history-sidebar,body.vscode-high-contrast .history-commit-details,body.vscode-high-contrast-light .history-commit-details,body.vscode-high-contrast .history-graph-frame,body.vscode-high-contrast-light .history-graph-frame,body.vscode-high-contrast .history-comparison,body.vscode-high-contrast-light .history-comparison,body.vscode-high-contrast .history-diff-evidence,body.vscode-high-contrast-light .history-diff-evidence,body.vscode-high-contrast .history-comparison-workspace,body.vscode-high-contrast-light .history-comparison-workspace,body.vscode-high-contrast .history-finding-list details,body.vscode-high-contrast-light .history-finding-list details,body.vscode-high-contrast .history-source-changes details,body.vscode-high-contrast-light .history-source-changes details,body.vscode-high-contrast .history-change-counts span,body.vscode-high-contrast-light .history-change-counts span,body.vscode-high-contrast .history-comparison-control select,body.vscode-high-contrast-light .history-comparison-control select,body.vscode-high-contrast .compass-change-legend,body.vscode-high-contrast-light .compass-change-legend,body.vscode-high-contrast .compass-semantic-legend,body.vscode-high-contrast-light .compass-semantic-legend,body.vscode-high-contrast .compass-change-badge,body.vscode-high-contrast-light .compass-change-badge{border-color:var(--vscode-contrastBorder,var(--ring));border-width:2px}@media(max-width:760px){.query-header{padding:10px}.query-heading-row,.query-composer{flex-direction:column;align-items:stretch}.query-mode{align-self:flex-start}.query-mode button{min-width:180px}.query-mode small{display:none}.query-suggestions button{grid-template-columns:1fr;gap:2px}.query-suggestions button>small,.query-suggestions-hint{display:none}.query-explanation-card{grid-template-columns:1fr}.query-explanation-card dl{grid-column:auto}.history-diff-toolbar{flex-wrap:wrap}.history-comparison-control{grid-template-columns:1fr;width:100%}.history-commit-actions{flex-direction:column;align-items:stretch}.history-commit-actions>button{align-self:flex-start}.history-comparison-control label{grid-column:auto}.history-diff-expand{margin-left:0}.history-comparison-tabs button{min-height:39px;padding-inline:11px}.history-evidence-panel{padding:12px}.history-findings-header{flex-direction:column;align-items:stretch}.history-findings-expand{align-self:flex-start}.history-finding-body{padding-left:14px}.history-finding-body dl>div{grid-template-columns:1fr;gap:5px}.query-composer-footer{flex-wrap:wrap}.query-params{flex:1 0 100%;max-width:none}.query-params input{max-width:none}.query-footer-actions{justify-content:flex-end;width:100%}.query-examples{padding-bottom:2px}.compass-load-shell[data-variant=architecture]{text-align:center;grid-template-rows:auto auto auto;grid-template-columns:1fr}.compass-load-shell[data-variant=architecture] .compass-load-visual,.compass-load-shell[data-variant=architecture] .compass-load-copy,.architecture-load-skeleton{grid-column:1}.compass-load-shell[data-variant=architecture] .compass-load-visual{margin:0 auto}.compass-load-shell[data-variant=architecture] .compass-load-steps{justify-content:center}.architecture-load-skeleton{grid-row:3;width:min(88vw,460px);height:190px;margin-top:14px}.history-shell{grid-template-rows:auto minmax(0,1fr);grid-template-columns:1fr}.history-sidebar{border-right:0;border-bottom:1px solid var(--border)}.history-sidebar-header{padding:10px}.history-title p,.history-search,.history-rail{display:none}.history-mobile-select{color:var(--muted-foreground);gap:4px;margin-top:9px;font-size:10px;display:grid}.history-mobile-select select{padding:4px 7px}.history-content{padding:10px}.history-commit-heading{gap:8px}.history-commit-metadata{gap:3px;display:grid}.history-graph-frame{height:max(750px,102vh + 30px);margin-top:10px}.history-graph-canvas .compass-workspace{height:auto;min-height:max(720px,102vh)}}@media(max-width:420px){.query-params{flex-direction:column;align-items:stretch;gap:4px}.query-params input{flex:none;width:100%}}.architecture-nav{border-right:1px solid var(--border);background:var(--sidebar);min-height:0;color:var(--sidebar-foreground);flex-direction:column;display:flex}.architecture-nav-header{border-bottom:1px solid var(--border);padding:14px 14px 12px}.architecture-nav-header>span,.architecture-eyebrow{color:var(--muted-foreground);letter-spacing:.08em;text-transform:uppercase;font-size:10px;font-weight:600;display:block}.architecture-nav-header h1{text-overflow:ellipsis;white-space:nowrap;margin:4px 0 0;font-size:13px;font-weight:600;line-height:1.35;overflow:hidden}.architecture-section-list{flex:1;min-height:0;padding:5px;overflow:auto}.architecture-section-list>button{width:100%;min-height:48px;color:inherit;text-align:left;background:0 0;border:1px solid #0000;border-radius:3px;grid-template-columns:18px minmax(0,1fr);align-items:start;gap:7px;padding:7px 8px;display:grid}.architecture-section-list>button:hover{background:var(--workbench-hover);color:var(--workbench-hover-foreground)}.architecture-section-list>button[aria-current=page]{border-color:var(--vscode-list-activeSelectionBackground,var(--sidebar-primary));background:var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.architecture-section-list svg{width:14px;height:14px;margin-top:2px}.architecture-section-list strong,.architecture-section-list small{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.architecture-section-list strong{font-size:12px;font-weight:500}.architecture-section-list small{color:var(--muted-foreground);margin-top:2px;font-size:10px}.architecture-section-list>button[aria-current=page] small{color:inherit;opacity:.78}.architecture-stats{border-top:1px solid var(--border);color:var(--muted-foreground);text-align:center;grid-template-columns:repeat(3,1fr);gap:1px;padding:8px 6px;font-size:9px;display:grid}.architecture-stats strong{color:var(--sidebar-foreground);margin-bottom:1px;font-size:11px;display:block}.architecture-main{min-width:0;padding:14px clamp(14px,2.2vw,24px) 32px;overflow:auto}.architecture-global-search{z-index:20;max-width:760px;margin:0 auto 18px;position:sticky;top:0}.architecture-global-search>label{align-items:center;display:flex;position:relative}.architecture-global-search>label>svg{width:15px;height:15px;color:var(--vscode-input-placeholderForeground,var(--muted-foreground));position:absolute;left:10px}.architecture-global-search input{border:1px solid var(--vscode-input-border,var(--border));background:var(--vscode-input-background,var(--input));width:100%;height:34px;color:var(--vscode-input-foreground,var(--foreground));font:inherit;border-radius:3px;outline:none;padding:5px 84px 5px 33px;font-size:12px}.architecture-global-search input:focus-visible{border-color:var(--ring);outline:1px solid var(--ring);outline-offset:-1px}.architecture-global-search label>span{color:var(--muted-foreground);font-size:10px;position:absolute;right:8px}.architecture-search-results{border:1px solid var(--vscode-menu-border,var(--border));background:var(--vscode-menu-background,var(--popover));max-height:min(440px,65vh);color:var(--vscode-menu-foreground,var(--popover-foreground));box-shadow:0 4px 12px var(--vscode-widget-shadow,#00000047);border-radius:3px;position:absolute;top:calc(100% + 2px);left:0;right:0;overflow:auto}.architecture-search-results>p{color:var(--muted-foreground);margin:0;padding:14px;font-size:12px}.architecture-search-results section+section{border-top:1px solid var(--vscode-menu-separatorBackground,var(--border))}.architecture-search-results h2{color:var(--muted-foreground);letter-spacing:.06em;text-transform:uppercase;margin:0;padding:7px 10px 4px;font-size:10px;font-weight:600}.architecture-search-results button{width:100%;color:inherit;text-align:left;background:0 0;border:0;padding:6px 10px;display:block}.architecture-search-results button:hover,.architecture-search-results button:focus-visible{background:var(--vscode-menu-selectionBackground,var(--vscode-list-activeSelectionBackground,var(--accent)));color:var(--vscode-menu-selectionForeground,var(--vscode-list-activeSelectionForeground,var(--accent-foreground)));outline:none}.architecture-search-results button span,.architecture-search-results button small{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.architecture-search-results button span{font-size:12px}.architecture-search-results button small{color:inherit;opacity:.72;margin-top:2px;font-size:10px}.architecture-overview,.architecture-detail{max-width:1500px;margin-left:auto;margin-right:auto}.architecture-detail{margin-top:26px}.architecture-section-heading{justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:10px;display:flex}.architecture-section-heading h2{margin:0;font-size:15px;font-weight:600;line-height:1.35}.architecture-section-heading p{color:var(--muted-foreground);margin:3px 0 0;font-size:11px}.architecture-detail-count{color:var(--muted-foreground);white-space:nowrap;font-size:11px}.architecture-flow-grid,.architecture-symbol-grid{grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:6px;display:grid}.architecture-flow{border:1px solid var(--border);background:var(--vscode-editorWidget-background,var(--card));min-width:0;min-height:38px;color:var(--foreground);font:inherit;text-align:left;border-radius:3px;grid-template-columns:minmax(0,1fr) 14px minmax(0,1fr) auto;align-items:center;gap:6px;padding:6px 8px;font-size:11px;display:grid}.architecture-flow:hover{border-color:var(--vscode-focusBorder,var(--ring));background:var(--workbench-hover)}.architecture-flow>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.architecture-flow>svg{width:13px;height:13px;color:var(--muted-foreground)}.architecture-flow-footer{justify-content:space-between;align-items:center;gap:10px;margin-top:8px;display:flex}.architecture-flow-footer p{color:var(--muted-foreground);margin:0;font-size:10px}.architecture-flow-footer button{border:1px solid var(--border);color:var(--foreground);font:inherit;background:0 0;border-radius:3px;padding:3px 7px;font-size:10px}.architecture-tab-content{min-height:280px;padding-top:8px}.architecture-detail [data-slot=tabs-list]{border-bottom:1px solid var(--border);justify-content:flex-start;gap:0;width:100%;height:30px;padding:0}.architecture-detail [data-slot=tabs-trigger]{min-width:76px;height:30px;color:var(--muted-foreground);border-radius:0;flex:none;padding:4px 10px;font-size:11px;font-weight:500}.architecture-detail [data-slot=tabs-trigger][data-state=active]{color:var(--foreground)}.architecture-detail [data-slot=tabs-trigger]>span{background:var(--vscode-badge-background,var(--muted));min-width:22px;color:var(--vscode-badge-foreground,var(--muted-foreground));font:9px/1.4 var(--compass-font-mono);border-radius:9px;margin-left:4px;padding:1px 5px}.architecture-detail [data-slot=tabs-trigger][data-state=active]>span{color:var(--vscode-badge-foreground,var(--foreground))}.architecture-detail [data-slot=tabs-trigger]:after{background:var(--vscode-tab-activeBorder,var(--ring));bottom:-1px}.architecture-symbol-grid{grid-template-columns:repeat(auto-fill,minmax(210px,1fr));margin-top:8px}.architecture-symbol-card{border:1px solid var(--border);background:var(--vscode-editorWidget-background,var(--card));min-width:0;min-height:92px;color:var(--card-foreground);border-radius:3px;grid-template-rows:auto 1fr;grid-template-columns:18px minmax(0,1fr);gap:0 7px;padding:9px;display:grid}.architecture-symbol-card>svg{width:15px;height:15px;color:var(--vscode-symbolIcon-functionForeground,var(--muted-foreground));margin-top:1px}.architecture-symbol-card h3,.architecture-symbol-card p{text-overflow:ellipsis;white-space:nowrap;margin:0;overflow:hidden}.architecture-symbol-card h3{color:var(--vscode-editor-foreground,var(--foreground));font-size:12px;font-weight:600}.architecture-symbol-card p{color:var(--muted-foreground);margin-top:2px;font-size:10px}.architecture-symbol-card>button,.architecture-symbol-card>span{color:var(--workbench-link);font:10px/1.35 var(--compass-font-mono);text-align:left;text-overflow:ellipsis;white-space:nowrap;background:0 0;border:0;grid-column:1/span 2;align-self:end;margin-top:9px;padding:0;overflow:hidden}.architecture-symbol-card>button:hover{text-decoration:underline}.architecture-symbol-card>span{color:var(--vscode-disabledForeground,var(--compass-faint))}.architecture-call-table{border:1px solid var(--border);border-radius:3px;max-height:min(54vh,620px);margin-top:8px;overflow:auto}.architecture-call-table table{border-collapse:collapse;table-layout:fixed;width:100%;min-width:620px;font-size:11px}.architecture-call-table thead{z-index:2;background:var(--workbench-table-header);position:sticky;top:0}.architecture-call-table th,.architecture-call-table td{border-bottom:1px solid var(--border);text-align:left;text-overflow:ellipsis;white-space:nowrap;padding:7px 9px;overflow:hidden}.architecture-call-table th{color:var(--muted-foreground);padding:0;font-weight:500}.architecture-call-table th button{width:100%;min-height:30px;color:inherit;font:inherit;text-align:left;background:0 0;border:0;align-items:center;gap:5px;padding:6px 9px;display:flex}.architecture-call-table th button:hover{background:var(--workbench-hover);color:var(--foreground)}.architecture-call-table tbody tr:hover{background:var(--workbench-hover)}.architecture-call-table tr:last-child td{border-bottom:0}.architecture-call-table th:nth-child(2),.architecture-call-table th:nth-child(4),.architecture-call-table td:nth-child(2),.architecture-call-table td:nth-child(4){width:126px}.architecture-shell button:focus-visible,.architecture-shell input:focus-visible{outline:2px solid var(--ring);outline-offset:1px}body.vscode-high-contrast .architecture-section-list>button[aria-current=page],body.vscode-high-contrast-light .architecture-section-list>button[aria-current=page],body.vscode-high-contrast .architecture-flow:focus-visible,body.vscode-high-contrast-light .architecture-flow:focus-visible,body.vscode-high-contrast .architecture-symbol-card,body.vscode-high-contrast-light .architecture-symbol-card,body.vscode-high-contrast .architecture-call-table,body.vscode-high-contrast-light .architecture-call-table{border-width:2px;border-color:var(--vscode-contrastBorder,var(--ring))}@media(max-width:760px){.architecture-shell{grid-template-rows:auto 1fr;grid-template-columns:1fr}.architecture-nav{border-right:0;border-bottom:1px solid var(--border);max-height:38vh}.architecture-main{padding:10px 10px 24px}.architecture-global-search{margin-bottom:14px}.architecture-section-heading{align-items:flex-start}.architecture-flow-grid,.architecture-symbol-grid{grid-template-columns:1fr}.architecture-flow-footer,.workbench-pagination{flex-direction:column;align-items:flex-start}.workbench-collection-toolbar{flex-direction:column;align-items:stretch}.workbench-search{width:100%;max-width:none}}.architecture-workspace{--architecture-border:var(--vscode-panel-border,var(--border));--architecture-surface:var(--vscode-editor-background,var(--background));--architecture-raised:var(--vscode-editorWidget-background,var(--vscode-sideBar-background,var(--card)));background:var(--architecture-surface);height:100vh;min-height:520px;color:var(--vscode-editor-foreground,var(--foreground));grid-template-columns:minmax(210px,240px) minmax(520px,1fr) minmax(300px,350px);display:grid;overflow:hidden}.architecture-workspace[data-inspector-open=false]{grid-template-columns:minmax(210px,240px) minmax(520px,1fr)}.architecture-rail,.architecture-inspector{background:var(--vscode-sideBar-background,var(--sidebar));min-width:0;min-height:0}.architecture-rail{border-right:1px solid var(--architecture-border);grid-template-rows:auto 1fr auto;display:grid}.architecture-rail-header,.architecture-inspector-header{border-bottom:1px solid var(--architecture-border);padding:16px}.architecture-rail-header>span,.architecture-inspector-header>span{color:var(--vscode-descriptionForeground,var(--muted-foreground));font:700 9px/1.2 var(--compass-font-mono);letter-spacing:.13em;text-transform:uppercase}.architecture-rail-header h1,.architecture-inspector-header h2{text-overflow:ellipsis;margin:7px 0 0;font-size:14px;font-weight:650;line-height:1.35;overflow:hidden}.architecture-rail-header p,.architecture-inspector-header p{color:var(--vscode-descriptionForeground,var(--muted-foreground));margin:5px 0 0;font-size:10px}.architecture-rail nav{min-height:0;padding:6px;overflow:auto}.architecture-rail nav>button{width:100%;color:inherit;text-align:left;background:0 0;border:1px solid #0000;border-radius:5px;grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:7px;padding:8px;display:grid}.architecture-rail nav>button:hover,.architecture-rail nav>button:focus-visible{background:var(--vscode-list-hoverBackground,var(--workbench-hover))}.architecture-rail nav>button[aria-current=page]{border-color:var(--vscode-focusBorder,var(--ring))}@supports (color:color-mix(in lab,red,red)){.architecture-rail nav>button[aria-current=page]{border-color:color-mix(in srgb,var(--vscode-focusBorder,var(--ring)) 48%,transparent)}}.architecture-rail nav>button[aria-current=page]{background:var(--vscode-list-activeSelectionBackground,var(--vscode-sideBarSectionHeader-background,var(--sidebar-accent)));color:var(--vscode-list-activeSelectionForeground,inherit)}.architecture-rail nav>button[data-empty=true]{opacity:.57}.architecture-rail nav svg{width:14px;height:14px;color:var(--vscode-symbolIcon-moduleForeground,var(--compass-focus))}.architecture-rail nav strong,.architecture-rail nav small{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.architecture-rail nav strong{font-size:11px;font-weight:600}.architecture-rail nav small{color:var(--vscode-descriptionForeground,var(--muted-foreground));font:9px/1.35 var(--compass-font-mono);margin-top:2px}.architecture-rail nav i{background:var(--vscode-badge-background,var(--muted));min-width:24px;color:var(--vscode-badge-foreground,var(--muted-foreground));font:normal 9px/1.3 var(--compass-font-mono);text-align:center;border-radius:10px;padding:2px 5px}.architecture-scope-totals{border-top:1px solid var(--architecture-border);color:var(--vscode-descriptionForeground,var(--muted-foreground));text-align:center;grid-template-columns:repeat(3,1fr);padding:10px 6px;font-size:8px;display:grid}.architecture-scope-totals strong{color:var(--vscode-sideBar-foreground,var(--foreground));font:600 10px/1.2 var(--compass-font-mono);margin-bottom:2px;display:block}.architecture-stage{grid-template-rows:auto auto minmax(0,1fr);min-width:0;min-height:0;display:grid;overflow:hidden}.architecture-command-bar{border-bottom:1px solid var(--architecture-border);background:var(--architecture-surface);grid-template-columns:minmax(240px,1fr) auto auto 30px;align-items:center;gap:8px;padding:9px 12px;display:grid}.architecture-inspector-toggle{border:1px solid var(--architecture-border);background:var(--architecture-raised);width:30px;height:30px;color:var(--vscode-descriptionForeground,var(--muted-foreground));border-radius:4px;place-items:center;display:grid}.architecture-inspector-toggle:hover{background:var(--vscode-toolbar-hoverBackground,var(--workbench-hover));color:var(--foreground)}.architecture-inspector-toggle svg{width:14px;height:14px}.architecture-search{min-width:0;position:relative}.architecture-search>svg,.architecture-detail-filter>svg{z-index:1;width:13px;height:13px;color:var(--vscode-input-placeholderForeground,var(--muted-foreground));pointer-events:none;position:absolute;top:50%;left:9px;transform:translateY(-50%)}.architecture-search>input,.architecture-detail-filter>input,.architecture-evidence-filter select{border:1px solid var(--vscode-input-border,var(--architecture-border));background:var(--vscode-input-background,var(--input));width:100%;height:30px;color:var(--vscode-input-foreground,var(--foreground));font:11px/1.3 var(--vscode-font-family,system-ui);border-radius:4px;outline:none}.architecture-search>input,.architecture-detail-filter>input{padding:4px 72px 4px 29px}.architecture-search>input:focus,.architecture-detail-filter>input:focus,.architecture-evidence-filter select:focus{border-color:var(--vscode-focusBorder,var(--ring));outline:1px solid var(--vscode-focusBorder,var(--ring));outline-offset:-1px}.architecture-search>span{color:var(--vscode-descriptionForeground,var(--muted-foreground));font:9px/1.4 var(--compass-font-mono);position:absolute;top:8px;right:8px}.architecture-search-popover{z-index:30;border:1px solid var(--vscode-menu-border,var(--architecture-border));background:var(--vscode-menu-background,var(--popover));max-height:min(440px,70vh);box-shadow:0 8px 24px var(--vscode-widget-shadow,#00000047);border-radius:5px;position:absolute;top:calc(100% + 4px);left:0;right:0;overflow:auto}.architecture-search-popover>button{width:100%;color:var(--vscode-menu-foreground,var(--foreground));text-align:left;background:0 0;border:0;padding:7px 10px;display:block}.architecture-search-popover>button:hover,.architecture-search-popover>button:focus-visible{background:var(--vscode-menu-selectionBackground,var(--accent));color:var(--vscode-menu-selectionForeground,var(--accent-foreground))}.architecture-search-popover strong,.architecture-search-popover small{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.architecture-search-popover strong{font-size:11px}.architecture-search-popover small{opacity:.75;margin-top:2px;font-size:9px}.architecture-search-popover p{color:var(--muted-foreground);margin:0;padding:16px;font-size:11px}.architecture-directory-pagination{border-top:1px solid var(--architecture-border);font:9px/1.2 var(--compass-font-mono);justify-content:space-between;align-items:center;gap:8px;padding:6px 8px;display:flex}.architecture-directory-pagination button{border:1px solid var(--architecture-border);color:inherit;background:0 0;border-radius:4px;padding:3px 7px}.architecture-scope-switch{border:1px solid var(--architecture-border);border-radius:4px;display:flex;overflow:hidden}.architecture-scope-switch button{min-height:28px;color:var(--vscode-descriptionForeground,var(--muted-foreground));font:10px/1.2 var(--compass-font-mono);background:0 0;border:0;padding:4px 9px}.architecture-scope-switch button+button{border-left:1px solid var(--architecture-border)}.architecture-scope-switch button[aria-pressed=true]{background:var(--vscode-button-secondaryBackground,var(--accent));color:var(--vscode-button-secondaryForeground,var(--accent-foreground))}.architecture-evidence-filter{align-items:center;gap:5px;display:flex}.architecture-evidence-filter>svg{width:13px;height:13px;color:var(--vscode-descriptionForeground,var(--muted-foreground))}.architecture-evidence-filter select{width:auto;min-width:110px;padding:3px 22px 3px 7px}.architecture-context-strip{border-bottom:1px solid var(--architecture-border);background:var(--vscode-breadcrumb-background,var(--architecture-raised));min-height:34px;color:var(--vscode-descriptionForeground,var(--muted-foreground));font:9px/1.3 var(--compass-font-mono);flex-wrap:wrap;align-items:center;gap:6px 14px;padding:6px 12px;display:flex}.architecture-context-strip strong{color:var(--vscode-foreground,var(--foreground));font-weight:600}.architecture-context-strip button{border:1px solid var(--architecture-border);color:var(--vscode-textLink-foreground,var(--primary));font:inherit;cursor:pointer;background:0 0;border-radius:4px;padding:1px 5px}.architecture-quality-status{border:1px solid var(--architecture-border);text-transform:capitalize;border-radius:999px;padding:2px 6px}.architecture-quality-status[data-status=good]{color:var(--vscode-testing-iconPassed,var(--success))}.architecture-quality-status[data-status=degraded]{color:var(--vscode-editorWarning-foreground,var(--warning))}.architecture-quality-status[data-status=insufficient]{color:var(--vscode-editorError-foreground,var(--destructive))}.architecture-coverage-warning{color:var(--vscode-editorWarning-foreground,var(--warning));align-items:center;gap:4px;display:inline-flex}.architecture-omitted-selection{border:1px solid var(--compass-border);color:var(--compass-muted);background:var(--compass-surface-raised);border-radius:8px;margin:12px 14px 0;padding:8px 10px}@supports (color:color-mix(in lab,red,red)){.architecture-omitted-selection{background:color-mix(in srgb,var(--compass-surface-raised) 88%,transparent)}}.architecture-coverage-warning svg{width:12px;height:12px}.architecture-map-panel{border:1px solid var(--architecture-border);background:var(--architecture-raised);border-radius:10px;grid-template-rows:auto minmax(0,1fr) auto;min-width:0;min-height:0;margin:clamp(14px,2vw,24px);display:grid;position:relative;overflow:hidden;box-shadow:0 12px 32px #0000001a}.architecture-map-header{border-bottom:1px solid var(--architecture-border);background:var(--architecture-raised);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px 24px;min-width:0;padding:14px 16px;display:flex}.architecture-map-intro{gap:3px;min-width:min(100%,260px);display:grid}.architecture-map-intro>span{color:var(--vscode-descriptionForeground,var(--muted-foreground));font:700 8px/1.2 var(--compass-font-mono);letter-spacing:.14em;text-transform:uppercase}.architecture-map-intro>strong{overflow-wrap:anywhere;font-size:12px;font-weight:650;line-height:1.35}.architecture-map-intro>small{max-width:560px;color:var(--vscode-descriptionForeground,var(--muted-foreground));font-size:9.5px;line-height:1.45}.architecture-map-actions{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;min-width:0;display:flex}.architecture-map-viewport{overscroll-behavior:contain;scrollbar-color:var(--vscode-scrollbarSlider-background,var(--muted)) transparent;scrollbar-gutter:stable;min-width:0;height:auto;min-height:0;box-shadow:inset -26px 0 22px -24px var(--foreground);position:relative;overflow:auto}@supports (color:color-mix(in lab,red,red)){.architecture-map-viewport{box-shadow:inset -26px 0 22px -24px color-mix(in srgb,var(--foreground) 30%,transparent)}}.architecture-map-viewport{background:linear-gradient(var(--vscode-editorRuler-foreground,var(--border)) 1px,transparent 1px),linear-gradient(90deg,var(--vscode-editorRuler-foreground,var(--border)) 1px,transparent 1px),var(--architecture-surface)}@supports (color:color-mix(in lab,red,red)){.architecture-map-viewport{background:linear-gradient(color-mix(in srgb,var(--vscode-editorRuler-foreground,var(--border)) 9%,transparent) 1px,transparent 1px),linear-gradient(90deg,color-mix(in srgb,var(--vscode-editorRuler-foreground,var(--border)) 9%,transparent) 1px,transparent 1px),var(--architecture-surface)}}.architecture-map-viewport{background-size:32px 32px}.architecture-map-viewport[data-scroll-position=end],.architecture-map-viewport[data-scroll-position=none]{box-shadow:none}.architecture-map-canvas{min-width:100%;min-height:100%}.architecture-route-mode{border:1px solid var(--architecture-border);background:var(--architecture-surface);border-radius:5px;display:flex;overflow:hidden}.architecture-route-mode button{min-width:66px;height:27px;color:var(--vscode-descriptionForeground,var(--muted-foreground));font:9px/1 var(--compass-font-mono);background:0 0;border:0;padding:0 9px}.architecture-route-mode button+button{border-left:1px solid var(--architecture-border)}.architecture-route-mode button:hover{background:var(--vscode-toolbar-hoverBackground,var(--workbench-hover));color:var(--vscode-foreground,var(--foreground))}.architecture-route-mode button[aria-pressed=true]{background:var(--vscode-list-activeSelectionBackground,var(--accent))}@supports (color:color-mix(in lab,red,red)){.architecture-route-mode button[aria-pressed=true]{background:color-mix(in srgb,var(--vscode-list-activeSelectionBackground,var(--accent)) 72%,var(--architecture-raised))}}.architecture-route-mode button[aria-pressed=true]{color:var(--vscode-list-activeSelectionForeground,var(--foreground))}.architecture-map-toolbar{border:1px solid var(--architecture-border);background:var(--architecture-surface);border-radius:5px;align-items:center;display:flex;overflow:hidden}.architecture-map-toolbar button{width:28px;height:27px;color:var(--foreground);background:0 0;border:0;place-items:center;display:grid}.architecture-map-toolbar button:hover{background:var(--workbench-hover)}.architecture-map-toolbar button:disabled{opacity:.38;pointer-events:none}.architecture-map-toolbar button+button,.architecture-map-toolbar span+button{border-left:1px solid var(--architecture-border)}.architecture-map-toolbar svg{width:13px;height:13px}.architecture-map-toolbar span{min-width:40px;color:var(--muted-foreground);font:9px/27px var(--compass-font-mono);text-align:center;padding:0 5px}.architecture-map{cursor:grab;touch-action:none;width:100%;height:100%;display:block}.architecture-map:active{cursor:grabbing}.architecture-arrow-default path{fill:var(--vscode-textLink-foreground,var(--compass-focus))}.architecture-arrow-incoming path{fill:var(--vscode-symbolIcon-interfaceForeground,#b7a1ff)}.architecture-arrow-outgoing path{fill:var(--vscode-charts-blue,#49a6ff)}.architecture-map-lanes{pointer-events:none}.architecture-map-lanes rect{fill:var(--architecture-raised)}@supports (color:color-mix(in lab,red,red)){.architecture-map-lanes rect{fill:color-mix(in srgb,var(--architecture-raised) 8%,transparent)}}.architecture-map-lanes rect{stroke:var(--architecture-border)}@supports (color:color-mix(in lab,red,red)){.architecture-map-lanes rect{stroke:color-mix(in srgb,var(--architecture-border) 20%,transparent)}}.architecture-map-lanes rect{stroke-width:1px}.architecture-map-lanes text{fill:var(--vscode-descriptionForeground,var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.architecture-map-lanes text{fill:color-mix(in srgb,var(--vscode-descriptionForeground,var(--muted-foreground)) 72%,transparent)}}.architecture-map-lanes text{font:700 8px/1 var(--compass-font-mono);letter-spacing:.12em;text-anchor:middle;text-transform:uppercase}.architecture-map-lanes .architecture-map-direction{fill:var(--vscode-descriptionForeground,var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.architecture-map-lanes .architecture-map-direction{fill:color-mix(in srgb,var(--vscode-descriptionForeground,var(--muted-foreground)) 52%,transparent)}}.architecture-map-lanes .architecture-map-direction{letter-spacing:.16em;text-anchor:start;font-size:7px}.architecture-route-line{fill:none;stroke:var(--vscode-textLink-foreground,var(--compass-focus));opacity:var(--architecture-route-opacity,.2);stroke-linecap:round;stroke-linejoin:round;transition:opacity .14s,stroke-width .14s}.architecture-routes g[data-evidence=inferred] .architecture-route-line{stroke:var(--vscode-editorWarning-foreground,var(--warning));stroke-dasharray:6 5}.architecture-routes g[data-direction=backward] .architecture-route-line{stroke-dasharray:3 5}.architecture-route-hit{fill:none;stroke:#0000;stroke-width:16px;cursor:pointer}.architecture-routes g[data-selected=true] .architecture-route-line{opacity:1;filter:drop-shadow(0 0 3px var(--compass-focus))}@supports (color:color-mix(in lab,red,red)){.architecture-routes g[data-selected=true] .architecture-route-line{filter:drop-shadow(0 0 3px color-mix(in srgb,var(--compass-focus) 55%,transparent))}}.architecture-routes g[data-focus-direction=incoming] .architecture-route-line{stroke:var(--vscode-symbolIcon-interfaceForeground,#b7a1ff);opacity:.86}.architecture-routes g[data-focus-direction=outgoing] .architecture-route-line{stroke:var(--vscode-charts-blue,#49a6ff);opacity:.9}.architecture-routes g[data-dimmed=true]{opacity:.09}.architecture-map-panel[data-route-mode=key] .architecture-routes g[data-dimmed=true]{opacity:.38}.architecture-map-nodes g[data-dimmed=true]{opacity:.27}.architecture-map-panel[data-route-mode=key] .architecture-map-nodes g[data-dimmed=true]{opacity:.48}.architecture-routes g:focus-visible .architecture-route-line{stroke:var(--vscode-focusBorder,var(--ring));opacity:1}.architecture-map-nodes g{cursor:grab;touch-action:none;transition:opacity .12s}.architecture-map-nodes g[data-dragging=true]{cursor:grabbing}.architecture-map-node-card{fill:var(--vscode-editorWidget-background,var(--card));stroke:var(--vscode-symbolIcon-moduleForeground,var(--compass-focus))}@supports (color:color-mix(in lab,red,red)){.architecture-map-node-card{stroke:color-mix(in srgb,var(--vscode-symbolIcon-moduleForeground,var(--compass-focus)) 25%,var(--architecture-border))}}.architecture-map-node-card{stroke-width:1px}.architecture-map-node-shadow{fill:#0000002b;stroke:none;transform:translateY(3px)}.architecture-map-node-accent{fill:var(--vscode-symbolIcon-moduleForeground,var(--compass-focus));opacity:.62;pointer-events:none}.architecture-map-nodes g:hover .architecture-map-node-card,.architecture-map-nodes g:focus-visible .architecture-map-node-card,.architecture-map-nodes g[data-selected=true] .architecture-map-node-card,.architecture-map-nodes g[data-dragging=true] .architecture-map-node-card{fill:var(--vscode-list-activeSelectionBackground,var(--accent))}@supports (color:color-mix(in lab,red,red)){.architecture-map-nodes g:hover .architecture-map-node-card,.architecture-map-nodes g:focus-visible .architecture-map-node-card,.architecture-map-nodes g[data-selected=true] .architecture-map-node-card,.architecture-map-nodes g[data-dragging=true] .architecture-map-node-card{fill:color-mix(in srgb,var(--vscode-list-activeSelectionBackground,var(--accent)) 38%,var(--vscode-editorWidget-background,var(--card)))}}.architecture-map-nodes g:hover .architecture-map-node-card,.architecture-map-nodes g:focus-visible .architecture-map-node-card,.architecture-map-nodes g[data-selected=true] .architecture-map-node-card,.architecture-map-nodes g[data-dragging=true] .architecture-map-node-card{stroke:var(--vscode-focusBorder,var(--ring));stroke-width:1.6px}.architecture-map-nodes g[data-selected=true] .architecture-map-node-accent,.architecture-map-nodes g[data-dragging=true] .architecture-map-node-accent{opacity:1}.architecture-map-nodes g[data-dragging=true] .architecture-map-node-shadow{transform:translateY(7px)}.architecture-map-node-name{fill:var(--vscode-editor-foreground,var(--foreground));font:650 12px/1.2 var(--vscode-font-family,system-ui);pointer-events:none}.architecture-map-node-meta{fill:var(--vscode-descriptionForeground,var(--muted-foreground));font:8.5px/1.2 var(--compass-font-mono);pointer-events:none}.architecture-map-node-grip{fill:var(--vscode-descriptionForeground,var(--muted-foreground));opacity:.45;pointer-events:none}.architecture-map-nodes g:hover .architecture-map-node-grip,.architecture-map-nodes g[data-dragging=true] .architecture-map-node-grip{opacity:.9}.architecture-map-legend{min-width:0;color:var(--muted-foreground);font:8px/1.2 var(--compass-font-mono);flex-wrap:wrap;gap:7px 12px;display:flex}.architecture-map-legend span{align-items:center;gap:4px;display:inline-flex}.architecture-map-legend button{color:var(--vscode-textLink-foreground,var(--workbench-link));font:inherit;background:0 0;border:0;padding:0}.architecture-map-legend button:hover{text-decoration:underline}.architecture-map-legend i,.architecture-map-legend svg{background:var(--vscode-textLink-foreground,var(--compass-focus));flex:none;width:18px;height:2px}.architecture-map-legend svg{background:0 0;width:11px;height:11px}.architecture-map-legend i[data-evidence=inferred]{background:repeating-linear-gradient(90deg,var(--vscode-editorWarning-foreground,var(--warning)) 0 4px,transparent 4px 7px)}.architecture-map-legend i[data-direction=incoming]{background:var(--vscode-symbolIcon-interfaceForeground,#b7a1ff)}.architecture-map-legend i[data-direction=outgoing]{background:var(--vscode-charts-blue,#49a6ff)}.architecture-map-legend i[data-direction=bidirectional]{width:18px;height:12px;color:var(--vscode-textLink-foreground,var(--compass-focus));font:normal 10px/1 var(--compass-font-mono);background:0 0;place-items:center;display:grid}.architecture-map-legend i[data-direction=feedback]{background:repeating-linear-gradient(90deg,var(--vscode-textLink-foreground,var(--compass-focus)) 0 3px,transparent 3px 6px)}.architecture-map-table{flex:none;min-width:0;font-size:9px}.architecture-map-table summary{cursor:pointer;color:var(--muted-foreground);white-space:nowrap;padding:3px 0}.architecture-map-table[open]>div{z-index:8;border:1px solid var(--architecture-border);background:var(--architecture-raised);border-radius:6px;width:min(620px,100% - 24px);max-height:280px;position:absolute;bottom:42px;right:12px;overflow:auto;box-shadow:0 8px 24px #00000038}.architecture-map-table table{border-collapse:collapse;table-layout:fixed;width:100%}.architecture-map-table th,.architecture-map-table td{border-top:1px solid var(--architecture-border);overflow-wrap:anywhere;text-align:left;padding:5px 7px}.architecture-map-empty{min-width:min(100%,760px);min-height:100%;color:var(--muted-foreground);text-align:center;align-content:center;place-items:center;gap:5px;padding:30px;font-size:11px;display:grid}.architecture-map-empty strong{color:var(--foreground);font-size:12px}.architecture-map-footer{border-top:1px solid var(--architecture-border);background:var(--architecture-raised);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px 18px;min-width:0;min-height:40px;padding:8px 12px;display:flex;position:relative}.architecture-inspector{border-left:1px solid var(--architecture-border);grid-template-rows:auto auto auto 1fr auto;display:grid}.architecture-route-metrics,.architecture-evidence-counts{color:var(--muted-foreground);font:9px/1.3 var(--compass-font-mono);flex-wrap:wrap;gap:5px 12px;margin-top:9px;display:flex}.architecture-route-metrics span{align-items:center;gap:3px;display:inline-flex}.architecture-route-metrics svg{width:11px;height:11px}.architecture-inspector-tabs{border-bottom:1px solid var(--architecture-border);display:flex}.architecture-inspector-tabs button{min-height:32px;color:var(--muted-foreground);background:0 0;border:0;flex:1;font-size:10px;position:relative}.architecture-inspector-tabs button[aria-selected=true]{color:var(--foreground)}.architecture-inspector-tabs button[aria-selected=true]:after{background:var(--vscode-focusBorder,var(--ring));content:"";height:2px;position:absolute;bottom:-1px;left:10px;right:10px}.architecture-detail-filter{border-bottom:1px solid var(--architecture-border);padding:8px 10px;display:block;position:relative}.architecture-detail-filter>svg{left:19px}.architecture-inspector-scroll{min-height:0;padding:8px;overflow:auto}.architecture-symbol-list,.architecture-call-list{gap:6px;display:grid}.architecture-symbol-list article,.architecture-call-list article{border:1px solid var(--architecture-border);background:var(--vscode-editorWidget-background,var(--card));border-radius:5px;min-width:0;padding:9px}.architecture-symbol-list article{grid-template-columns:16px minmax(0,1fr);gap:7px;display:grid}.architecture-symbol-list svg{width:14px;height:14px;color:var(--vscode-symbolIcon-functionForeground,var(--compass-focus))}.architecture-symbol-list strong,.architecture-symbol-list small,.architecture-symbol-list article button,.architecture-symbol-list article span{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.architecture-symbol-list strong,.architecture-call-list strong{font-size:10px;font-weight:600}.architecture-symbol-list small,.architecture-call-list small{color:var(--muted-foreground);font:8.5px/1.35 var(--compass-font-mono);margin-top:2px}.architecture-symbol-list article button,.architecture-symbol-list article span{width:100%;color:var(--vscode-textLink-foreground,var(--workbench-link));font:8.5px/1.3 var(--compass-font-mono);text-align:left;background:0 0;border:0;margin-top:7px;padding:0}.architecture-symbol-list article span{color:var(--vscode-disabledForeground,var(--muted-foreground))}.architecture-call-list article>div:first-child{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:5px;display:grid}.architecture-call-list article>div:first-child strong{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.architecture-call-list article>div:first-child span{color:var(--vscode-textLink-foreground,var(--compass-focus))}.architecture-call-list article>div:last-child{gap:8px;margin-top:7px;display:flex}.architecture-call-list button{color:var(--vscode-textLink-foreground,var(--workbench-link));background:0 0;border:0;padding:0;font-size:8.5px}.architecture-call-list button:hover,.architecture-symbol-list button:hover{text-decoration:underline}.architecture-inspector>.workbench-pagination{border-top:1px solid var(--architecture-border);padding:7px 9px}.architecture-inspector-empty{min-height:160px;color:var(--muted-foreground);text-align:center;place-items:center;padding:24px;font-size:10px;line-height:1.5;display:grid}.architecture-loading-rows{gap:7px;display:grid}.architecture-loading-rows i{border:1px solid var(--architecture-border);background:linear-gradient(90deg,var(--architecture-raised),var(--architecture-raised),var(--architecture-raised));border-radius:5px;height:58px}@supports (color:color-mix(in lab,red,red)){.architecture-loading-rows i{background:linear-gradient(90deg,var(--architecture-raised),color-mix(in srgb,var(--architecture-raised) 72%,var(--foreground)),var(--architecture-raised))}}.architecture-loading-rows i{background-size:240% 100%;animation:1.3s infinite architecture-row-load}@keyframes architecture-row-load{to{background-position:-140% 0}}.architecture-workspace button:focus-visible,.architecture-workspace [role=button]:focus-visible,.architecture-workspace select:focus-visible,.architecture-workspace input:focus-visible,.architecture-workspace summary:focus-visible{outline:2px solid var(--vscode-focusBorder,var(--ring));outline-offset:-1px}body.vscode-high-contrast .architecture-map-node-card,body.vscode-high-contrast-light .architecture-map-node-card,body.vscode-high-contrast .architecture-map-panel,body.vscode-high-contrast-light .architecture-map-panel,body.vscode-high-contrast .architecture-symbol-list article,body.vscode-high-contrast-light .architecture-symbol-list article,body.vscode-high-contrast .architecture-call-list article,body.vscode-high-contrast-light .architecture-call-list article{stroke:var(--vscode-contrastBorder,var(--ring));border-color:var(--vscode-contrastBorder,var(--ring));stroke-width:2px}body.vscode-high-contrast .architecture-map-panel,body.vscode-high-contrast-light .architecture-map-panel{box-shadow:none;border-width:2px}@media(max-width:1100px){.architecture-workspace{grid-template-columns:200px minmax(440px,1fr) 300px}.architecture-workspace[data-inspector-open=false]{grid-template-columns:200px minmax(440px,1fr)}.architecture-command-bar{grid-template-columns:minmax(220px,1fr) auto 30px}.architecture-evidence-filter{grid-area:2/2}.architecture-inspector-toggle{grid-area:1/3}}@media(max-width:1180px){.architecture-workspace{grid-template-rows:minmax(650px,78vh) auto;grid-template-columns:minmax(190px,220px) minmax(0,1fr);height:auto;min-height:100vh;overflow:auto}.architecture-workspace[data-inspector-open=false]{grid-template-columns:minmax(190px,220px) minmax(0,1fr)}.architecture-rail{grid-row:1/span 2}.architecture-stage{min-height:650px}.architecture-inspector{border-top:1px solid var(--architecture-border);border-left:0;height:min(560px,72vh);min-height:440px;overflow:hidden}}@media(max-width:620px){.architecture-workspace{display:block}.architecture-rail{border-right:0;border-bottom:1px solid var(--architecture-border);max-height:310px}.architecture-rail nav{max-height:190px}.architecture-stage{min-height:650px}.architecture-command-bar{grid-template-columns:1fr}.architecture-evidence-filter,.architecture-inspector-toggle{grid-area:auto}.architecture-map-legend{display:none}}@media(prefers-reduced-motion:reduce){.architecture-route-line,.architecture-map-nodes g{transition:none}.architecture-loading-rows i{animation:none}}.call-guide-shell{box-sizing:border-box;background:radial-gradient(circle at 77% 8%,var(--compass-focus),transparent 28rem),var(--vscode-editor-background,var(--background));min-height:100vh;padding:clamp(28px,5vw,72px) clamp(20px,5vw,72px) 40px;position:relative;overflow:auto}@supports (color:color-mix(in lab,red,red)){.call-guide-shell{background:radial-gradient(circle at 77% 8%,color-mix(in srgb,var(--compass-focus) 9%,transparent),transparent 28rem),var(--vscode-editor-background,var(--background))}}.call-guide-shell{isolation:isolate}.call-guide-grid{z-index:-1;opacity:.19;background-image:linear-gradient(var(--compass-grid) 1px,transparent 1px),linear-gradient(90deg,var(--compass-grid) 1px,transparent 1px);pointer-events:none;background-size:32px 32px;position:fixed;inset:0;-webkit-mask-image:linear-gradient(#000,#0000 68%);mask-image:linear-gradient(#000,#0000 68%)}.call-guide-hero,.call-guide-section,.call-guide-footer{width:min(1120px,100%);margin-inline:auto}.call-guide-hero{border-bottom:1px solid var(--vscode-panel-border,var(--border));grid-template-columns:minmax(300px,.9fr) minmax(420px,1.1fr);align-items:center;gap:clamp(40px,7vw,96px);min-height:330px;padding-bottom:clamp(36px,5vw,64px);display:grid}.call-guide-kicker,.call-guide-overline,.call-guide-route-label,.call-guide-route-readout,.call-guide-shortcut,.call-guide-coverage-badge{font-family:var(--compass-font-mono);text-transform:uppercase;letter-spacing:.12em}.call-guide-kicker{color:var(--vscode-textLink-foreground,var(--compass-focus));align-items:center;gap:8px;font-size:10px;font-weight:700;display:inline-flex}.call-guide-kicker svg{width:14px;height:14px}.call-guide-intro h1{max-width:650px;color:var(--vscode-editor-foreground,var(--foreground));letter-spacing:-.052em;text-wrap:balance;margin:18px 0 0;font-size:clamp(34px,5vw,62px);font-weight:620;line-height:.98}.call-guide-lead{max-width:580px;color:var(--vscode-descriptionForeground,var(--muted-foreground));margin:22px 0 0;font-size:clamp(14px,1.7vw,17px);line-height:1.65}.call-guide-source{border:1px solid var(--vscode-panel-border,var(--border));background:var(--vscode-editorWidget-background,var(--card));border-radius:4px;align-items:center;gap:8px;max-width:min(100%,560px);min-height:34px;margin-top:24px;padding:0 10px;display:inline-flex}@supports (color:color-mix(in lab,red,red)){.call-guide-source{background:color-mix(in srgb,var(--vscode-editorWidget-background,var(--card)) 88%,transparent)}}.call-guide-source{color:var(--vscode-descriptionForeground,var(--muted-foreground));font:11px/1.3 var(--compass-font-mono)}.call-guide-lookup{max-width:620px;margin-top:26px;position:relative}.call-guide-lookup>label{color:var(--vscode-textLink-foreground,var(--compass-focus));font:700 9px/1 var(--compass-font-mono);letter-spacing:.12em;text-transform:uppercase;margin-bottom:8px;display:block}.call-guide-lookup-row{border:1px solid var(--vscode-input-border,var(--border));background:var(--vscode-input-background,var(--card));border-radius:5px;grid-template-columns:minmax(0,1fr) auto;display:grid;box-shadow:0 12px 32px #0000001f}.call-guide-lookup-row:focus-within{border-color:var(--vscode-focusBorder,var(--compass-focus));box-shadow:0 0 0 1px var(--vscode-focusBorder,var(--compass-focus)),0 12px 32px #0000001f}.call-guide-lookup-input{grid-template-columns:auto minmax(0,1fr);align-items:center;gap:9px;min-width:0;padding-inline:12px;display:grid}.call-guide-lookup-input svg{width:15px;height:15px;color:var(--vscode-textLink-foreground,var(--compass-focus))}.call-guide-lookup-input input{min-width:0;height:42px;color:var(--vscode-input-foreground,var(--foreground));font:12px/1 var(--compass-font-mono);background:0 0;border:0;outline:0;padding:0}.call-guide-lookup-input input::placeholder{color:var(--vscode-input-placeholderForeground,var(--muted-foreground))}.call-guide-lookup-row>button{background:var(--vscode-button-background,var(--compass-focus));color:var(--vscode-button-foreground,var(--primary-foreground));font:600 11px/1 var(--compass-font-sans);border:0;border-radius:3px;outline:0;align-items:center;gap:8px;margin:3px;padding:0 13px;display:inline-flex}.call-guide-lookup-row>button:hover:not(:disabled){background:var(--vscode-button-hoverBackground,var(--primary))}.call-guide-lookup-row>button:focus-visible,.call-guide-lookup-directions button:focus-visible{outline:2px solid var(--vscode-focusBorder,var(--ring));outline-offset:2px}.call-guide-lookup-row>button:disabled{cursor:not-allowed;opacity:.5}.call-guide-lookup-row>button svg{width:13px;height:13px}.call-guide-suggestions{border:1px solid var(--vscode-editorSuggestWidget-border,var(--vscode-panel-border,var(--border)));background:var(--vscode-editorSuggestWidget-background,var(--card));max-height:230px;color:var(--vscode-editorSuggestWidget-foreground,var(--foreground));border-radius:4px;margin-top:4px;display:grid;overflow-y:auto;box-shadow:0 12px 32px #00000029}.call-guide-suggestions-label,.call-guide-suggestions-hint{color:var(--vscode-descriptionForeground,var(--muted-foreground));font:9px/1.25 var(--compass-font-mono);padding-block:6px;padding-inline:10px}.call-guide-suggestions-label{letter-spacing:.08em;text-transform:uppercase}.call-guide-suggestions-hint{border-top:1px solid var(--vscode-editorSuggestWidget-border,var(--border));text-align:end}.call-guide-suggestions>button{min-width:0;color:inherit;text-align:start;background:0 0;border:0;outline:0;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:16px;padding-block:8px;padding-inline:10px;display:grid}.call-guide-suggestions>button:hover,.call-guide-suggestions>button[aria-selected=true]{background:var(--vscode-editorSuggestWidget-selectedBackground,var(--accent));color:var(--vscode-editorSuggestWidget-selectedForeground,var(--foreground))}.call-guide-suggestions>button:focus-visible{outline:2px solid var(--vscode-focusBorder,var(--ring));outline-offset:-2px}.call-guide-suggestions>button>span{min-width:0;font:11px/1.35 var(--compass-font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.call-guide-suggestions>button>small{color:var(--vscode-descriptionForeground,var(--muted-foreground));text-overflow:ellipsis;white-space:nowrap;font-size:10px;overflow:hidden}.call-guide-completion-status{border:1px solid var(--vscode-editorSuggestWidget-border,var(--vscode-panel-border,var(--border)));background:var(--vscode-editorSuggestWidget-background,var(--card));min-width:0;min-height:34px;color:var(--vscode-descriptionForeground,var(--muted-foreground));border-radius:4px;justify-content:space-between;align-items:center;gap:12px;margin-top:4px;padding-block:7px;padding-inline:10px;font-size:10px;display:flex}.call-guide-completion-status>span{overflow-wrap:anywhere;min-width:0}.call-guide-completion-status>button{border:1px solid var(--vscode-button-border,var(--border));background:var(--vscode-button-secondaryBackground,var(--secondary));color:var(--vscode-button-secondaryForeground,var(--secondary-foreground));font:inherit;border-radius:3px;flex:none;padding-block:3px;padding-inline:7px}.call-guide-completion-status>button:hover{background:var(--vscode-button-secondaryHoverBackground,var(--workbench-hover))}.call-guide-lookup-directions{border:0;align-items:center;gap:3px;margin:8px 0 0;padding:0;display:flex}.call-guide-lookup-directions legend{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.call-guide-lookup-directions button{min-height:25px;color:var(--vscode-descriptionForeground,var(--muted-foreground));font:9px/1 var(--compass-font-mono);text-transform:uppercase;background:0 0;border:1px solid #0000;border-radius:3px;outline:0;padding:0 9px}.call-guide-lookup-directions button:hover,.call-guide-lookup-directions button[aria-pressed=true]{border-color:var(--vscode-panel-border,var(--border));background:var(--vscode-list-hoverBackground,var(--workbench-hover));color:var(--vscode-editor-foreground,var(--foreground))}.call-guide-lookup-directions button[aria-pressed=true]{border-color:var(--vscode-focusBorder,var(--compass-focus))}@supports (color:color-mix(in lab,red,red)){.call-guide-lookup-directions button[aria-pressed=true]{border-color:color-mix(in srgb,var(--vscode-focusBorder,var(--compass-focus)) 65%,var(--border))}}.call-guide-lookup-directions>span{color:var(--vscode-disabledForeground,var(--compass-faint));font:9px/1 var(--compass-font-mono);margin-left:auto}.call-guide-source>span:not(.call-guide-source-light){text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.call-guide-source>svg{flex:none;width:14px;height:14px}.call-guide-source code{border-left:1px solid var(--vscode-panel-border,var(--border));color:var(--vscode-textLink-foreground,var(--compass-focus));font:inherit;flex:none;margin-left:3px;padding-left:9px}.call-guide-source-light{background:var(--vscode-disabledForeground,var(--compass-faint));border-radius:50%;flex:none;width:6px;height:6px}.call-guide-source[data-ready=true] .call-guide-source-light{background:var(--vscode-testing-iconPassed,var(--compass-success));box-shadow:0 0 9px var(--vscode-testing-iconPassed,var(--compass-success))}@supports (color:color-mix(in lab,red,red)){.call-guide-source[data-ready=true] .call-guide-source-light{box-shadow:0 0 9px color-mix(in srgb,var(--vscode-testing-iconPassed,var(--compass-success)) 60%,transparent)}}.call-guide-route{border:1px solid var(--vscode-panel-border,var(--border));background:linear-gradient(135deg,var(--vscode-editorWidget-background,var(--card)),var(--vscode-editor-background,var(--background)));border-radius:8px;padding:16px;position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.call-guide-route{background:linear-gradient(135deg,color-mix(in srgb,var(--vscode-editorWidget-background,var(--card)) 94%,transparent),color-mix(in srgb,var(--vscode-editor-background,var(--background)) 82%,transparent))}}.call-guide-route{box-shadow:0 24px 70px #00000038}.call-guide-route:before{content:"";border:1px solid var(--compass-focus);width:230px;height:230px;position:absolute;top:46%;left:50%}@supports (color:color-mix(in lab,red,red)){.call-guide-route:before{border:1px solid color-mix(in srgb,var(--compass-focus) 14%,transparent)}}.call-guide-route:before{box-shadow:0 0 0 44px var(--compass-focus),0 0 0 88px var(--compass-focus);border-radius:50%;transform:translate(-50%,-50%)}@supports (color:color-mix(in lab,red,red)){.call-guide-route:before{box-shadow:0 0 0 44px color-mix(in srgb,var(--compass-focus) 3%,transparent),0 0 0 88px color-mix(in srgb,var(--compass-focus) 2%,transparent)}}.call-guide-route:before{pointer-events:none}.call-guide-route-label,.call-guide-route-readout{z-index:2;color:var(--vscode-disabledForeground,var(--compass-faint));justify-content:space-between;font-size:9px;display:flex;position:relative}.call-guide-route-label code{color:var(--vscode-textLink-foreground,var(--compass-focus));font:inherit;text-transform:none}.call-guide-route-stage{z-index:1;grid-template-columns:repeat(3,minmax(0,1fr));align-items:center;gap:13%;min-height:226px;display:grid;position:relative}.call-guide-route-node{border:1px solid var(--vscode-panel-border,var(--border));background:var(--vscode-editor-background,var(--background));border-radius:5px;flex-direction:column;gap:4px;min-width:0;padding:12px;display:flex;position:relative;box-shadow:0 12px 32px #0003}.call-guide-route-node>span{color:var(--vscode-descriptionForeground,var(--muted-foreground));font:8px/1 var(--compass-font-mono);letter-spacing:.12em}.call-guide-route-node strong{color:var(--vscode-editor-foreground,var(--foreground));font:600 11px/1.3 var(--compass-font-mono);text-overflow:ellipsis;overflow:hidden}.call-guide-route-node small{color:var(--vscode-descriptionForeground,var(--muted-foreground));text-overflow:ellipsis;white-space:nowrap;font-size:9px;overflow:hidden}.call-guide-route-current{border-color:var(--vscode-focusBorder,var(--compass-focus));background:var(--vscode-focusBorder,var(--compass-focus));align-items:center;padding-block:17px}@supports (color:color-mix(in lab,red,red)){.call-guide-route-current{background:color-mix(in srgb,var(--vscode-focusBorder,var(--compass-focus)) 9%,var(--vscode-editor-background,var(--background)))}}.call-guide-route-current{text-align:center;box-shadow:0 0 0 1px var(--compass-focus),0 15px 40px var(--compass-focus)}@supports (color:color-mix(in lab,red,red)){.call-guide-route-current{box-shadow:0 0 0 1px color-mix(in srgb,var(--compass-focus) 16%,transparent),0 15px 40px color-mix(in srgb,var(--compass-focus) 14%,transparent)}}.call-guide-route-current>svg{width:17px;height:17px;color:var(--vscode-textLink-foreground,var(--compass-focus));margin-bottom:3px}.call-guide-route-line{z-index:-1;background:var(--compass-focus);width:32%;height:1px;position:absolute;top:50%;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.call-guide-route-line{background:color-mix(in srgb,var(--compass-focus) 44%,var(--border))}}.call-guide-route-line-in{left:18%}.call-guide-route-line-out{right:18%}.call-guide-route-line i{background:var(--vscode-focusBorder,var(--compass-focus));width:5px;height:5px;box-shadow:0 0 9px var(--vscode-focusBorder,var(--compass-focus));border-radius:50%;animation:2.2s linear infinite call-guide-trace;position:absolute;top:-2px}.call-guide-route-line-out i{animation-delay:1.1s}@keyframes call-guide-trace{0%{left:-8px}to{left:calc(100% + 8px)}}.call-guide-route-readout{border-top:1px solid var(--vscode-panel-border,var(--border));letter-spacing:.08em;padding-top:11px}.call-guide-section{border-bottom:1px solid var(--vscode-panel-border,var(--border));padding-block:clamp(34px,5vw,58px)}.call-guide-heading{justify-content:space-between;align-items:flex-end;gap:28px;margin-bottom:24px;display:flex}.call-guide-overline{color:var(--vscode-textLink-foreground,var(--compass-focus));margin-bottom:7px;font-size:9px;font-weight:700;display:block}.call-guide-heading h2{color:var(--vscode-editor-foreground,var(--foreground));letter-spacing:-.025em;margin:0;font-size:clamp(19px,2.4vw,26px);font-weight:600}.call-guide-heading>p{max-width:420px;color:var(--vscode-descriptionForeground,var(--muted-foreground));text-align:right;margin:0;font-size:11px;line-height:1.5}.call-guide-shortcut{color:var(--vscode-descriptionForeground,var(--muted-foreground));white-space:nowrap;align-items:center;gap:7px;font-size:9px;display:inline-flex}.call-guide-shortcut svg{width:12px;height:12px;color:var(--vscode-textLink-foreground,var(--compass-focus))}.call-guide-steps{grid-template-columns:minmax(170px,.8fr) minmax(340px,1.45fr) minmax(170px,.8fr);gap:10px;margin:0;padding:0;list-style:none;display:grid}.call-guide-steps>li{border:1px solid var(--vscode-panel-border,var(--border));background:var(--vscode-editorWidget-background,var(--card));border-radius:5px;align-content:start;gap:17px;min-height:168px;padding:18px;display:grid;position:relative}@supports (color:color-mix(in lab,red,red)){.call-guide-steps>li{background:color-mix(in srgb,var(--vscode-editorWidget-background,var(--card)) 72%,transparent)}}.call-guide-steps>li>svg{width:22px;height:22px;color:var(--vscode-textLink-foreground,var(--compass-focus))}.call-guide-step-number{color:var(--vscode-disabledForeground,var(--compass-faint));font:9px/1 var(--compass-font-mono);letter-spacing:.1em;position:absolute;top:17px;right:17px}.call-guide-steps h3{color:var(--vscode-editor-foreground,var(--foreground));margin:0;font-size:13px;font-weight:600}.call-guide-steps p{color:var(--vscode-descriptionForeground,var(--muted-foreground));margin:6px 0 0;font-size:11px;line-height:1.5}.call-guide-step-menu{grid-template-columns:minmax(150px,.85fr) minmax(195px,1.15fr);align-items:center}.call-guide-menu-preview{min-width:0;padding-right:44%;font-size:10px;position:relative}.call-guide-menu-parent,.call-guide-submenu{border:1px solid var(--vscode-menu-border,var(--border));background:var(--vscode-menu-background,var(--popover));color:var(--vscode-menu-foreground,var(--popover-foreground));border-radius:4px;box-shadow:0 12px 30px #00000040}.call-guide-menu-parent{border-color:var(--vscode-focusBorder,var(--compass-focus));background:var(--vscode-menu-selectionBackground,var(--accent));min-height:31px;color:var(--vscode-menu-selectionForeground,var(--accent-foreground));grid-template-columns:15px 1fr 13px;align-items:center;gap:7px;padding:0 8px;display:grid}.call-guide-menu-parent svg,.call-guide-submenu svg{width:13px;height:13px}.call-guide-submenu{z-index:2;width:58%;min-width:165px;padding:4px;position:absolute;top:22px;right:0}.call-guide-submenu span{white-space:nowrap;border-radius:2px;align-items:center;gap:7px;min-height:26px;padding:0 7px;display:flex}.call-guide-submenu span.is-active{background:var(--vscode-menu-selectionBackground,var(--accent));color:var(--vscode-menu-selectionForeground,var(--accent-foreground))}.call-guide-actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;display:grid}.call-guide-action{border:1px solid var(--vscode-panel-border,var(--border));background:var(--vscode-editorWidget-background,var(--card));min-height:104px;color:var(--vscode-editor-foreground,var(--foreground));font:inherit;text-align:left;border-radius:5px;outline:none;grid-template-columns:auto 1fr auto;align-items:center;gap:13px;padding:18px;transition:border-color .14s,background .14s,transform .14s;display:grid;position:relative}.call-guide-action:not(:disabled):hover{border-color:var(--vscode-focusBorder,var(--compass-focus));background:var(--vscode-list-hoverBackground,var(--workbench-hover))}@supports (color:color-mix(in lab,red,red)){.call-guide-action:not(:disabled):hover{background:color-mix(in srgb,var(--vscode-list-hoverBackground,var(--workbench-hover)) 70%,var(--vscode-editorWidget-background,var(--card)))}}.call-guide-action:not(:disabled):hover{transform:translateY(-2px)}.call-guide-action:focus-visible,.call-guide-walkthrough:focus-visible{outline:2px solid var(--vscode-focusBorder,var(--ring));outline-offset:2px}.call-guide-action:disabled{cursor:not-allowed;opacity:.46}.call-guide-action[data-primary=true]{border-color:var(--vscode-focusBorder,var(--compass-focus))}@supports (color:color-mix(in lab,red,red)){.call-guide-action[data-primary=true]{border-color:color-mix(in srgb,var(--vscode-focusBorder,var(--compass-focus)) 72%,var(--border))}}.call-guide-action[data-primary=true]{background:linear-gradient(130deg,var(--vscode-focusBorder,var(--compass-focus)),transparent 58%),var(--vscode-editorWidget-background,var(--card))}@supports (color:color-mix(in lab,red,red)){.call-guide-action[data-primary=true]{background:linear-gradient(130deg,color-mix(in srgb,var(--vscode-focusBorder,var(--compass-focus)) 13%,transparent),transparent 58%),var(--vscode-editorWidget-background,var(--card))}}.call-guide-action-icon{border:1px solid var(--vscode-panel-border,var(--border));background:var(--vscode-editor-background,var(--background));width:34px;height:34px;color:var(--vscode-textLink-foreground,var(--compass-focus));border-radius:4px;place-items:center;display:grid}.call-guide-action-icon svg{width:16px;height:16px}.call-guide-action strong,.call-guide-action small{display:block}.call-guide-action strong{font-size:12px;font-weight:600}.call-guide-action small{color:var(--vscode-descriptionForeground,var(--muted-foreground));margin-top:5px;font-size:10px}.call-guide-action-arrow{width:15px;height:15px;color:var(--vscode-disabledForeground,var(--compass-faint));transition:transform .14s}.call-guide-action:not(:disabled):hover .call-guide-action-arrow{color:var(--vscode-textLink-foreground,var(--compass-focus));transform:translate(3px)}.call-guide-action em{color:var(--vscode-textLink-foreground,var(--compass-focus));font:normal 8px/1 var(--compass-font-mono);letter-spacing:.08em;text-transform:uppercase;position:absolute;top:8px;right:8px}.call-guide-footer{justify-content:space-between;align-items:center;gap:30px;padding-top:24px;display:flex}.call-guide-coverage{align-items:center;gap:13px;max-width:760px;display:flex}.call-guide-coverage-badge{border:1px solid var(--vscode-testing-iconPassed,var(--compass-success));flex:none;padding:5px 7px}@supports (color:color-mix(in lab,red,red)){.call-guide-coverage-badge{border:1px solid color-mix(in srgb,var(--vscode-testing-iconPassed,var(--compass-success)) 50%,var(--border))}}.call-guide-coverage-badge{color:var(--vscode-testing-iconPassed,var(--compass-success));border-radius:3px;font-size:8px;font-weight:700}.call-guide-coverage p{color:var(--vscode-descriptionForeground,var(--muted-foreground));margin:0;font-size:10px;line-height:1.55}.call-guide-walkthrough{color:var(--vscode-textLink-foreground,var(--compass-focus));font:11px/1 var(--compass-font-sans);background:0 0;border:0;outline:none;flex:none;align-items:center;gap:7px;padding:7px 0;display:inline-flex}.call-guide-walkthrough svg{width:14px;height:14px}.call-guide-walkthrough svg:last-child{width:12px;transition:transform .14s}.call-guide-walkthrough:hover svg:last-child{transform:translate(2px)}body.vscode-high-contrast .call-guide-route,body.vscode-high-contrast-light .call-guide-route,body.vscode-high-contrast .call-guide-steps>li,body.vscode-high-contrast-light .call-guide-steps>li,body.vscode-high-contrast .call-guide-action,body.vscode-high-contrast-light .call-guide-action,body.vscode-high-contrast .call-guide-lookup-row,body.vscode-high-contrast-light .call-guide-lookup-row,body.vscode-high-contrast .call-guide-suggestions,body.vscode-high-contrast-light .call-guide-suggestions,body.vscode-high-contrast .call-guide-completion-status,body.vscode-high-contrast-light .call-guide-completion-status{border-width:2px;border-color:var(--vscode-contrastBorder,var(--ring))}@media(max-width:900px){.call-guide-hero{grid-template-columns:1fr;gap:32px}.call-guide-route{box-sizing:border-box;width:min(620px,100%)}.call-guide-steps{grid-template-columns:1fr 1fr}.call-guide-step-menu{grid-area:2/1/auto/-1}}@media(max-width:680px){.call-guide-shell{padding-inline:16px}.call-guide-heading,.call-guide-footer{flex-direction:column;align-items:flex-start}.call-guide-heading>p{text-align:left}.call-guide-shortcut{display:none}.call-guide-steps,.call-guide-actions{grid-template-columns:1fr}.call-guide-step-menu{grid-area:auto;grid-template-columns:1fr}.call-guide-menu-preview{padding-right:min(42%,180px)}.call-guide-coverage{flex-direction:column;align-items:flex-start}}@media(max-width:440px){.call-guide-lookup-row{grid-template-columns:1fr}.call-guide-lookup-row>button{justify-content:center;min-height:36px}.call-guide-lookup-directions{flex-wrap:wrap}.call-guide-lookup-directions>span{width:100%;margin:5px 0 0}.call-guide-suggestions>button{grid-template-columns:minmax(0,1fr);gap:2px}.call-guide-suggestions>button>small{white-space:normal}.call-guide-route-stage{gap:5%}.call-guide-route-node{padding:9px 7px}.call-guide-route-node small{display:none}.call-guide-menu-preview{padding:0}.call-guide-submenu{width:auto;margin:6px 0 0 18px;position:relative;top:auto}}@media(prefers-reduced-motion:reduce){.call-guide-route-line i{animation:none}.call-guide-action,.call-guide-action-arrow,.call-guide-walkthrough svg:last-child{transition:none}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}} diff --git a/crates/compass-output/src/architecture_projection/mod.rs b/crates/compass-output/src/architecture_projection/mod.rs new file mode 100644 index 00000000..68a2bcca --- /dev/null +++ b/crates/compass-output/src/architecture_projection/mod.rs @@ -0,0 +1,1517 @@ +mod model; +mod names; +mod relation; +mod scope; + +use std::collections::{BTreeMap, BTreeSet}; + +use compass_graph::{Communities, score_communities}; +use compass_model::{GraphDocument, NodeRecord}; +use thiserror::Error; + +pub use model::*; + +use names::{ + community_name, disambiguate_names, membership_signature, owner_display_name, owner_name, + stable_fragment, +}; +use relation::classify_relation; +use scope::{classify_source, generated_paths, normalized_path, path_matches_prefix}; + +pub struct ArchitectureProjectionInput<'a> { + pub document: &'a GraphDocument, + pub communities: &'a Communities, + pub community_labels: Option<&'a BTreeMap>, + pub overlay: Option<&'a ArchitectureOverlay>, + pub project_name: &'a str, + pub built_at_commit: Option<&'a str>, + pub generated_at: Option<&'a str>, +} + +#[derive(Debug, Error)] +pub enum ArchitectureProjectionError { + #[error("architecture projection requires at least one scope")] + MissingScope, + #[error("architecture projection limit {name} exceeded: required {required}, limit {limit}")] + LimitExceeded { + name: &'static str, + required: usize, + limit: usize, + }, + #[error("invalid architecture overlay: {0}")] + InvalidOverlay(String), + #[error("node {node} belongs to communities {first} and {second}")] + DuplicateCommunity { + node: String, + first: usize, + second: usize, + }, + #[error("architecture projection invariant failed: {0}")] + Invariant(String), +} + +#[derive(Clone, Debug)] +struct OwnerAssignment { + key: String, + display_name: String, + provenance: ArchitectureNameProvenance, + evidence: Vec, + pinned: bool, +} + +#[derive(Clone, Debug)] +struct GroupBuild { + id: String, + parent_id: Option, + kind: ArchitectureGroupKind, + name: ArchitectureGroupName, + owner_key: String, + community_ids: Vec, + node_ids: Vec, + relationship_count: usize, + neighbors: BTreeSet, + cohesion: f64, + source_scopes: ArchitectureSourceCounts, + pinned: bool, + rank: usize, +} + +#[derive(Clone, Debug, Default)] +struct RouteBuild { + relationship_count: usize, + relation_classes: ArchitectureClassCounts, + evidence: ArchitectureEvidenceCounts, +} + +#[derive(Clone, Debug)] +struct ScopeBuild { + groups: Vec, + memberships: Vec, + node_to_leaf: BTreeMap, + node_to_overview: BTreeMap, +} + +#[derive(Clone, Debug)] +struct MembershipBuild { + node_id: String, + group_id: String, +} + +pub fn project_architecture( + input: ArchitectureProjectionInput<'_>, + options: &ArchitectureProjectionOptions, +) -> Result { + validate_options(options)?; + validate_overlay(input.overlay)?; + check_limit( + "max_nodes", + input.document.nodes.len(), + options.limits.max_nodes, + )?; + check_limit( + "max_relationships", + input.document.links.len(), + options.limits.max_relationships, + )?; + let node_communities = node_communities(input.document, input.communities)?; + let generated = generated_paths(input.document); + let source_nodes = input + .document + .nodes + .iter() + .map(|node| (node.id.clone(), node)) + .collect::>(); + let mut nodes = input + .document + .nodes + .iter() + .map(|node| { + let source_file = node.source_file().map(str::to_owned).or_else(|| { + let value = node.string("source_file"); + (!value.is_empty()).then_some(value) + }); + let scope = classify_source(source_file.as_deref(), &generated, input.overlay); + ArchitectureNode { + id: node.id.clone(), + label: node.display_label(), + kind: node.kind_name().to_owned(), + source_file, + source_scope: scope.scope, + scope_reason: scope.reason.to_owned(), + community: node_communities.get(&node.id).copied(), + } + }) + .collect::>(); + nodes.sort_by(|left, right| left.id.cmp(&right.id)); + let node_index = nodes + .iter() + .enumerate() + .map(|(index, node)| (node.id.as_str(), index)) + .collect::>(); + if node_index.len() != nodes.len() { + return Err(ArchitectureProjectionError::Invariant( + "node IDs must be unique".to_owned(), + )); + } + let relationships = architecture_relationships(input.document); + if let Some(relationship) = relationships.iter().find(|relationship| { + !node_index.contains_key(relationship.source.as_str()) + || !node_index.contains_key(relationship.target.as_str()) + }) { + return Err(ArchitectureProjectionError::Invariant(format!( + "relationship {} has an endpoint outside the projected node set", + relationship.id + ))); + } + let community_scores = score_communities(input.document, input.communities); + let mut projections = Vec::new(); + for scope in &options.scopes { + projections.push(build_scope_projection( + *scope, + options.default_lens, + &nodes, + &node_index, + &relationships, + &source_nodes, + input.community_labels, + input.overlay, + &community_scores, + options.limits, + )?); + } + projections.sort_by_key(|projection| projection.scope); + let confidence_count = |expected: &str| { + relationships + .iter() + .filter(|relationship| relationship.confidence == expected) + .count() + }; + Ok(ArchitectureViewModel { + schema: ARCHITECTURE_VIEWER_SCHEMA, + title: format!("{} — Architecture", input.project_name), + statistics: ArchitectureStatistics { + nodes: nodes.len(), + relationships: relationships.len(), + communities: input.communities.len(), + extracted: confidence_count("extracted"), + inferred: confidence_count("inferred"), + ambiguous: confidence_count("ambiguous"), + }, + nodes, + relationships, + projections, + provenance: ArchitectureProvenance { + project_name: input.project_name.to_owned(), + built_at_commit: input.built_at_commit.map(str::to_owned), + generated_at: input.generated_at.map(str::to_owned), + }, + limits: options.limits, + }) +} + +fn validate_options( + options: &ArchitectureProjectionOptions, +) -> Result<(), ArchitectureProjectionError> { + if options.scopes.is_empty() { + return Err(ArchitectureProjectionError::MissingScope); + } + for (name, value) in [ + ("max_nodes", options.limits.max_nodes), + ("max_relationships", options.limits.max_relationships), + ("max_groups", options.limits.max_groups), + ("max_routes", options.limits.max_routes), + ("max_overview_groups", options.limits.max_overview_groups), + ("max_overview_routes", options.limits.max_overview_routes), + ("max_name_candidates", options.limits.max_name_candidates), + ("max_name_evidence", options.limits.max_name_evidence), + ("max_diagnostics", options.limits.max_diagnostics), + ( + "max_omission_witnesses", + options.limits.max_omission_witnesses, + ), + ] { + if value == 0 { + return Err(ArchitectureProjectionError::LimitExceeded { + name, + required: 1, + limit: 0, + }); + } + } + Ok(()) +} + +fn validate_overlay( + overlay: Option<&ArchitectureOverlay>, +) -> Result<(), ArchitectureProjectionError> { + let Some(overlay) = overlay else { + return Ok(()); + }; + if overlay.schema != ARCHITECTURE_OVERLAY_SCHEMA { + return Err(ArchitectureProjectionError::InvalidOverlay(format!( + "unsupported schema {}", + overlay.schema + ))); + } + let mut source_prefixes = Vec::new(); + for rule in &overlay.source_rules { + validate_overlay_prefix(&rule.path_prefix)?; + let prefix = normalized_path(&rule.path_prefix); + if prefix.is_empty() { + return Err(ArchitectureProjectionError::InvalidOverlay( + "source path prefixes must not be empty".to_owned(), + )); + } + source_prefixes.push(prefix); + } + reject_overlapping_prefixes(&source_prefixes, "source rules")?; + + let mut ids = BTreeSet::new(); + let mut communities = BTreeSet::new(); + let mut group_prefixes = Vec::new(); + for group in &overlay.groups { + let id = group.id.trim(); + if id.is_empty() || group.name.trim().is_empty() { + return Err(ArchitectureProjectionError::InvalidOverlay( + "group IDs and names must not be empty".to_owned(), + )); + } + if !ids.insert(id.to_owned()) { + return Err(ArchitectureProjectionError::InvalidOverlay(format!( + "duplicate group ID {id}" + ))); + } + if group.path_prefixes.is_empty() && group.communities.is_empty() { + return Err(ArchitectureProjectionError::InvalidOverlay(format!( + "group {id} has no selectors" + ))); + } + for community in &group.communities { + if !communities.insert(*community) { + return Err(ArchitectureProjectionError::InvalidOverlay(format!( + "community {community} is selected by more than one group" + ))); + } + } + for prefix in &group.path_prefixes { + validate_overlay_prefix(prefix)?; + let prefix = normalized_path(prefix); + if prefix.is_empty() { + return Err(ArchitectureProjectionError::InvalidOverlay(format!( + "group {id} has an empty path prefix" + ))); + } + group_prefixes.push(prefix); + } + } + reject_overlapping_prefixes(&group_prefixes, "group selectors") +} + +fn validate_overlay_prefix(prefix: &str) -> Result<(), ArchitectureProjectionError> { + let portable = prefix.trim().replace('\\', "/"); + if portable.is_empty() + || portable.starts_with('/') + || portable.contains('\0') + || portable + .split('/') + .any(|part| matches!(part, "" | "." | "..")) + || portable + .split('/') + .next() + .is_some_and(|part| part.contains(':')) + { + return Err(ArchitectureProjectionError::InvalidOverlay(format!( + "path prefix must be a contained relative path: {prefix}" + ))); + } + Ok(()) +} + +fn reject_overlapping_prefixes( + prefixes: &[String], + label: &str, +) -> Result<(), ArchitectureProjectionError> { + for (index, left) in prefixes.iter().enumerate() { + for right in prefixes.iter().skip(index + 1) { + if path_matches_prefix(left, right) || path_matches_prefix(right, left) { + return Err(ArchitectureProjectionError::InvalidOverlay(format!( + "overlapping {label}: {left} and {right}" + ))); + } + } + } + Ok(()) +} + +fn node_communities( + document: &GraphDocument, + communities: &Communities, +) -> Result, ArchitectureProjectionError> { + let mut result = BTreeMap::new(); + for (community, members) in communities { + for member in members { + if let Some(previous) = result.insert(member.clone(), *community) + && previous != *community + { + return Err(ArchitectureProjectionError::DuplicateCommunity { + node: member.clone(), + first: previous, + second: *community, + }); + } + } + } + for node in &document.nodes { + if !result.contains_key(&node.id) + && let Some(community) = node + .unsigned("community") + .and_then(|value| usize::try_from(value).ok()) + { + result.insert(node.id.clone(), community); + } + } + Ok(result) +} + +fn architecture_relationships(document: &GraphDocument) -> Vec { + let mut keyed = document + .links + .iter() + .map(|edge| { + let relation = edge.string("relation").to_ascii_lowercase(); + let confidence = confidence(&edge.string("confidence")); + let canonical_attributes = edge + .attributes + .iter() + .map(|(key, value)| (key.clone(), value.clone())) + .collect::>(); + let attributes = serde_json::to_string(&canonical_attributes).unwrap_or_default(); + let key = format!( + "{}\0{}\0{}\0{}\0{}", + edge.source, edge.target, relation, confidence, attributes + ); + ( + key, + edge.source.clone(), + edge.target.clone(), + relation, + confidence, + ) + }) + .collect::>(); + keyed.sort(); + let mut duplicate_ordinals = BTreeMap::::new(); + keyed + .into_iter() + .map(|(key, source, target, relation, confidence)| { + let ordinal = duplicate_ordinals.entry(key.clone()).or_default(); + let id = format!("relationship:{}:{ordinal}", stable_fragment(&key)); + *ordinal += 1; + ArchitectureRelationship { + id, + source, + target, + relation_class: classify_relation(&relation), + relation, + confidence, + } + }) + .collect() +} + +#[allow(clippy::too_many_arguments)] +fn build_scope_projection( + scope: ArchitectureScope, + default_lens: ArchitectureLens, + nodes: &[ArchitectureNode], + node_index: &BTreeMap<&str, usize>, + relationships: &[ArchitectureRelationship], + source_nodes: &BTreeMap, + community_labels: Option<&BTreeMap>, + overlay: Option<&ArchitectureOverlay>, + community_scores: &BTreeMap, + limits: ArchitectureProjectionLimits, +) -> Result { + let mut owner_communities = BTreeMap::, Vec>>::new(); + let mut owner_assignments = BTreeMap::::new(); + let mut scoped_node_ids = BTreeSet::new(); + let mut source_counts = ArchitectureSourceCounts::default(); + for node in nodes + .iter() + .filter(|node| scope_includes(scope, node.source_scope)) + { + scoped_node_ids.insert(node.id.clone()); + source_counts.increment(node.source_scope); + let assignment = owner_assignment(node, overlay); + owner_communities + .entry(assignment.key.clone()) + .or_default() + .entry(node.community) + .or_default() + .push(node.id.clone()); + owner_assignments + .entry(assignment.key.clone()) + .or_insert(assignment); + } + let mut groups = Vec::::new(); + let mut memberships = Vec::new(); + let mut node_to_leaf = BTreeMap::new(); + let mut node_to_overview = BTreeMap::new(); + for (owner_key, community_buckets) in owner_communities { + let Some(assignment) = owner_assignments.get(&owner_key) else { + return Err(ArchitectureProjectionError::Invariant(format!( + "owner {owner_key} has no assignment" + ))); + }; + let owner_id = format!("owner:{}", stable_fragment(&owner_key)); + let mut owner_nodes = community_buckets + .values() + .flat_map(|ids| ids.iter().cloned()) + .collect::>(); + owner_nodes.sort(); + let owner_source_counts = source_counts_for_ids(&owner_nodes, nodes, node_index); + let mut community_ids = community_buckets + .keys() + .filter_map(|value| *value) + .collect::>(); + community_ids.sort_unstable(); + let owner_cohesion = average_community_score(&community_ids, community_scores); + if community_buckets.len() <= 1 { + let community = community_buckets.keys().next().copied().flatten(); + let name = owner_name( + assignment.display_name.clone(), + &owner_nodes, + assignment.provenance, + assignment.evidence.clone(), + ); + for node_id in &owner_nodes { + memberships.push(MembershipBuild { + node_id: node_id.clone(), + group_id: owner_id.clone(), + }); + node_to_leaf.insert(node_id.clone(), owner_id.clone()); + node_to_overview.insert(node_id.clone(), owner_id.clone()); + } + groups.push(GroupBuild { + id: owner_id, + parent_id: None, + kind: ArchitectureGroupKind::Subsystem, + name, + owner_key, + community_ids: community.into_iter().collect(), + node_ids: owner_nodes, + relationship_count: 0, + neighbors: BTreeSet::new(), + cohesion: owner_cohesion, + source_scopes: owner_source_counts, + pinned: assignment.pinned, + rank: 0, + }); + continue; + } + groups.push(GroupBuild { + id: owner_id.clone(), + parent_id: None, + kind: ArchitectureGroupKind::Owner, + name: owner_name( + assignment.display_name.clone(), + &owner_nodes, + assignment.provenance, + assignment.evidence.clone(), + ), + owner_key: owner_key.clone(), + community_ids: community_ids.clone(), + node_ids: owner_nodes, + relationship_count: 0, + neighbors: BTreeSet::new(), + cohesion: owner_cohesion, + source_scopes: owner_source_counts, + pinned: assignment.pinned, + rank: 0, + }); + for (community, mut member_ids) in community_buckets { + member_ids.sort(); + let community_fragment = stable_fragment(&membership_signature(&member_ids)); + let group_id = format!("group:{}:{community_fragment}", stable_fragment(&owner_key)); + let name = community_name( + community, + &assignment.display_name, + &member_ids, + source_nodes, + community_labels, + limits.max_name_evidence, + ); + let community_ids = community.into_iter().collect::>(); + let group_cohesion = average_community_score(&community_ids, community_scores); + let group_source_counts = source_counts_for_ids(&member_ids, nodes, node_index); + for node_id in &member_ids { + memberships.push(MembershipBuild { + node_id: node_id.clone(), + group_id: group_id.clone(), + }); + node_to_leaf.insert(node_id.clone(), group_id.clone()); + node_to_overview.insert(node_id.clone(), owner_id.clone()); + } + groups.push(GroupBuild { + id: group_id, + parent_id: Some(owner_id.clone()), + kind: ArchitectureGroupKind::Subsystem, + name, + owner_key: owner_key.clone(), + community_ids, + node_ids: member_ids, + relationship_count: 0, + neighbors: BTreeSet::new(), + cohesion: group_cohesion, + source_scopes: group_source_counts, + pinned: false, + rank: 0, + }); + } + } + check_limit("max_groups", groups.len(), limits.max_groups)?; + memberships.sort_by(|left, right| left.node_id.cmp(&right.node_id)); + let mut build = ScopeBuild { + groups, + memberships, + node_to_leaf, + node_to_overview, + }; + let (routes, coverage) = build_routes_and_group_stats( + &mut build, + relationships, + &scoped_node_ids, + default_lens, + limits.max_routes, + )?; + rank_and_disambiguate(&mut build.groups); + let (overview_group_ids, overview_route_ids, omissions) = overview_selection( + &build, + &routes, + relationships, + &scoped_node_ids, + default_lens, + limits, + ); + let quality = architecture_quality( + scope, + &build, + relationships, + &scoped_node_ids, + source_counts, + &coverage, + &omissions, + limits.max_diagnostics, + ); + let group_indexes = build + .groups + .iter() + .enumerate() + .map(|(index, group)| (group.id.as_str(), index)) + .collect::>(); + let memberships = build + .memberships + .iter() + .map(|membership| { + let node_index = node_index + .get(membership.node_id.as_str()) + .copied() + .ok_or_else(|| { + ArchitectureProjectionError::Invariant(format!( + "membership node {} is outside the projected node set", + membership.node_id + )) + })?; + let group_index = group_indexes + .get(membership.group_id.as_str()) + .copied() + .ok_or_else(|| { + ArchitectureProjectionError::Invariant(format!( + "membership group {} is outside its scope projection", + membership.group_id + )) + })?; + Ok(ArchitectureMembership { + node_index, + group_index, + }) + }) + .collect::, ArchitectureProjectionError>>()?; + drop(group_indexes); + let groups = build + .groups + .into_iter() + .map(|group| ArchitectureGroup { + id: group.id, + parent_id: group.parent_id, + kind: group.kind, + rank: group.rank, + name: group.name, + owner_key: group.owner_key, + community_ids: group.community_ids, + node_count: group.node_ids.len(), + relationship_count: group.relationship_count, + neighbor_count: group.neighbors.len(), + cohesion: group.cohesion, + source_scopes: group.source_scopes, + pinned: group.pinned, + }) + .collect(); + Ok(ArchitectureScopeProjection { + scope, + default_lens, + groups, + memberships, + routes, + overview_group_ids, + overview_route_ids, + coverage, + omissions, + quality, + }) +} + +fn owner_assignment( + node: &ArchitectureNode, + overlay: Option<&ArchitectureOverlay>, +) -> OwnerAssignment { + if let Some(group) = overlay.and_then(|overlay| { + overlay.groups.iter().find(|group| { + node.community + .is_some_and(|community| group.communities.contains(&community)) + || node.source_file.as_deref().is_some_and(|path| { + let path = normalized_path(path); + group + .path_prefixes + .iter() + .map(|prefix| normalized_path(prefix)) + .any(|prefix| path_matches_prefix(&path, &prefix)) + }) + }) + }) { + return OwnerAssignment { + key: format!("overlay/{}", group.id.trim()), + display_name: group.name.trim().to_owned(), + provenance: ArchitectureNameProvenance::Overlay, + evidence: vec![format!("overlay:{}", group.id.trim())], + pinned: group.pin, + }; + } + let owner_key = node + .source_file + .as_deref() + .map(automatic_owner_key) + .unwrap_or_else(|| "unknown".to_owned()); + OwnerAssignment { + display_name: owner_display_name(&owner_key), + evidence: vec![format!("owner:{owner_key}")], + key: owner_key, + provenance: ArchitectureNameProvenance::Owner, + pinned: false, + } +} + +fn automatic_owner_key(source_file: &str) -> String { + let normalized = normalized_path(source_file); + let mut segments = normalized.split('/').filter(|segment| !segment.is_empty()); + let first = segments.next().unwrap_or("root"); + let second = segments.next(); + if matches!( + first, + "crates" | "packages" | "apps" | "services" | "editors" | "plugins" | "modules" + ) && let Some(second) = second + { + return format!("{first}/{second}"); + } + if matches!(first, "src" | "lib" | "app") + && let Some(second) = second + && !is_filename(second) + { + return format!("{first}/{second}"); + } + if is_filename(first) { + "root".to_owned() + } else { + first.to_owned() + } +} + +fn is_filename(segment: &str) -> bool { + segment.rsplit_once('.').is_some() +} + +fn scope_includes(scope: ArchitectureScope, source_scope: ArchitectureSourceScope) -> bool { + matches!(scope, ArchitectureScope::AllCode) + || matches!(source_scope, ArchitectureSourceScope::Production) +} + +fn source_counts_for_ids( + ids: &[String], + nodes: &[ArchitectureNode], + node_index: &BTreeMap<&str, usize>, +) -> ArchitectureSourceCounts { + let mut counts = ArchitectureSourceCounts::default(); + for id in ids { + if let Some(index) = node_index.get(id.as_str()) + && let Some(node) = nodes.get(*index) + { + counts.increment(node.source_scope); + } + } + counts +} + +fn average_community_score(community_ids: &[usize], scores: &BTreeMap) -> f64 { + if community_ids.is_empty() { + return 0.0; + } + let sum = community_ids + .iter() + .map(|community| scores.get(community).copied().unwrap_or_default()) + .sum::(); + sum / community_ids.len() as f64 +} + +fn build_routes_and_group_stats( + build: &mut ScopeBuild, + relationships: &[ArchitectureRelationship], + scoped_node_ids: &BTreeSet, + default_lens: ArchitectureLens, + max_routes: usize, +) -> Result<(Vec, ArchitectureCoverage), ArchitectureProjectionError> { + let mut routes = + BTreeMap::<(ArchitectureRouteLevel, Option, String, String), RouteBuild>::new(); + let mut coverage = ArchitectureCoverage { + admitted: 0, + internal: 0, + cross_group: 0, + unassigned: 0, + relation_classes: ArchitectureClassCounts::default(), + }; + let group_positions = build + .groups + .iter() + .enumerate() + .map(|(index, group)| (group.id.clone(), index)) + .collect::>(); + for relationship in relationships.iter().filter(|relationship| { + scoped_node_ids.contains(&relationship.source) + && scoped_node_ids.contains(&relationship.target) + }) { + coverage + .relation_classes + .increment(relationship.relation_class); + if !default_lens.admits(relationship.relation_class) { + continue; + } + coverage.admitted += 1; + let (Some(source_leaf), Some(target_leaf), Some(source_overview), Some(target_overview)) = ( + build.node_to_leaf.get(&relationship.source), + build.node_to_leaf.get(&relationship.target), + build.node_to_overview.get(&relationship.source), + build.node_to_overview.get(&relationship.target), + ) else { + coverage.unassigned += 1; + continue; + }; + let touched_groups = [source_leaf, target_leaf, source_overview, target_overview] + .into_iter() + .collect::>(); + for group_id in touched_groups { + if let Some(position) = group_positions.get(group_id) + && let Some(group) = build.groups.get_mut(*position) + { + group.relationship_count += 1; + } + } + if source_leaf == target_leaf { + coverage.internal += 1; + } else { + coverage.cross_group += 1; + if let (Some(source), Some(target)) = ( + group_positions.get(source_leaf), + group_positions.get(target_leaf), + ) { + if let Some(source_group) = build.groups.get_mut(*source) { + source_group.neighbors.insert(target_leaf.clone()); + } + if let Some(target_group) = build.groups.get_mut(*target) { + target_group.neighbors.insert(source_leaf.clone()); + } + } + increment_route( + routes + .entry(( + ArchitectureRouteLevel::Detail, + common_owner(source_leaf, target_leaf, &build.groups), + source_leaf.clone(), + target_leaf.clone(), + )) + .or_default(), + relationship, + ); + } + if source_overview != target_overview { + if let (Some(source), Some(target)) = ( + group_positions.get(source_overview), + group_positions.get(target_overview), + ) { + if let Some(source_group) = build.groups.get_mut(*source) { + source_group.neighbors.insert(target_overview.clone()); + } + if let Some(target_group) = build.groups.get_mut(*target) { + target_group.neighbors.insert(source_overview.clone()); + } + } + increment_route( + routes + .entry(( + ArchitectureRouteLevel::Overview, + None, + source_overview.clone(), + target_overview.clone(), + )) + .or_default(), + relationship, + ); + } + } + check_limit("max_routes", routes.len(), max_routes)?; + let mut output = routes + .into_iter() + .map( + |((level, owner_id, source_group, target_group), route)| ArchitectureRoute { + id: format!( + "route:{}:{}:{}", + match level { + ArchitectureRouteLevel::Overview => "overview", + ArchitectureRouteLevel::Detail => "detail", + }, + stable_fragment(&source_group), + stable_fragment(&target_group) + ), + level, + owner_id, + source_group, + target_group, + relationship_count: route.relationship_count, + relation_classes: route.relation_classes, + evidence: route.evidence, + }, + ) + .collect::>(); + output.sort_by(|left, right| { + left.level + .cmp(&right.level) + .then_with(|| right.relationship_count.cmp(&left.relationship_count)) + .then_with(|| left.id.cmp(&right.id)) + }); + Ok((output, coverage)) +} + +fn common_owner(source: &str, target: &str, groups: &[GroupBuild]) -> Option { + let source_parent = groups + .iter() + .find(|group| group.id == source) + .and_then(|group| group.parent_id.clone()); + let target_parent = groups + .iter() + .find(|group| group.id == target) + .and_then(|group| group.parent_id.clone()); + (source_parent.is_some() && source_parent == target_parent) + .then_some(source_parent) + .flatten() +} + +fn increment_route(route: &mut RouteBuild, relationship: &ArchitectureRelationship) { + route.relationship_count += 1; + route + .relation_classes + .increment(relationship.relation_class); + match relationship.confidence.as_str() { + "inferred" => route.evidence.inferred += 1, + "ambiguous" => route.evidence.ambiguous += 1, + _ => route.evidence.extracted += 1, + } +} + +fn rank_and_disambiguate(groups: &mut [GroupBuild]) { + let mut order = (0..groups.len()).collect::>(); + order.sort_by(|left, right| { + groups[*right] + .pinned + .cmp(&groups[*left].pinned) + .then_with(|| { + groups[*right] + .node_ids + .len() + .cmp(&groups[*left].node_ids.len()) + }) + .then_with(|| { + groups[*right] + .relationship_count + .cmp(&groups[*left].relationship_count) + }) + .then_with(|| { + groups[*right] + .neighbors + .len() + .cmp(&groups[*left].neighbors.len()) + }) + .then_with(|| groups[*right].cohesion.total_cmp(&groups[*left].cohesion)) + .then_with(|| groups[*left].id.cmp(&groups[*right].id)) + }); + for (rank, index) in order.into_iter().enumerate() { + groups[index].rank = rank + 1; + } + let mut names = groups + .iter() + .map(|group| group.name.clone()) + .collect::>(); + let owners = groups + .iter() + .map(|group| group.owner_key.clone()) + .collect::>(); + disambiguate_names(&mut names, &owners); + for (group, name) in groups.iter_mut().zip(names) { + group.name = name; + } + groups.sort_by_key(|group| group.rank); +} + +#[allow(clippy::too_many_arguments)] +fn overview_selection( + build: &ScopeBuild, + routes: &[ArchitectureRoute], + relationships: &[ArchitectureRelationship], + scoped_node_ids: &BTreeSet, + default_lens: ArchitectureLens, + limits: ArchitectureProjectionLimits, +) -> (Vec, Vec, ArchitectureOmissions) { + let overview_groups = build + .groups + .iter() + .filter(|group| group.parent_id.is_none()) + .collect::>(); + let overview_group_ids = overview_groups + .iter() + .take(limits.max_overview_groups) + .map(|group| group.id.clone()) + .collect::>(); + let shown = overview_group_ids.iter().cloned().collect::>(); + let overview_route_ids = routes + .iter() + .filter(|route| { + matches!(route.level, ArchitectureRouteLevel::Overview) + && shown.contains(&route.source_group) + && shown.contains(&route.target_group) + }) + .take(limits.max_overview_routes) + .map(|route| route.id.clone()) + .collect::>(); + let represented_nodes = scoped_node_ids + .iter() + .filter(|node_id| { + build + .node_to_overview + .get(*node_id) + .is_some_and(|group| shown.contains(group)) + }) + .count(); + let represented_relationships = relationships + .iter() + .filter(|relationship| { + default_lens.admits(relationship.relation_class) + && scoped_node_ids.contains(&relationship.source) + && scoped_node_ids.contains(&relationship.target) + && build + .node_to_overview + .get(&relationship.source) + .is_some_and(|group| shown.contains(group)) + && build + .node_to_overview + .get(&relationship.target) + .is_some_and(|group| shown.contains(group)) + }) + .count(); + let total_relationships = relationships + .iter() + .filter(|relationship| { + default_lens.admits(relationship.relation_class) + && scoped_node_ids.contains(&relationship.source) + && scoped_node_ids.contains(&relationship.target) + }) + .count(); + let witness_group_ids = overview_groups + .iter() + .skip(limits.max_overview_groups) + .take(limits.max_omission_witnesses) + .map(|group| group.id.clone()) + .collect::>(); + ( + overview_group_ids, + overview_route_ids, + ArchitectureOmissions { + total_groups: overview_groups.len(), + shown_groups: shown.len(), + omitted_groups: overview_groups.len().saturating_sub(shown.len()), + represented_nodes, + omitted_nodes: scoped_node_ids.len().saturating_sub(represented_nodes), + represented_relationships, + omitted_relationships: total_relationships.saturating_sub(represented_relationships), + witness_group_ids, + max_overview_groups: limits.max_overview_groups, + max_overview_routes: limits.max_overview_routes, + }, + ) +} + +#[allow(clippy::too_many_arguments)] +fn architecture_quality( + scope: ArchitectureScope, + build: &ScopeBuild, + relationships: &[ArchitectureRelationship], + scoped_node_ids: &BTreeSet, + source_scopes: ArchitectureSourceCounts, + coverage: &ArchitectureCoverage, + omissions: &ArchitectureOmissions, + max_diagnostics: usize, +) -> ArchitectureQuality { + const UNKNOWN_SOURCE_THRESHOLD: f64 = 0.05; + const REPRESENTED_THRESHOLD: f64 = 0.80; + const DOMINANT_GROUP_THRESHOLD: f64 = 0.60; + let total_nodes = scoped_node_ids.len(); + let overview_groups = build + .groups + .iter() + .filter(|group| group.parent_id.is_none()) + .collect::>(); + let duplicate_names = { + let mut names = BTreeSet::new(); + overview_groups + .iter() + .filter(|group| !names.insert(group.name.value.to_ascii_lowercase())) + .count() + }; + let fallback_names = overview_groups + .iter() + .filter(|group| matches!(group.name.provenance, ArchitectureNameProvenance::Fallback)) + .count(); + let largest_group = overview_groups + .iter() + .map(|group| group.node_ids.len()) + .max() + .unwrap_or_default(); + let unknown_relations = relationships + .iter() + .filter(|relationship| { + matches!( + relationship.relation_class, + ArchitectureRelationClass::Unknown + ) && scoped_node_ids.contains(&relationship.source) + && scoped_node_ids.contains(&relationship.target) + }) + .count(); + let unknown_source_fraction = fraction(source_scopes.unknown, total_nodes); + let represented_node_fraction = fraction(omissions.represented_nodes, total_nodes); + let represented_relationship_fraction = fraction( + omissions.represented_relationships, + omissions.represented_relationships + omissions.omitted_relationships, + ); + let largest_group_fraction = fraction(largest_group, total_nodes); + let generated_vendor_leakage = if matches!(scope, ArchitectureScope::Production) { + source_scopes.generated + source_scopes.vendor + } else { + 0 + }; + let unassigned_nodes = scoped_node_ids + .len() + .saturating_sub(build.memberships.len()); + let mut diagnostics = Vec::new(); + if generated_vendor_leakage > 0 { + diagnostics.push(diagnostic( + "generated_scope_leak", + ArchitectureDiagnosticSeverity::Error, + "Generated or vendor nodes leaked into Production.", + Some(generated_vendor_leakage as f64), + Some(0.0), + Vec::new(), + "Correct source evidence or add an explicit source-scope overlay.", + )); + } + if unknown_source_fraction > UNKNOWN_SOURCE_THRESHOLD { + diagnostics.push(diagnostic( + "unknown_source_share", + ArchitectureDiagnosticSeverity::Warning, + "The architecture has a material share of nodes without source scope.", + Some(unknown_source_fraction), + Some(UNKNOWN_SOURCE_THRESHOLD), + Vec::new(), + "Rebuild with complete source inventory or classify paths explicitly.", + )); + } + if duplicate_names > 0 { + diagnostics.push(diagnostic( + "duplicate_group_name", + ArchitectureDiagnosticSeverity::Error, + "Architecture group names are not unique.", + Some(duplicate_names as f64), + Some(0.0), + Vec::new(), + "Add owner/path evidence or an explicit project name.", + )); + } + if fallback_names > 0 { + diagnostics.push(diagnostic( + "fallback_group_name", + ArchitectureDiagnosticSeverity::Info, + "Some groups lack a strong project-specific name.", + Some(fallback_names as f64), + Some(0.0), + overview_groups + .iter() + .filter(|group| { + matches!(group.name.provenance, ArchitectureNameProvenance::Fallback) + }) + .take(8) + .map(|group| group.id.clone()) + .collect(), + "Add source ownership evidence or an optional architecture overlay.", + )); + } + if total_nodes >= 100 && largest_group_fraction > DOMINANT_GROUP_THRESHOLD { + diagnostics.push(diagnostic( + "dominant_group", + ArchitectureDiagnosticSeverity::Warning, + "One architecture group dominates the Production projection.", + Some(largest_group_fraction), + Some(DOMINANT_GROUP_THRESHOLD), + overview_groups + .iter() + .max_by_key(|group| group.node_ids.len()) + .map(|group| vec![group.id.clone()]) + .unwrap_or_default(), + "Inspect ownership evidence and community cohesion before trusting the overview.", + )); + } + if represented_node_fraction < REPRESENTED_THRESHOLD { + diagnostics.push(diagnostic( + "overview_node_omission", + ArchitectureDiagnosticSeverity::Warning, + "The bounded overview omits a material share of nodes.", + Some(represented_node_fraction), + Some(REPRESENTED_THRESHOLD), + omissions.witness_group_ids.clone(), + "Use the group directory or raise the explicit overview bound.", + )); + } + if represented_relationship_fraction < REPRESENTED_THRESHOLD { + diagnostics.push(diagnostic( + "overview_relationship_omission", + ArchitectureDiagnosticSeverity::Warning, + "The bounded overview omits a material share of relationships.", + Some(represented_relationship_fraction), + Some(REPRESENTED_THRESHOLD), + omissions.witness_group_ids.clone(), + "Use the route directory or raise the explicit overview bound.", + )); + } + if unknown_relations > 0 { + diagnostics.push(diagnostic( + "unknown_relation", + ArchitectureDiagnosticSeverity::Info, + "Some relationship kinds are outside the current architecture policy.", + Some(unknown_relations as f64), + Some(0.0), + Vec::new(), + "Review the relation vocabulary before admitting new kinds to a lens.", + )); + } + if coverage.unassigned > 0 || unassigned_nodes > 0 { + diagnostics.push(diagnostic( + "unassigned_relationship", + ArchitectureDiagnosticSeverity::Warning, + "Some nodes or admitted relationships could not be assigned to a group.", + Some((coverage.unassigned + unassigned_nodes) as f64), + Some(0.0), + Vec::new(), + "Inspect missing community and source ownership evidence.", + )); + } + diagnostics.sort_by(|left, right| left.code.cmp(&right.code)); + diagnostics.truncate(max_diagnostics); + let status = if total_nodes == 0 || overview_groups.is_empty() { + ArchitectureQualityStatus::Insufficient + } else if diagnostics.iter().any(|diagnostic| { + matches!( + diagnostic.severity, + ArchitectureDiagnosticSeverity::Warning | ArchitectureDiagnosticSeverity::Error + ) + }) { + ArchitectureQualityStatus::Degraded + } else { + ArchitectureQualityStatus::Good + }; + ArchitectureQuality { + status, + metrics: ArchitectureQualityMetrics { + source_scopes, + unknown_source_fraction, + generated_vendor_leakage, + represented_node_fraction, + represented_relationship_fraction, + duplicate_names, + fallback_names, + largest_group_fraction, + unknown_relations, + unassigned_nodes, + unassigned_relationships: coverage.unassigned, + }, + diagnostics, + } +} + +fn diagnostic( + code: &str, + severity: ArchitectureDiagnosticSeverity, + message: &str, + observed: Option, + threshold: Option, + witnesses: Vec, + recommended_action: &str, +) -> ArchitectureQualityDiagnostic { + ArchitectureQualityDiagnostic { + code: code.to_owned(), + severity, + message: message.to_owned(), + observed, + threshold, + witnesses, + recommended_action: recommended_action.to_owned(), + } +} + +fn fraction(numerator: usize, denominator: usize) -> f64 { + if denominator == 0 { + 1.0 + } else { + numerator as f64 / denominator as f64 + } +} + +fn confidence(value: &str) -> String { + match value.to_ascii_lowercase().as_str() { + "inferred" => "inferred", + "ambiguous" => "ambiguous", + _ => "extracted", + } + .to_owned() +} + +fn check_limit( + name: &'static str, + required: usize, + limit: usize, +) -> Result<(), ArchitectureProjectionError> { + if required > limit { + Err(ArchitectureProjectionError::LimitExceeded { + name, + required, + limit, + }) + } else { + Ok(()) + } +} + +#[cfg(test)] +mod tests { + use std::error::Error; + + use serde_json::json; + + use super::*; + + fn fixture() -> Result<(GraphDocument, Communities), Box> { + let document = serde_json::from_value(json!({ + "graph": { + "files": [ + {"path":"assets/viewer/graph.js","generated":true} + ] + }, + "nodes": [ + {"id":"api","label":"ApiRouter","source_file":"crates/app/src/api.rs"}, + {"id":"store","label":"LedgerStore","source_file":"crates/store/src/ledger.rs"}, + {"id":"bundle","label":"x","source_file":"assets/viewer/graph.js"}, + {"id":"test","label":"ApiTest","source_file":"tests/api_test.rs"} + ], + "links": [ + {"source":"api","target":"store","relation":"calls","confidence":"EXTRACTED"}, + {"source":"api","target":"store","relation":"contains","confidence":"EXTRACTED"}, + {"source":"bundle","target":"api","relation":"references","confidence":"EXTRACTED"} + ] + }))?; + let communities = BTreeMap::from([ + ( + 0, + vec!["api".to_owned(), "bundle".to_owned(), "test".to_owned()], + ), + (1, vec!["store".to_owned()]), + ]); + Ok((document, communities)) + } + + #[test] + fn production_is_scoped_before_grouping_and_relationships_are_typed() + -> Result<(), Box> { + let (document, communities) = fixture()?; + let model = project_architecture( + ArchitectureProjectionInput { + document: &document, + communities: &communities, + community_labels: None, + overlay: None, + project_name: "Fixture", + built_at_commit: None, + generated_at: None, + }, + &ArchitectureProjectionOptions::default(), + )?; + assert_eq!(model.schema, ARCHITECTURE_VIEWER_SCHEMA); + let production = model + .projections + .iter() + .find(|projection| matches!(projection.scope, ArchitectureScope::Production)) + .ok_or("missing production projection")?; + assert_eq!(production.memberships.len(), 2); + assert_eq!(production.coverage.admitted, 1); + assert_eq!(production.coverage.cross_group, 1); + assert_eq!(production.coverage.relation_classes.execution, 1); + assert_eq!(production.coverage.relation_classes.structure, 1); + assert_eq!(production.quality.metrics.generated_vendor_leakage, 0); + assert!( + production + .groups + .iter() + .all(|group| group.name.value != "Other") + ); + Ok(()) + } + + #[test] + fn invalid_overlapping_overlay_fails_closed() -> Result<(), Box> { + let (document, communities) = fixture()?; + let overlay: ArchitectureOverlay = serde_json::from_value(json!({ + "schema":"compass.architecture-overlay/1", + "sourceRules":[ + {"pathPrefix":"src","scope":"production"}, + {"pathPrefix":"src/generated","scope":"generated"} + ] + }))?; + let result = project_architecture( + ArchitectureProjectionInput { + document: &document, + communities: &communities, + community_labels: None, + overlay: Some(&overlay), + project_name: "Fixture", + built_at_commit: None, + generated_at: None, + }, + &ArchitectureProjectionOptions::default(), + ); + assert!(matches!( + result, + Err(ArchitectureProjectionError::InvalidOverlay(_)) + )); + Ok(()) + } + + #[test] + fn unsafe_overlay_path_fails_closed() -> Result<(), Box> { + let (document, communities) = fixture()?; + for path_prefix in ["../outside", "/absolute", "C:/outside", "src//hidden"] { + let overlay: ArchitectureOverlay = serde_json::from_value(json!({ + "schema":"compass.architecture-overlay/1", + "sourceRules":[{"pathPrefix":path_prefix,"scope":"generated"}] + }))?; + let result = project_architecture( + ArchitectureProjectionInput { + document: &document, + communities: &communities, + community_labels: None, + overlay: Some(&overlay), + project_name: "Fixture", + built_at_commit: None, + generated_at: None, + }, + &ArchitectureProjectionOptions::default(), + ); + assert!(matches!( + result, + Err(ArchitectureProjectionError::InvalidOverlay(_)) + )); + } + Ok(()) + } + + #[test] + fn input_limits_fail_explicitly_instead_of_returning_an_empty_projection() + -> Result<(), Box> { + let (document, communities) = fixture()?; + let default_options = ArchitectureProjectionOptions::default(); + let options = ArchitectureProjectionOptions { + limits: ArchitectureProjectionLimits { + max_nodes: document.nodes.len().saturating_sub(1), + ..default_options.limits + }, + ..default_options + }; + let result = project_architecture( + ArchitectureProjectionInput { + document: &document, + communities: &communities, + community_labels: None, + overlay: None, + project_name: "Fixture", + built_at_commit: None, + generated_at: None, + }, + &options, + ); + assert!(matches!( + result, + Err(ArchitectureProjectionError::LimitExceeded { + name: "max_nodes", + .. + }) + )); + Ok(()) + } + + #[test] + fn equivalent_input_order_produces_byte_equivalent_projection() -> Result<(), Box> { + let (document, communities) = fixture()?; + let mut reordered = document.clone(); + reordered.nodes.reverse(); + reordered.links.reverse(); + let project = |document: &GraphDocument| { + project_architecture( + ArchitectureProjectionInput { + document, + communities: &communities, + community_labels: None, + overlay: None, + project_name: "Fixture", + built_at_commit: Some("abc123"), + generated_at: Some("2026-08-23T00:00:00Z"), + }, + &ArchitectureProjectionOptions::default(), + ) + }; + let first = serde_json::to_vec(&project(&document)?)?; + let second = serde_json::to_vec(&project(&reordered)?)?; + assert_eq!(first, second); + Ok(()) + } +} diff --git a/crates/compass-output/src/architecture_projection/model.rs b/crates/compass-output/src/architecture_projection/model.rs new file mode 100644 index 00000000..28ca26a2 --- /dev/null +++ b/crates/compass-output/src/architecture_projection/model.rs @@ -0,0 +1,444 @@ +use std::collections::BTreeSet; + +use serde::{Deserialize, Serialize}; + +pub const ARCHITECTURE_VIEWER_SCHEMA: &str = "compass.viewer.architecture/1"; +pub const ARCHITECTURE_OVERLAY_SCHEMA: &str = "compass.architecture-overlay/1"; + +#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, Serialize)] +#[serde(rename_all = "snake_case")] +pub enum ArchitectureScope { + Production, + AllCode, +} + +#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum ArchitectureSourceScope { + Production, + Test, + Generated, + Vendor, + Documentation, + Unknown, +} + +#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, Serialize)] +#[serde(rename_all = "snake_case")] +pub enum ArchitectureRelationClass { + Execution, + Dependency, + Type, + Structure, + Contextual, + Unknown, +} + +#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, Serialize)] +#[serde(rename_all = "snake_case")] +pub enum ArchitectureLens { + Architecture, + Execution, + Dependency, + Type, + Structure, + All, +} + +impl ArchitectureLens { + #[must_use] + pub const fn admits(self, relation_class: ArchitectureRelationClass) -> bool { + match self { + Self::Architecture => matches!( + relation_class, + ArchitectureRelationClass::Execution | ArchitectureRelationClass::Dependency + ), + Self::Execution => matches!(relation_class, ArchitectureRelationClass::Execution), + Self::Dependency => matches!(relation_class, ArchitectureRelationClass::Dependency), + Self::Type => matches!(relation_class, ArchitectureRelationClass::Type), + Self::Structure => matches!(relation_class, ArchitectureRelationClass::Structure), + Self::All => !matches!(relation_class, ArchitectureRelationClass::Unknown), + } + } +} + +#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, Serialize)] +#[serde(rename_all = "snake_case")] +pub enum ArchitectureGroupKind { + Owner, + Subsystem, +} + +#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, Serialize)] +#[serde(rename_all = "snake_case")] +pub enum ArchitectureRouteLevel { + Overview, + Detail, +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)] +#[serde(rename_all = "snake_case")] +pub enum ArchitectureNameProvenance { + Overlay, + Persisted, + Owner, + Path, + Declaration, + Hub, + Provider, + Fallback, +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)] +#[serde(rename_all = "snake_case")] +pub enum ArchitectureQualityStatus { + Good, + Degraded, + Insufficient, +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)] +#[serde(rename_all = "snake_case")] +pub enum ArchitectureDiagnosticSeverity { + Info, + Warning, + Error, +} + +#[derive(Clone, Debug)] +pub struct ArchitectureProjectionOptions { + pub scopes: BTreeSet, + pub default_lens: ArchitectureLens, + pub limits: ArchitectureProjectionLimits, +} + +impl Default for ArchitectureProjectionOptions { + fn default() -> Self { + Self { + scopes: BTreeSet::from([ArchitectureScope::Production, ArchitectureScope::AllCode]), + default_lens: ArchitectureLens::Architecture, + limits: ArchitectureProjectionLimits::default(), + } + } +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct ArchitectureProjectionLimits { + pub max_nodes: usize, + pub max_relationships: usize, + pub max_groups: usize, + pub max_routes: usize, + pub max_overview_groups: usize, + pub max_overview_routes: usize, + pub max_name_candidates: usize, + pub max_name_evidence: usize, + pub max_diagnostics: usize, + pub max_omission_witnesses: usize, +} + +impl Default for ArchitectureProjectionLimits { + fn default() -> Self { + Self { + max_nodes: 250_000, + max_relationships: 1_000_000, + max_groups: 100_000, + max_routes: 250_000, + max_overview_groups: 24, + max_overview_routes: 64, + max_name_candidates: 12, + max_name_evidence: 4, + max_diagnostics: 128, + max_omission_witnesses: 8, + } + } +} + +#[derive(Clone, Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct ArchitectureViewModel { + pub schema: &'static str, + pub title: String, + pub nodes: Vec, + pub relationships: Vec, + pub projections: Vec, + pub statistics: ArchitectureStatistics, + pub provenance: ArchitectureProvenance, + pub limits: ArchitectureProjectionLimits, +} + +#[derive(Clone, Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct ArchitectureNode { + pub id: String, + pub label: String, + pub kind: String, + pub source_file: Option, + pub source_scope: ArchitectureSourceScope, + pub scope_reason: String, + pub community: Option, +} + +#[derive(Clone, Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct ArchitectureRelationship { + pub id: String, + pub source: String, + pub target: String, + pub relation: String, + pub relation_class: ArchitectureRelationClass, + pub confidence: String, +} + +#[derive(Clone, Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct ArchitectureScopeProjection { + pub scope: ArchitectureScope, + pub default_lens: ArchitectureLens, + pub groups: Vec, + pub memberships: Vec, + pub routes: Vec, + pub overview_group_ids: Vec, + pub overview_route_ids: Vec, + pub coverage: ArchitectureCoverage, + pub omissions: ArchitectureOmissions, + pub quality: ArchitectureQuality, +} + +#[derive(Clone, Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct ArchitectureGroup { + pub id: String, + pub parent_id: Option, + pub kind: ArchitectureGroupKind, + pub rank: usize, + pub name: ArchitectureGroupName, + pub owner_key: String, + pub community_ids: Vec, + pub node_count: usize, + pub relationship_count: usize, + pub neighbor_count: usize, + pub cohesion: f64, + pub source_scopes: ArchitectureSourceCounts, + pub pinned: bool, +} + +#[derive(Clone, Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct ArchitectureGroupName { + pub value: String, + pub provenance: ArchitectureNameProvenance, + pub membership_signature: String, + pub quality: u8, + pub evidence: Vec, +} + +#[derive(Clone, Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct ArchitectureMembership { + /// Index into the top-level, ID-sorted `nodes` array. + pub node_index: usize, + /// Index into this projection's deterministic `groups` array. + pub group_index: usize, +} + +#[derive(Clone, Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct ArchitectureRoute { + pub id: String, + pub level: ArchitectureRouteLevel, + pub owner_id: Option, + pub source_group: String, + pub target_group: String, + pub relationship_count: usize, + pub relation_classes: ArchitectureClassCounts, + pub evidence: ArchitectureEvidenceCounts, +} + +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct ArchitectureClassCounts { + pub execution: usize, + pub dependency: usize, + pub r#type: usize, + pub structure: usize, + pub contextual: usize, + pub unknown: usize, +} + +impl ArchitectureClassCounts { + pub fn increment(&mut self, relation_class: ArchitectureRelationClass) { + match relation_class { + ArchitectureRelationClass::Execution => self.execution += 1, + ArchitectureRelationClass::Dependency => self.dependency += 1, + ArchitectureRelationClass::Type => self.r#type += 1, + ArchitectureRelationClass::Structure => self.structure += 1, + ArchitectureRelationClass::Contextual => self.contextual += 1, + ArchitectureRelationClass::Unknown => self.unknown += 1, + } + } + + #[must_use] + pub const fn admitted(self, lens: ArchitectureLens) -> usize { + match lens { + ArchitectureLens::Architecture => self.execution + self.dependency, + ArchitectureLens::Execution => self.execution, + ArchitectureLens::Dependency => self.dependency, + ArchitectureLens::Type => self.r#type, + ArchitectureLens::Structure => self.structure, + ArchitectureLens::All => { + self.execution + self.dependency + self.r#type + self.structure + self.contextual + } + } + } +} + +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Serialize)] +pub struct ArchitectureEvidenceCounts { + pub extracted: usize, + pub inferred: usize, + pub ambiguous: usize, +} + +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct ArchitectureSourceCounts { + pub production: usize, + pub test: usize, + pub generated: usize, + pub vendor: usize, + pub documentation: usize, + pub unknown: usize, +} + +impl ArchitectureSourceCounts { + pub fn increment(&mut self, source_scope: ArchitectureSourceScope) { + match source_scope { + ArchitectureSourceScope::Production => self.production += 1, + ArchitectureSourceScope::Test => self.test += 1, + ArchitectureSourceScope::Generated => self.generated += 1, + ArchitectureSourceScope::Vendor => self.vendor += 1, + ArchitectureSourceScope::Documentation => self.documentation += 1, + ArchitectureSourceScope::Unknown => self.unknown += 1, + } + } + + #[must_use] + pub const fn total(self) -> usize { + self.production + + self.test + + self.generated + + self.vendor + + self.documentation + + self.unknown + } +} + +#[derive(Clone, Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct ArchitectureCoverage { + pub admitted: usize, + pub internal: usize, + pub cross_group: usize, + pub unassigned: usize, + pub relation_classes: ArchitectureClassCounts, +} + +#[derive(Clone, Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct ArchitectureOmissions { + pub total_groups: usize, + pub shown_groups: usize, + pub omitted_groups: usize, + pub represented_nodes: usize, + pub omitted_nodes: usize, + pub represented_relationships: usize, + pub omitted_relationships: usize, + pub witness_group_ids: Vec, + pub max_overview_groups: usize, + pub max_overview_routes: usize, +} + +#[derive(Clone, Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct ArchitectureQuality { + pub status: ArchitectureQualityStatus, + pub metrics: ArchitectureQualityMetrics, + pub diagnostics: Vec, +} + +#[derive(Clone, Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct ArchitectureQualityMetrics { + pub source_scopes: ArchitectureSourceCounts, + pub unknown_source_fraction: f64, + pub generated_vendor_leakage: usize, + pub represented_node_fraction: f64, + pub represented_relationship_fraction: f64, + pub duplicate_names: usize, + pub fallback_names: usize, + pub largest_group_fraction: f64, + pub unknown_relations: usize, + pub unassigned_nodes: usize, + pub unassigned_relationships: usize, +} + +#[derive(Clone, Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct ArchitectureQualityDiagnostic { + pub code: String, + pub severity: ArchitectureDiagnosticSeverity, + pub message: String, + pub observed: Option, + pub threshold: Option, + pub witnesses: Vec, + pub recommended_action: String, +} + +#[derive(Clone, Debug, Serialize)] +pub struct ArchitectureStatistics { + pub nodes: usize, + pub relationships: usize, + pub communities: usize, + pub extracted: usize, + pub inferred: usize, + pub ambiguous: usize, +} + +#[derive(Clone, Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct ArchitectureProvenance { + pub project_name: String, + pub built_at_commit: Option, + pub generated_at: Option, +} + +#[derive(Clone, Debug, Deserialize)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct ArchitectureOverlay { + pub schema: String, + #[serde(default)] + pub source_rules: Vec, + #[serde(default)] + pub groups: Vec, +} + +#[derive(Clone, Debug, Deserialize)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct ArchitectureOverlaySourceRule { + pub path_prefix: String, + pub scope: ArchitectureSourceScope, +} + +#[derive(Clone, Debug, Deserialize)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct ArchitectureOverlayGroup { + pub id: String, + pub name: String, + #[serde(default)] + pub path_prefixes: Vec, + #[serde(default)] + pub communities: Vec, + #[serde(default)] + pub pin: bool, +} diff --git a/crates/compass-output/src/architecture_projection/names.rs b/crates/compass-output/src/architecture_projection/names.rs new file mode 100644 index 00000000..405c0d62 --- /dev/null +++ b/crates/compass-output/src/architecture_projection/names.rs @@ -0,0 +1,322 @@ +use std::collections::{BTreeMap, BTreeSet}; + +use compass_model::NodeRecord; +use sha1::{Digest, Sha1}; + +use super::model::{ArchitectureGroupName, ArchitectureNameProvenance}; + +const GENERIC_WORDS: &[&str] = &[ + "src", + "lib", + "crates", + "packages", + "apps", + "services", + "module", + "mod", + "index", + "main", + "core", + "code", + "project", + "repository", + "compass", +]; + +#[must_use] +pub fn stable_fragment(value: &str) -> String { + format!("{:x}", Sha1::digest(value.as_bytes()))[..12].to_owned() +} + +#[must_use] +pub fn membership_signature(ids: &[String]) -> String { + let mut sorted = ids.to_vec(); + sorted.sort(); + let mut hasher = Sha1::new(); + for id in sorted { + hasher.update(id.as_bytes()); + hasher.update([0]); + } + format!("{:x}", hasher.finalize())[..16].to_owned() +} + +#[must_use] +pub fn owner_display_name(owner_key: &str) -> String { + let terminal = owner_key + .rsplit('/') + .next() + .unwrap_or(owner_key) + .trim_start_matches("compass-"); + humanize(terminal) +} + +#[must_use] +pub fn community_name( + community: Option, + owner_name: &str, + node_ids: &[String], + nodes: &BTreeMap, + labels: Option<&BTreeMap>, + max_evidence: usize, +) -> ArchitectureGroupName { + let signature = membership_signature(node_ids); + if let Some((label, community)) = community + .and_then(|community| { + labels + .and_then(|labels| labels.get(&community)) + .map(|label| (label, community)) + }) + .filter(|(label, _)| { + acceptable_name(label) && !same_meaning_after_scaffolding(label, owner_name) + }) + { + return ArchitectureGroupName { + value: label.trim().to_owned(), + provenance: ArchitectureNameProvenance::Persisted, + membership_signature: signature, + quality: 90, + evidence: vec![format!("community:{community}")], + }; + } + let mut path_counts = BTreeMap::::new(); + let mut declaration_counts = BTreeMap::::new(); + for id in node_ids { + let Some(node) = nodes.get(id) else { + continue; + }; + let source = node.string("source_file").replace('\\', "/"); + if let Some(stem) = source.rsplit('/').next().and_then(file_stem) + && acceptable_name(stem) + { + *path_counts.entry(humanize(stem)).or_default() += 1; + } + let label = node.label().trim().trim_end_matches("()"); + if acceptable_name(label) { + *declaration_counts.entry(humanize(label)).or_default() += 1; + } + } + let best_path = best_counted(&path_counts); + let best_declaration = best_counted(&declaration_counts); + let mut evidence = Vec::new(); + let (value, provenance, quality) = if let Some(path) = best_path { + evidence.push(format!("path:{path}")); + ( + qualified(owner_name, path), + ArchitectureNameProvenance::Path, + 80, + ) + } else if let Some(declaration) = best_declaration { + evidence.push(format!("declaration:{declaration}")); + ( + qualified(owner_name, declaration), + ArchitectureNameProvenance::Declaration, + 72, + ) + } else { + let suffix = + community.map_or_else(|| stable_fragment(&signature), |value| value.to_string()); + ( + format!("Unnamed subsystem · {owner_name} {suffix}"), + ArchitectureNameProvenance::Fallback, + 30, + ) + }; + evidence.truncate(max_evidence); + ArchitectureGroupName { + value, + provenance, + membership_signature: signature, + quality, + evidence, + } +} + +#[must_use] +pub fn owner_name( + value: String, + node_ids: &[String], + provenance: ArchitectureNameProvenance, + evidence: Vec, +) -> ArchitectureGroupName { + ArchitectureGroupName { + value, + provenance, + membership_signature: membership_signature(node_ids), + quality: if matches!(provenance, ArchitectureNameProvenance::Overlay) { + 100 + } else { + 92 + }, + evidence, + } +} + +pub fn disambiguate_names(names: &mut [ArchitectureGroupName], owner_keys: &[String]) { + let counts = names + .iter() + .fold(BTreeMap::::new(), |mut counts, name| { + *counts.entry(name.value.to_ascii_lowercase()).or_default() += 1; + counts + }); + for (index, name) in names.iter_mut().enumerate() { + if counts + .get(&name.value.to_ascii_lowercase()) + .copied() + .unwrap_or_default() + > 1 + { + let owner = owner_keys.get(index).map_or("group", String::as_str); + name.value = format!("{} · {}", name.value, owner); + name.evidence.push(format!("owner:{owner}")); + name.evidence.sort(); + name.evidence.dedup(); + } + } + let mut seen = BTreeSet::new(); + for name in names { + if !seen.insert(name.value.to_ascii_lowercase()) { + name.value = format!( + "{} · {}", + name.value, + stable_fragment(&name.membership_signature) + ); + } + } +} + +fn best_counted(counts: &BTreeMap) -> Option<&str> { + counts + .iter() + .max_by(|(left_name, left_count), (right_name, right_count)| { + left_count + .cmp(right_count) + .then_with(|| right_name.cmp(left_name)) + }) + .map(|(name, _)| name.as_str()) +} + +fn qualified(owner: &str, candidate: &str) -> String { + if candidate.eq_ignore_ascii_case(owner) + || candidate + .to_ascii_lowercase() + .contains(&owner.to_ascii_lowercase()) + { + candidate.to_owned() + } else { + format!("{owner} · {candidate}") + } +} + +fn file_stem(filename: &str) -> Option<&str> { + filename.rsplit_once('.').map_or_else( + || (!filename.is_empty()).then_some(filename), + |(stem, _)| (!stem.is_empty()).then_some(stem), + ) +} + +fn acceptable_name(value: &str) -> bool { + let trimmed = value.trim(); + if trimmed.len() < 2 || trimmed.len() > 96 { + return false; + } + let words = trimmed + .split(|character: char| !character.is_alphanumeric()) + .filter(|word| !word.is_empty()) + .map(str::to_ascii_lowercase) + .collect::>(); + if words.is_empty() + || words + .iter() + .all(|word| GENERIC_WORDS.contains(&word.as_str())) + { + return false; + } + let alphanumeric = trimmed + .chars() + .filter(|character| character.is_alphanumeric()) + .count(); + let vowels = trimmed + .chars() + .filter(|character| "aeiouAEIOU".contains(*character)) + .count(); + alphanumeric < 24 || vowels > 0 +} + +fn same_meaning_after_scaffolding(left: &str, right: &str) -> bool { + let meaningful = |value: &str| { + value + .split(|character: char| !character.is_alphanumeric()) + .filter(|word| !word.is_empty()) + .map(str::to_ascii_lowercase) + .filter(|word| !GENERIC_WORDS.contains(&word.as_str())) + .collect::>() + }; + meaningful(left) == meaningful(right) +} + +fn humanize(value: &str) -> String { + let mut output = String::new(); + let mut previous_lowercase = false; + for character in value.chars() { + if matches!(character, '_' | '-' | '.') { + if !output.ends_with(' ') && !output.is_empty() { + output.push(' '); + } + previous_lowercase = false; + continue; + } + if character.is_ascii_uppercase() && previous_lowercase && !output.ends_with(' ') { + output.push(' '); + } + if output.is_empty() || output.ends_with(' ') { + output.extend(character.to_uppercase()); + } else { + output.push(character); + } + previous_lowercase = character.is_ascii_lowercase(); + } + output.trim().to_owned() +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn owner_names_remove_repository_scaffolding() { + assert_eq!(owner_display_name("crates/compass-output"), "Output"); + assert_eq!(owner_display_name("packages/compass-viewer"), "Viewer"); + } + + #[test] + fn duplicate_names_gain_owner_evidence() { + let mut names = vec![ + owner_name( + "Runtime".to_owned(), + &["a".to_owned()], + ArchitectureNameProvenance::Owner, + Vec::new(), + ), + owner_name( + "Runtime".to_owned(), + &["b".to_owned()], + ArchitectureNameProvenance::Owner, + Vec::new(), + ), + ]; + disambiguate_names(&mut names, &["crates/a".to_owned(), "crates/b".to_owned()]); + assert_ne!(names[0].value, names[1].value); + } + + #[test] + fn scaffold_only_persisted_label_does_not_repeat_owner() { + assert!(same_meaning_after_scaffolding( + "Crates Compass Output", + "Output" + )); + assert!(!same_meaning_after_scaffolding( + "Output Rendering", + "Output" + )); + } +} diff --git a/crates/compass-output/src/architecture_projection/relation.rs b/crates/compass-output/src/architecture_projection/relation.rs new file mode 100644 index 00000000..0f093c3c --- /dev/null +++ b/crates/compass-output/src/architecture_projection/relation.rs @@ -0,0 +1,69 @@ +use super::model::ArchitectureRelationClass; + +#[must_use] +pub fn classify_relation(relation: &str) -> ArchitectureRelationClass { + match relation.trim().to_ascii_lowercase().as_str() { + "calls" | "handles" | "invokes" | "dispatches" | "routes_to" | "mounts" | "mounted_at" + | "reads" | "writes" | "produces" | "consumes" | "publishes" | "subscribes" | "sends" + | "receives" | "schedules" | "triggers" => ArchitectureRelationClass::Execution, + "imports" | "imports_from" | "exports" | "depends_on" | "uses" | "configured_by" + | "registers" | "registered_as" | "maps_to" => ArchitectureRelationClass::Dependency, + "extends" | "implements" | "overrides" | "type_of" | "returns" | "instantiates" + | "method" | "mixes_in" => ArchitectureRelationClass::Type, + "contains" | "declares" | "owns" | "part_of" | "embeds" => { + ArchitectureRelationClass::Structure + } + "references" | "tests" | "documents" | "aliases" | "decorates" | "derived_from" => { + ArchitectureRelationClass::Contextual + } + _ => ArchitectureRelationClass::Unknown, + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn relation_policy_is_explicit_and_conservative() { + let complete_graph_vocabulary = [ + ("contains", ArchitectureRelationClass::Structure), + ("embeds", ArchitectureRelationClass::Structure), + ("calls", ArchitectureRelationClass::Execution), + ("imports", ArchitectureRelationClass::Dependency), + ("exports", ArchitectureRelationClass::Dependency), + ("extends", ArchitectureRelationClass::Type), + ("implements", ArchitectureRelationClass::Type), + ("mixes_in", ArchitectureRelationClass::Type), + ("references", ArchitectureRelationClass::Contextual), + ("type_of", ArchitectureRelationClass::Type), + ("returns", ArchitectureRelationClass::Type), + ("instantiates", ArchitectureRelationClass::Type), + ("overrides", ArchitectureRelationClass::Type), + ("decorates", ArchitectureRelationClass::Contextual), + ("routes_to", ArchitectureRelationClass::Execution), + ("reads", ArchitectureRelationClass::Execution), + ("writes", ArchitectureRelationClass::Execution), + ("aliases", ArchitectureRelationClass::Contextual), + ("registers", ArchitectureRelationClass::Dependency), + ("handles", ArchitectureRelationClass::Execution), + ("publishes", ArchitectureRelationClass::Execution), + ("subscribes", ArchitectureRelationClass::Execution), + ("produces", ArchitectureRelationClass::Execution), + ("consumes", ArchitectureRelationClass::Execution), + ("schedules", ArchitectureRelationClass::Execution), + ("triggers", ArchitectureRelationClass::Execution), + ("tests", ArchitectureRelationClass::Contextual), + ("depends_on", ArchitectureRelationClass::Dependency), + ("documents", ArchitectureRelationClass::Contextual), + ("maps_to", ArchitectureRelationClass::Dependency), + ]; + for (relation, expected) in complete_graph_vocabulary { + assert_eq!(classify_relation(relation), expected, "{relation}"); + } + assert_eq!( + classify_relation("future_relation"), + ArchitectureRelationClass::Unknown + ); + } +} diff --git a/crates/compass-output/src/architecture_projection/scope.rs b/crates/compass-output/src/architecture_projection/scope.rs new file mode 100644 index 00000000..b20453d5 --- /dev/null +++ b/crates/compass-output/src/architecture_projection/scope.rs @@ -0,0 +1,206 @@ +use std::collections::BTreeSet; + +use compass_model::GraphDocument; + +use super::model::{ArchitectureOverlay, ArchitectureSourceScope}; + +#[derive(Clone, Debug)] +pub struct ScopeEvidence { + pub scope: ArchitectureSourceScope, + pub reason: &'static str, +} + +#[must_use] +pub fn normalized_path(path: &str) -> String { + path.replace('\\', "/") + .trim() + .trim_start_matches("./") + .trim_matches('/') + .to_ascii_lowercase() +} + +#[must_use] +pub fn generated_paths(document: &GraphDocument) -> BTreeSet { + document + .graph + .get("files") + .and_then(serde_json::Value::as_array) + .into_iter() + .flatten() + .filter_map(|record| { + let record = record.as_object()?; + record + .get("generated") + .and_then(serde_json::Value::as_bool) + .unwrap_or(false) + .then(|| { + record + .get("path") + .and_then(serde_json::Value::as_str) + .map(normalized_path) + }) + .flatten() + }) + .collect() +} + +#[must_use] +pub fn classify_source( + source_file: Option<&str>, + generated: &BTreeSet, + overlay: Option<&ArchitectureOverlay>, +) -> ScopeEvidence { + let Some(source_file) = source_file.map(str::trim).filter(|path| !path.is_empty()) else { + return ScopeEvidence { + scope: ArchitectureSourceScope::Unknown, + reason: "missing_source", + }; + }; + let normalized = normalized_path(source_file); + if let Some(rule) = overlay.and_then(|overlay| { + overlay + .source_rules + .iter() + .find(|rule| path_matches_prefix(&normalized, &normalized_path(&rule.path_prefix))) + }) { + return ScopeEvidence { + scope: rule.scope, + reason: "overlay", + }; + } + let segments = normalized.split('/').collect::>(); + let filename = segments.last().copied().unwrap_or_default(); + if segments.iter().any(|segment| { + matches!( + *segment, + "vendor" + | "third_party" + | "third-party" + | "node_modules" + | ".venv" + | "venv" + | "site-packages" + ) + }) { + return ScopeEvidence { + scope: ArchitectureSourceScope::Vendor, + reason: "vendor_path", + }; + } + if generated.contains(&normalized) { + return ScopeEvidence { + scope: ArchitectureSourceScope::Generated, + reason: "graph_generated", + }; + } + let root_output = segments.first().is_some_and(|segment| { + matches!( + *segment, + "generated" | "gen" | "dist" | "build" | "target" | ".next" + ) + }); + let explicit_generated = segments + .iter() + .any(|segment| matches!(*segment, "generated" | "gen")); + if root_output + || explicit_generated + || filename.contains(".generated.") + || filename.contains("_generated.") + || filename.ends_with(".min.js") + || filename.ends_with(".min.css") + { + return ScopeEvidence { + scope: ArchitectureSourceScope::Generated, + reason: "generated_path", + }; + } + if segments + .iter() + .any(|segment| matches!(*segment, "test" | "tests" | "testing" | "__tests__")) + || filename.starts_with("test_") + || filename.contains("_test.") + || filename.contains(".test.") + || filename.contains(".spec.") + { + return ScopeEvidence { + scope: ArchitectureSourceScope::Test, + reason: "test_path", + }; + } + if segments + .iter() + .any(|segment| matches!(*segment, "doc" | "docs" | "documentation")) + || matches!( + filename, + "readme" | "changelog" | "contributing" | "migration" | "security" + ) + || filename.ends_with(".md") + || filename.ends_with(".mdx") + || filename.ends_with(".rst") + || filename.ends_with(".adoc") + { + return ScopeEvidence { + scope: ArchitectureSourceScope::Documentation, + reason: "documentation_path", + }; + } + ScopeEvidence { + scope: ArchitectureSourceScope::Production, + reason: "source_path", + } +} + +#[must_use] +pub fn path_matches_prefix(path: &str, prefix: &str) -> bool { + !prefix.is_empty() + && (path == prefix + || path + .strip_prefix(prefix) + .is_some_and(|remainder| remainder.starts_with('/'))) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn source_scope_precedence_is_conservative() { + let generated = BTreeSet::from(["assets/viewer/graph.js".to_owned()]); + assert_eq!( + classify_source(Some("vendor/pkg/tests/a.rs"), &generated, None).scope, + ArchitectureSourceScope::Vendor + ); + assert_eq!( + classify_source(Some("assets/viewer/graph.js"), &generated, None).scope, + ArchitectureSourceScope::Generated + ); + assert_eq!( + classify_source(Some("src/foo.test.ts"), &generated, None).scope, + ArchitectureSourceScope::Test + ); + assert_eq!( + classify_source(Some("src/lib.rs"), &generated, None).scope, + ArchitectureSourceScope::Production + ); + assert_eq!( + classify_source(Some("docs/reference/commands.md"), &generated, None).scope, + ArchitectureSourceScope::Documentation + ); + assert_eq!( + classify_source(Some("README.md"), &generated, None).scope, + ArchitectureSourceScope::Documentation + ); + assert_eq!( + classify_source(Some("packages\\web\\src\\app.ts"), &generated, None).scope, + ArchitectureSourceScope::Production + ); + assert_eq!( + classify_source(Some("src/main/java/build/crab/Plan.java"), &generated, None).scope, + ArchitectureSourceScope::Production + ); + assert_eq!( + classify_source(None, &generated, None).scope, + ArchitectureSourceScope::Unknown + ); + } +} diff --git a/crates/compass-output/src/callflow.rs b/crates/compass-output/src/callflow.rs index 18095f74..53a3cc2a 100644 --- a/crates/compass-output/src/callflow.rs +++ b/crates/compass-output/src/callflow.rs @@ -1,15 +1,24 @@ -use std::collections::{BTreeMap, HashMap, HashSet}; +//! Compatibility entry points for the architecture export. +//! +//! The command names retain `callflow` for CLI compatibility, but every export +//! is backed by the typed architecture projection. This module deliberately +//! contains no independent grouping, naming, or relationship semantics. + +use std::collections::{BTreeMap, BTreeSet}; use std::path::Path; -use compass_files::write_text_atomic; use compass_graph::Communities; -use compass_model::{EdgeRecord, GraphDocument, NodeRecord}; +use compass_model::GraphDocument; use serde::{Deserialize, Serialize}; -use serde_json::Value; -use sha1::{Digest, Sha1}; -use crate::OutputError; +use crate::{ + ArchitectureOverlay, ArchitectureOverlayGroup, ArchitectureProjectionInput, + ArchitectureProjectionOptions, ArchitectureScope, ArchitectureViewModel, OutputError, + WorkbenchCoverage, WorkbenchModel, WorkbenchView, WorkbenchViewContent, project_architecture, + workbench_html_document, +}; +/// Legacy section input accepted as an adapter to the versioned overlay. #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct CallflowSection { pub id: String, @@ -21,6 +30,7 @@ pub struct CallflowSection { pub struct CallflowOptions<'a> { pub community_labels: Option<&'a BTreeMap>, pub sections: Option<&'a [CallflowSection]>, + pub overlay: Option<&'a ArchitectureOverlay>, pub report: &'a str, pub project_name: &'a str, pub built_at_commit: Option<&'a str>, @@ -34,10 +44,10 @@ pub struct CallflowOptions<'a> { #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct CallflowExport { - pub loaded_sections: usize, - pub rendered_sections: usize, - pub mermaid_diagrams: usize, - pub call_tables: usize, + pub groups: usize, + pub overview_groups: usize, + pub relationships: usize, + pub overview_routes: usize, } impl Default for CallflowOptions<'_> { @@ -45,6 +55,7 @@ impl Default for CallflowOptions<'_> { Self { community_labels: None, sections: None, + overlay: None, report: "", project_name: "Project", built_at_commit: None, @@ -58,292 +69,56 @@ impl Default for CallflowOptions<'_> { } } -const ARCHETYPES: [(&str, &str, &str, &[&str]); 9] = [ - ( - "extract-pipeline", - "提取管线", - "Extraction Pipeline", - &[ - "extract", - "extractor", - "tree", - "sitter", - "parser", - "language", - "python", - "javascript", - "typescript", - "rust", - "java", - "go", - "ast", - "calls", - "imports", - "multilang", - ], - ), - ( - "build-graph", - "图谱构建", - "Graph Build", - &[ - "build", - "graph", - "merge", - "dedup", - "node", - "edge", - "hyperedge", - "json", - "schema", - "normalize", - "confidence", - ], - ), - ( - "analysis-clustering", - "分析聚类", - "Analysis & Clustering", - &[ - "cluster", - "community", - "leiden", - "cohesion", - "analyze", - "god", - "surprise", - "question", - "query", - "path", - "explain", - "benchmark", - ], - ), - ( - "outputs-docs", - "输出文档", - "Outputs & Docs", - &[ - "export", - "html", - "wiki", - "obsidian", - "canvas", - "svg", - "graphml", - "report", - "callflow", - "mermaid", - "tree", - "documentation", - ], - ), - ( - "cli-skills", - "CLI 与技能安装", - "CLI & Skill Installers", - &[ - "main", - "install", - "uninstall", - "skill", - "agent", - "claude", - "codex", - "opencode", - "aider", - "copilot", - "kiro", - "vscode", - "hook", - "command", - ], - ), - ( - "ingest-cache-update", - "摄取与增量更新", - "Ingestion & Updates", - &[ - "ingest", - "fetch", - "download", - "url", - "html", - "markdown", - "cache", - "manifest", - "watch", - "update", - "incremental", - "transcribe", - "video", - "audio", - "google", - ], - ), - ( - "serve-api", - "服务 API", - "Serving API", - &[ - "serve", "api", "request", "response", "endpoint", "router", "handle", "upload", - "search", "delete", "enrich", - ], - ), - ( - "security-global", - "安全与全局图", - "Security & Global Graph", - &[ - "security", - "safe", - "ssrf", - "xss", - "path", - "traversal", - "global", - "prefix", - "prune", - "repo", - "clone", - ], - ), - ( - "tests-fixtures", - "测试与样例", - "Tests & Fixtures", - &[ - "test", "tests", "fixture", "fixtures", "sample", "assert", "pytest", "mock", - ], - ), -]; - +/// Returns the bounded overview as legacy section records without inventing an +/// overflow group. New consumers should use [`project_architecture`] directly. #[must_use] pub fn derive_callflow_sections( document: &GraphDocument, communities: &Communities, labels: Option<&BTreeMap>, - language: &str, + _language: &str, max_sections: usize, ) -> Vec { - let language = detect_language(language, document, labels); - let max_sections = if max_sections == 0 { 15 } else { max_sections }; - let mut sections = vec![CallflowSection { - id: "overview".into(), - name: text(language, "架构总览", "Architecture Overview").into(), - communities: Vec::new(), - }]; - let indexed = indexed_communities(document, communities); - let mut ordered = indexed.iter().collect::>(); - ordered.sort_by(|left, right| { - right - .1 - .len() - .cmp(&left.1.len()) - .then_with(|| left.0.to_string().cmp(&right.0.to_string())) - }); - #[derive(Clone)] - struct Group { - priority: usize, - id: &'static str, - name: &'static str, - communities: Vec, - nodes: usize, - } - let mut grouped = Vec::::new(); - let mut unassigned = Vec::<(String, String)>::new(); - for (community, nodes) in ordered { - let label = labels - .and_then(|labels| labels.get(community).cloned()) - .unwrap_or_else(|| fallback_community_label(*community, nodes, language)); - let mut body = label.clone(); - for node in nodes.iter().take(80) { - body.push(' '); - body.push_str(&node.string("label")); - body.push(' '); - body.push_str(&node.string("source_file")); - body.push(' '); - body.push_str(&node.string("node_type")); - body.push(' '); - body.push_str(&node.string("file_type")); - } - let body = body.to_lowercase(); - let mut best = None; - let mut best_score = 0; - for (priority, (id, zh, en, keywords)) in ARCHETYPES.iter().enumerate() { - let score = keywords - .iter() - .map(|keyword| keyword_count(&body, keyword)) - .sum(); - if score > best_score { - best = Some((priority, *id, text(language, zh, en))); - best_score = score; - } - } - if let Some((priority, id, name)) = best.filter(|_| best_score >= 2) { - if let Some(group) = grouped.iter_mut().find(|group| group.id == id) { - group.communities.push(community.to_string()); - group.nodes += nodes.len(); - } else { - grouped.push(Group { - priority, - id, - name, - communities: vec![community.to_string()], - nodes: nodes.len(), - }); - } - } else { - unassigned.push((community.to_string(), label)); - } - } - grouped.sort_by(|left, right| { - left.priority - .cmp(&right.priority) - .then_with(|| right.nodes.cmp(&left.nodes)) - .then_with(|| left.id.cmp(right.id)) - }); - let grouped_cap = max_sections.max(1).saturating_sub(1).max(1); - let overflow = grouped + let default_options = ArchitectureProjectionOptions::default(); + let options = ArchitectureProjectionOptions { + scopes: BTreeSet::from([ArchitectureScope::Production]), + limits: crate::ArchitectureProjectionLimits { + max_overview_groups: max_sections.max(2), + ..default_options.limits + }, + ..default_options + }; + let Ok(model) = project_architecture( + ArchitectureProjectionInput { + document, + communities, + community_labels: labels, + overlay: None, + project_name: "Project", + built_at_commit: None, + generated_at: None, + }, + &options, + ) else { + return Vec::new(); + }; + let Some(projection) = model.projections.first() else { + return Vec::new(); + }; + let shown = projection + .overview_group_ids .iter() - .skip(grouped_cap) - .flat_map(|group| group.communities.iter().cloned()) - .collect::>(); - sections.extend( - grouped - .into_iter() - .take(grouped_cap) - .map(|group| CallflowSection { - id: group.id.into(), - name: group.name.into(), - communities: group.communities, - }), - ); - let remaining = max_sections - .saturating_sub(sections.len().saturating_sub(1)) - .saturating_sub(1); - sections.extend( - unassigned - .iter() - .take(remaining) - .map(|(community, label)| CallflowSection { - id: label.clone(), - name: label.clone(), - communities: vec![community.clone()], - }), - ); - let others = overflow - .into_iter() - .chain(unassigned.into_iter().skip(remaining).map(|item| item.0)) - .collect::>(); - if !others.is_empty() { - sections.push(CallflowSection { - id: "other".into(), - name: text(language, "其他", "Other").into(), - communities: others, - }); - } - sections + .collect::>(); + projection + .groups + .iter() + .filter(|group| shown.contains(&group.id)) + .map(|group| CallflowSection { + id: group.id.clone(), + name: group.name.value.clone(), + communities: group.community_ids.iter().map(usize::to_string).collect(), + }) + .collect() } pub fn callflow_html_document( @@ -351,130 +126,40 @@ pub fn callflow_html_document( communities: &Communities, options: &CallflowOptions<'_>, ) -> Result { - if document.nodes.is_empty() { - return Err(OutputError::EmptyCallflowGraph); - } - let language = detect_language(options.language, document, options.community_labels); - let raw_sections = options.sections.map_or_else( - || { - derive_callflow_sections( - document, - communities, - options.community_labels, - language, - options.max_sections, - ) - }, - <[CallflowSection]>::to_vec, - ); - let sections = normalize_sections(&raw_sections, language); - if sections.len() <= 1 { + let model = architecture_model(document, communities, options)?; + architecture_html_for_model(model, options) +} + +fn architecture_html_for_model( + model: ArchitectureViewModel, + options: &CallflowOptions<'_>, +) -> Result { + if model.projections.is_empty() { return Err(OutputError::NoCallflowSections); } - let section_nodes = section_nodes(document, communities, §ions); - let node_section = section_nodes - .iter() - .flat_map(|(section, nodes)| { - nodes - .iter() - .map(move |node| (node.id.as_str(), section.as_str())) - }) - .collect::>(); - let project = if options.project_name.is_empty() { - "Project" - } else { - options.project_name - }; - let commit = options - .built_at_commit - .unwrap_or("unknown") - .chars() - .take(7) - .collect::(); - let title = if is_zh(language) { - format!("{project} — 完整调用流程与架构文档") - } else { - format!("{project} — Complete Call Flow & Architecture Documentation") - }; - let subtitle = if is_zh(language) { - format!( - "由 compass 知识图谱生成:{} 个节点、{} 条边、{} 个社区。Commit: {commit}", - document.nodes.len(), - document.links.len(), - indexed_communities(document, communities).len() - ) - } else { - format!( - "Generated from compass knowledge graph: {} nodes, {} edges, {} communities. Commit: {commit}", - document.nodes.len(), - document.links.len(), - indexed_communities(document, communities).len() - ) - }; - let mut html = format!( - r#"{}

{}

{}

{}"#, - html_escape(language, true), - html_escape(&title, false), - CSS, - html_escape(&title, false), - html_escape(&subtitle, false), - navigation(§ions) + let graph_identity = options.built_at_commit.map_or_else( + || "architecture:unpublished".to_owned(), + |value| format!("git:{value}"), ); - html.push_str(&format!("

1. {}

{}
", html_escape(§ions[0].name, false), overview_mermaid(§ions, §ion_nodes, document, &node_section, language, options.diagram_scale))); - html.push_str(&overview_cards( - §ions, - §ion_nodes, - document, - &node_section, - language, - )); - if let Some(card) = report_highlights(options.report, language) { - html.push_str(&format!("
{card}
")); - } - html.push_str("
"); - for (index, section) in sections - .iter() - .filter(|section| section.id != "overview") - .enumerate() - { - let nodes = section_nodes.get(§ion.id).cloned().unwrap_or_default(); - let edges = document - .links - .iter() - .filter(|edge| { - node_section.get(edge_source(edge)) == Some(§ion.id.as_str()) - && node_section.get(edge_target(edge)) == Some(§ion.id.as_str()) - }) - .collect::>(); - html.push_str(&format!("

{}. {}

{}

{}
", index + 2, comment_text(§ion.name), html_escape(§ion.id, true), index + 2, html_escape(§ion.name, false), section_intro(section, &nodes, edges.len(), language), section_mermaid(section, &nodes, &edges, language, options))); - html.push_str(&call_table(&nodes, &edges, language)); - html.push_str(§ion_cards(&nodes, &edges, language)); - html.push_str("
"); - } - append_hyperedges(&mut html, document); - let indexed = indexed_communities(document, communities); - let extracted = document - .links - .iter() - .filter(|edge| defaulted(edge, "confidence", "EXTRACTED") == "EXTRACTED") - .count(); - let inferred = document - .links - .iter() - .filter(|edge| defaulted(edge, "confidence", "EXTRACTED") == "INFERRED") - .count(); - let ambiguous = document - .links - .iter() - .filter(|edge| defaulted(edge, "confidence", "EXTRACTED") == "AMBIGUOUS") - .count(); - html.push_str(&format!("

Project Statistics

Graph

Nodes{}
Edges{}
Hyperedges{}
Communities{}
Documented Sections{}

Edge Confidence

EXTRACTED{extracted}
INFERRED{inferred}
AMBIGUOUS{ambiguous}
", document.nodes.len(), document.links.len(), hyperedges(document).len(), indexed.len(), sections.len()-1)); - let generated = options - .generated_at - .map(ToOwned::to_owned) - .unwrap_or_else(utc_minute); - html.push_str(&format!("

{} — Architecture Documentation

Generated: {} · compass callflow-html

", html_escape(project, false), html_escape(&generated, false))); - Ok(html) + let workbench = WorkbenchModel::new( + model.title.clone(), + graph_identity, + vec![WorkbenchView { + id: "architecture".to_owned(), + title: "Architecture".to_owned(), + description: "Source-scoped, typed subsystem relationships".to_owned(), + // The full typed inventory is embedded. Overview omissions are a + // presentation budget and are disclosed by the architecture model; + // they do not make extraction partial. + coverage: WorkbenchCoverage::bounded( + model.statistics.nodes, + model.statistics.relationships, + false, + ), + content: WorkbenchViewContent::Architecture { model }, + }], + ); + workbench_html_document(&workbench).map_err(OutputError::from) } pub fn write_callflow_html( @@ -483,797 +168,78 @@ pub fn write_callflow_html( output_path: impl AsRef, options: &CallflowOptions<'_>, ) -> Result { - let language = detect_language(options.language, document, options.community_labels); - let raw_sections = options.sections.map_or_else( - || { - derive_callflow_sections( - document, - communities, - options.community_labels, - language, - options.max_sections, - ) - }, - <[CallflowSection]>::to_vec, - ); - let loaded_sections = normalize_sections(&raw_sections, language).len(); - let html = callflow_html_document(document, communities, options)?; + let model = architecture_model(document, communities, options)?; + let projection = model + .projections + .first() + .ok_or(OutputError::NoCallflowSections)?; let result = CallflowExport { - loaded_sections, - rendered_sections: html.matches("

").count(), - call_tables: html.matches("").count(), + groups: projection.groups.len(), + overview_groups: projection.overview_group_ids.len(), + relationships: model.statistics.relationships, + overview_routes: projection.overview_route_ids.len(), }; - write_text_atomic(output_path, &html)?; + let html = architecture_html_for_model(model, options)?; + compass_files::write_text_atomic(output_path, &html)?; Ok(result) } -fn normalize_sections(sections: &[CallflowSection], language: &str) -> Vec { - let mut output = vec![CallflowSection { - id: "overview".into(), - name: text(language, "架构总览", "Architecture Overview").into(), - communities: Vec::new(), - }]; - let mut used = HashSet::from([ - "overview".to_owned(), - "hyperedges".to_owned(), - "stats".to_owned(), - ]); - for section in sections { - if section.id.to_lowercase() == "overview" { - output[0].name.clone_from(§ion.name); - continue; - } - let id = anchor_id(§ion.id, &mut used); - output.push(CallflowSection { - id, - name: section.name.clone(), - communities: section.communities.clone(), - }); - } - output -} - -fn indexed_communities<'a>( - document: &'a GraphDocument, - communities: &Communities, -) -> BTreeMap> { - let lookup = communities - .iter() - .flat_map(|(community, members)| { - members - .iter() - .map(move |member| (member.as_str(), *community)) - }) - .collect::>(); - let mut output = BTreeMap::>::new(); - for node in &document.nodes { - let community = lookup - .get(node.id.as_str()) - .copied() - .or_else(|| { - node.unsigned("community") - .and_then(|value| usize::try_from(value).ok()) - }) - .unwrap_or(0); - output.entry(community).or_default().push(node); - } - output -} - -fn section_nodes<'a>( - document: &'a GraphDocument, - communities: &Communities, - sections: &[CallflowSection], -) -> HashMap> { - let indexed = indexed_communities(document, communities); - sections - .iter() - .map(|section| { - let nodes = section - .communities - .iter() - .flat_map(|community| { - community - .parse::() - .ok() - .and_then(|community| indexed.get(&community)) - .into_iter() - .flatten() - .copied() - }) - .collect(); - (section.id.clone(), nodes) - }) - .collect() -} - -fn overview_mermaid( - sections: &[CallflowSection], - nodes: &HashMap>, +fn architecture_model( document: &GraphDocument, - node_section: &HashMap<&str, &str>, - language: &str, - scale: f64, -) -> String { - let mut lines = vec![mermaid_init(scale)]; - for section in sections.iter().filter(|section| section.id != "overview") { - let id = stable_id(§ion.id, "section").to_uppercase(); - lines.push(format!( - " {id}(\"{}
{} nodes\")", - mermaid_text(§ion.name), - nodes.get(§ion.id).map(Vec::len).unwrap_or_default() - )); - } - let mut counts = Vec::<((String, String), usize, BTreeMap)>::new(); - let mut positions = HashMap::new(); - for edge in &document.links { - if !include_edge(edge) { - continue; - } - let (Some(source), Some(target)) = ( - node_section.get(edge_source(edge)), - node_section.get(edge_target(edge)), - ) else { - continue; - }; - if source == target { - continue; - } - let key = ((*source).to_owned(), (*target).to_owned()); - let position = *positions.entry(key.clone()).or_insert_with(|| { - counts.push((key, 0, BTreeMap::new())); - counts.len() - 1 - }); - counts[position].1 += 1; - *counts[position] - .2 - .entry(edge.string("relation")) - .or_default() += 1; - } - counts.sort_by_key(|item| std::cmp::Reverse(item.1)); - for ((source, target), count, relations) in counts.into_iter().take(12) { - let relation = relations - .into_iter() - .max_by_key(|(_, count)| *count) - .map(|item| item.0) - .unwrap_or_else(|| "relates".into()); - let label = if count > 1 { - format!("{} x{count}", relation_text(&relation, language)) - } else { - relation_text(&relation, language) - }; - lines.push(format!( - " {} -->|{label}| {}", - stable_id(&source, "section").to_uppercase(), - stable_id(&target, "section").to_uppercase() - )); - } - lines.join("\n") -} - -fn section_mermaid( - section: &CallflowSection, - nodes: &[&NodeRecord], - edges: &[&EdgeRecord], - language: &str, + communities: &Communities, options: &CallflowOptions<'_>, -) -> String { - let mut lines = vec![ - mermaid_init(options.diagram_scale), - format!( - " %% Section: {} ({} nodes, {} edges)", - mermaid_text(§ion.name), - nodes.len(), - edges.len() - ), - ]; - let selected = nodes - .iter() - .take(options.max_diagram_nodes) - .copied() - .collect::>(); - let ids = selected - .iter() - .map(|node| node.id.as_str()) - .collect::>(); - for node in &selected { - lines.push(format!( - " {}(\"{}\")", - stable_id(&node.id, "node"), - node_mermaid_label(node) - )); - } - for edge in edges - .iter() - .filter(|edge| { - include_edge(edge) && ids.contains(edge_source(edge)) && ids.contains(edge_target(edge)) - }) - .take(options.max_diagram_edges) - { - lines.push(format!( - " {} -->|{}| {}", - stable_id(edge_source(edge), "node"), - relation_text(&edge.string("relation"), language), - stable_id(edge_target(edge), "node") - )); - } - lines.join("\n") -} - -fn call_table(nodes: &[&NodeRecord], edges: &[&EdgeRecord], language: &str) -> String { - let mut callers = HashMap::<&str, Vec<&str>>::new(); - let mut callees = HashMap::<&str, Vec<&str>>::new(); - for edge in edges { - if matches!( - edge.string("relation").as_str(), - "calls" | "imports" | "imports_from" | "uses" | "method" - ) { - callers - .entry(edge_target(edge)) - .or_default() - .push(edge_source(edge)); - callees - .entry(edge_source(edge)) - .or_default() - .push(edge_target(edge)); - } - } - let lookup = nodes - .iter() - .map(|node| (node.id.as_str(), *node)) - .collect::>(); - let mut body = String::new(); - for (index, node) in nodes.iter().take(30).enumerate() { - let label = node.label(); - let path = short_path(&node.string("source_file")); - body.push_str(&format!("
", index+1, html_escape(label,false), html_escape(&path,false), text(language,"函数","Function"), refs(callers.get(node.id.as_str()), &lookup, language, true), refs(callees.get(node.id.as_str()), &lookup, language, false), html_escape(&format!("{} node in {}.", label, if path.is_empty(){"project"}else{&path}),false))); +) -> Result { + if document.nodes.is_empty() { + return Err(OutputError::EmptyCallflowGraph); } - format!( - "

{}

{}{}
{}
{}{}{}{}
{body}
#{}{}{}{}{}
", - text(language, "调用明细", "Call Details"), - text(language, "节点", "Node"), - text(language, "类型", "Type"), - text(language, "调用方", "Caller"), - text(language, "被调用/依赖", "Callees"), - text(language, "说明", "Description") - ) -} - -fn refs( - ids: Option<&Vec<&str>>, - lookup: &HashMap<&str, &NodeRecord>, - language: &str, - inbound: bool, -) -> String { - let Some(ids) = ids.filter(|ids| !ids.is_empty()) else { - return text( - language, - if inbound { - "外部入口 / 无直接入边" - } else { - "无直接出边" - }, - if inbound { - "External entry / no inbound edge" - } else { - "No direct outbound edge" - }, - ) - .into(); - }; - ids.iter() - .take(3) - .map(|id| { - format!( - "{}", - html_escape(lookup.get(id).map_or(*id, |node| node.label()), false) - ) - }) - .collect::>() - .join("
") -} - -fn section_intro( - section: &CallflowSection, - nodes: &[&NodeRecord], - edges: usize, - language: &str, -) -> String { - let files = nodes - .iter() - .map(|node| short_path(&node.string("source_file"))) - .filter(|path| !path.is_empty()) - .take(3) - .collect::>() - .join(", "); - let value = if is_zh(language) { - format!( - "{} 汇集了相关实现,主要分布在 {}。本节覆盖 {} 个节点、{edges} 条内部边,图中只展示最有代表性的调用关系以保持可读性。", - section.name, - if files.is_empty() { - "未标注源文件" - } else { - &files - }, - nodes.len() - ) - } else { - format!( - "{} groups related implementation, mostly in {}. This section covers {} nodes and {edges} internal edges; the diagram shows representative relationships to stay readable.", - section.name, - if files.is_empty() { - "unmapped files" - } else { - &files - }, - nodes.len() - ) + let adapted_overlay = options + .sections + .filter(|_| options.overlay.is_none()) + .map(legacy_overlay); + let defaults = ArchitectureProjectionOptions::default(); + let projection_options = ArchitectureProjectionOptions { + limits: crate::ArchitectureProjectionLimits { + max_overview_groups: options.max_sections.max(2), + ..defaults.limits + }, + ..defaults }; - html_escape(&value, false) -} - -fn section_cards(nodes: &[&NodeRecord], edges: &[&EdgeRecord], language: &str) -> String { - let mut files = BTreeMap::::new(); - for node in nodes { - let path = node.string("source_file"); - if !path.is_empty() { - *files.entry(path).or_default() += 1; - } - } - let rows = files - .into_iter() - .take(8) - .map(|(path, count)| { - format!( - "{}{count} {}", - html_escape(&short_path(&path), false), - text(language, "个节点", "nodes") - ) - }) - .collect::(); - let relations = edges - .iter() - .filter(|edge| include_edge(edge)) - .map(|edge| edge.string("relation")) - .take(4) - .collect::>() - .join(", "); - format!( - "

{}

{rows}

{}

{}

", - text(language, "关键文件", "Key Files"), - text(language, "设计备注", "Design Notes"), - html_escape(&relations, false) - ) -} - -fn overview_cards( - sections: &[CallflowSection], - nodes: &HashMap>, - document: &GraphDocument, - node_section: &HashMap<&str, &str>, - language: &str, -) -> String { - let rows = sections - .iter() - .filter(|s| s.id != "overview") - .map(|s| { - format!( - "{}{}{}", - html_escape(&s.name, false), - nodes.get(&s.id).map(Vec::len).unwrap_or_default(), - s.communities.join(", ") - ) - }) - .collect::(); - let mut flow = sections - .iter() - .filter(|s| s.id != "overview") - .map(|s| s.name.clone()) - .collect::>(); - flow.truncate(7); - let _ = (document, node_section); - format!( - "

{}

{rows}

{}

{}
", - text(language, "架构层次", "Architecture Layers"), - text(language, "核心数据流", "Core Flow"), - html_escape(&flow.join(" -> "), false) + project_architecture( + ArchitectureProjectionInput { + document, + communities, + community_labels: options.community_labels, + overlay: options.overlay.or(adapted_overlay.as_ref()), + project_name: options.project_name, + built_at_commit: options.built_at_commit, + generated_at: options.generated_at, + }, + &projection_options, ) + .map_err(|error| OutputError::InvalidArchitectureProjection(error.to_string())) } -fn report_highlights(report: &str, language: &str) -> Option { - let mut keep = Vec::new(); - let (mut summary, mut gods) = (false, false); - for line in report.lines() { - let line = line.trim(); - if line.starts_with("## ") { - summary = line == "## Summary"; - gods = line.starts_with("## God Nodes"); - continue; - } - if summary && line.starts_with("- ") { - keep.push(&line[2..]); - } else if gods - && line.chars().next().is_some_and(|c| c.is_ascii_digit()) - && line.contains('.') - { - keep.push(line); - } - if keep.len() >= 6 { - break; - } - } - if keep.is_empty() { - None - } else { - Some(format!( - "

{}

    {}
", - text(language, "图谱报告摘要", "Graph Report Highlights"), - keep.into_iter() - .map(|v| format!("
  • {}
  • ", html_escape(v, false))) - .collect::() - )) - } -} - -fn append_hyperedges(html: &mut String, document: &GraphDocument) { - let values = hyperedges(document); - if values.is_empty() { - return; - } - html.push_str( - "

    Group Relationships (Hyperedges)

    ", - ); - for value in values.iter().take(9) { - let Some(item) = value.as_object() else { - continue; - }; - let label = item - .get("label") - .or_else(|| item.get("id")) - .and_then(Value::as_str) - .unwrap_or("?"); - let relation = item - .get("relation") - .and_then(Value::as_str) - .unwrap_or_default(); - let nodes = item - .get("nodes") - .and_then(Value::as_array) - .cloned() - .unwrap_or_default(); - html.push_str(&format!( - "

    {}

    {} — {} participants

      ", - html_escape(label, false), - html_escape(relation, false), - nodes.len() - )); - for node in nodes.iter().take(5) { - html.push_str(&format!( - "
    • {}
    • ", - html_escape(node.as_str().unwrap_or_default(), false) - )); - } - html.push_str("
    "); - } - html.push_str("

    "); -} -fn hyperedges(document: &GraphDocument) -> Vec { - document - .extras - .get("hyperedges") - .or_else(|| document.graph.get("hyperedges")) - .and_then(Value::as_array) - .cloned() - .unwrap_or_default() -} - -fn navigation(sections: &[CallflowSection]) -> String { - format!( - "
    {}
    ", - sections +fn legacy_overlay(sections: &[CallflowSection]) -> ArchitectureOverlay { + ArchitectureOverlay { + schema: crate::ARCHITECTURE_OVERLAY_SCHEMA.to_owned(), + source_rules: Vec::new(), + groups: sections .iter() - .map(|s| format!( - "{}", - html_escape(&s.id, true), - html_escape(&s.name, false) - )) - .collect::() - ) -} -fn fallback_community_label(community: usize, nodes: &[&NodeRecord], language: &str) -> String { - let words = keywords(nodes, 3); - if words.is_empty() { - if is_zh(language) { - format!("社区 {community}") - } else { - format!("Community {community}") - } - } else { - words - .into_iter() - .map(|word| { - let mut chars = word.chars(); - chars.next().map_or(String::new(), |first| { - first.to_uppercase().collect::() + chars.as_str() - }) + .filter(|section| section.id != "overview") + .map(|section| ArchitectureOverlayGroup { + id: section.id.clone(), + name: section.name.clone(), + communities: section + .communities + .iter() + .filter_map(|value| value.parse::().ok()) + .collect(), + path_prefixes: Vec::new(), + pin: false, }) - .collect::>() - .join(" ") - } -} -fn keywords(nodes: &[&NodeRecord], limit: usize) -> Vec { - const STOPWORDS: [&str; 27] = [ - "the", "and", "for", "with", "from", "this", "that", "class", "function", "method", "file", - "src", "lib", "core", "index", "main", "init", "py", "ts", "tsx", "js", "jsx", "go", "rs", - "java", "html", "css", - ]; - let mut counts = HashMap::::new(); - let mut order = 0; - for node in nodes { - for raw in format!("{} {}", node.string("label"), node.string("source_file")) - .replace(['/', '_', '-'], " ") - .split_whitespace() - { - let word = raw - .chars() - .filter(|c| c.is_alphanumeric()) - .collect::() - .to_lowercase(); - if word.len() < 3 || STOPWORDS.contains(&word.as_str()) { - continue; - } - let entry = counts.entry(word).or_insert_with(|| { - let x = (0, order); - order += 1; - x - }); - entry.0 += 1; - } - } - let mut values = counts.into_iter().collect::>(); - values.sort_by_key(|(_, v)| (std::cmp::Reverse(v.0), v.1)); - values.into_iter().take(limit).map(|v| v.0).collect() -} -fn keyword_count(body: &str, word: &str) -> usize { - body.match_indices(word) - .filter(|(index, _)| { - let before = body.as_bytes().get(index.wrapping_sub(1)).copied(); - let after = body.as_bytes().get(index + word.len()).copied(); - !before.is_some_and(|c| c.is_ascii_alphanumeric()) - && !after.is_some_and(|c| c.is_ascii_alphanumeric()) - }) - .count() -} -fn anchor_id(raw: &str, used: &mut HashSet) -> String { - let mut base = raw - .to_lowercase() - .chars() - .map(|c| { - if c.is_ascii_lowercase() || c.is_ascii_digit() { - c - } else { - '-' - } - }) - .collect::(); - while base.contains("--") { - base = base.replace("--", "-"); - } - base = base.trim_matches('-').chars().take(48).collect(); - if base.is_empty() { - base = "section".into(); - } - let mut candidate = base.clone(); - if used.contains(&candidate) { - candidate = format!( - "{base}-{}", - &format!("{:x}", Sha1::digest(raw.as_bytes()))[..6] - ); - } - let mut suffix = 2; - while used.contains(&candidate) { - candidate = format!("{base}-{suffix}"); - suffix += 1; - } - used.insert(candidate.clone()); - candidate -} -fn stable_id(raw: &str, prefix: &str) -> String { - let mut slug = raw - .chars() - .map(|c| { - if c.is_ascii_alphanumeric() || c == '_' { - c - } else { - '_' - } - }) - .collect::(); - while slug.contains("__") { - slug = slug.replace("__", "_"); - } - slug = slug.trim_matches('_').chars().take(48).collect(); - if slug.is_empty() { - slug = prefix.into(); - } - if slug.starts_with(|c: char| c.is_ascii_digit()) { - slug = format!("{prefix}_{slug}"); + .collect(), } - format!( - "{}_{}", - slug.trim_end_matches('_'), - &format!("{:x}", Sha1::digest(raw.as_bytes()))[..8] - ) -} -fn mermaid_init(scale: f64) -> String { - let scale = scale.clamp(0.65, 1.8); - let config = serde_json::json!({ - "theme": "dark", - "themeVariables": {"fontSize": format!("{:.1}px", 15.0 * scale)}, - "flowchart": { - "htmlLabels": true, - "nodeSpacing": (48.0 * scale).round() as i64, - "rankSpacing": (64.0 * scale).round() as i64, - } - }); - format!("%%{{init: {config}}}%%\nflowchart LR") } -fn node_mermaid_label(node: &NodeRecord) -> String { - let label = humanize(node.label(), &node.string("source_file")); - let path = short_path(&node.string("source_file")); - if !path.is_empty() - && !label.ends_with( - Path::new(&path) - .file_name() - .and_then(|v| v.to_str()) - .unwrap_or_default(), - ) - { - format!( - "{}
    {}", - mermaid_text(&label), - mermaid_text(&path) - ) - } else { - mermaid_text(&label) - } -} -fn humanize(label: &str, path: &str) -> String { - let mut value: String = if label.is_empty() { - Path::new(path) - .file_name() - .and_then(|v| v.to_str()) - .unwrap_or("Unknown") - .into() - } else { - label.trim().into() - }; - if value.starts_with('.') && value.ends_with("()") { - value.remove(0); - } - if value.len() > 42 { - value.truncate(value.char_indices().nth(39).map_or(value.len(), |v| v.0)); - value.push_str("..."); - } - value -} -fn short_path(path: &str) -> String { - let parts = path.split('/').collect::>(); - if parts.len() > 3 { - parts[parts.len() - 3..].join("/") - } else { - path.into() - } -} -fn relation_text(relation: &str, language: &str) -> String { - let value = if is_zh(language) { - match relation { - "calls" => "调用", - "uses" => "使用", - "imports" | "imports_from" => "导入", - "method" => "方法", - "contains" => "包含", - _ => relation, - } - } else { - match relation { - "imports_from" => "imports", - "rationale_for" => "explains", - "conceptually_related_to" => "relates", - _ => relation, - } - }; - mermaid_text(&value.replace('_', " ")) -} -fn mermaid_text(value: &str) -> String { - html_escape( - &value - .replace('"', "'") - .replace(['`', '#', '{', '}'], "") - .replace('|', " ") - .replace("->>", " to ") - .replace("-->", " to ") - .replace("->", " to ") - .split_whitespace() - .collect::>() - .join(" "), - false, - ) -} -fn include_edge(edge: &EdgeRecord) -> bool { - let confidence = defaulted(edge, "confidence", "EXTRACTED"); - confidence == "EXTRACTED" - || (confidence == "INFERRED" && edge.number("confidence_score").unwrap_or(1.0) >= 0.85) -} -fn defaulted(edge: &EdgeRecord, key: &str, default: &str) -> String { - let value = edge.string(key); - if value.is_empty() { - default.into() - } else { - value - } -} -fn edge_source(edge: &EdgeRecord) -> &str { - edge.semantic_source() -} -fn edge_target(edge: &EdgeRecord) -> &str { - edge.semantic_target() -} -fn detect_language<'a>( - language: &'a str, - document: &GraphDocument, - labels: Option<&BTreeMap>, -) -> &'a str { - if !language.eq_ignore_ascii_case("auto") { - return language; - } - let chinese = labels - .into_iter() - .flat_map(|v| v.values()) - .any(|v| v.chars().any(is_chinese)) - || document - .nodes - .iter() - .take(200) - .any(|n| n.label().chars().any(is_chinese)); - if chinese { "zh-CN" } else { "en" } -} -fn is_chinese(c: char) -> bool { - ('\u{4e00}'..='\u{9fff}').contains(&c) -} -fn is_zh(language: &str) -> bool { - language.to_lowercase().starts_with("zh") -} -fn text<'a>(language: &str, zh: &'a str, en: &'a str) -> &'a str { - if is_zh(language) { zh } else { en } -} -fn html_escape(value: &str, quote: bool) -> String { - let mut output = value - .replace('&', "&") - .replace('<', "<") - .replace('>', ">"); - if quote { - output = output.replace('"', """).replace('\'', "'"); - } - output -} -fn comment_text(value: &str) -> String { - value.replace("--", "- -").replace(['\n', '\r'], " ") -} -fn utc_minute() -> String { - let now = time::OffsetDateTime::now_utc(); - format!( - "{:04}-{:02}-{:02} {:02}:{:02} UTC", - now.year(), - u8::from(now.month()), - now.day(), - now.hour(), - now.minute() - ) -} - -const CSS: &str = r#":root{--bg:#0f172a;--surface:#1e293b;--border:#334155;--text:#e2e8f0;--muted:#94a3b8;--accent:#38bdf8}*{box-sizing:border-box}body{margin:0;font-family:'Segoe UI',system-ui,sans-serif;background:var(--bg);color:var(--text);line-height:1.7}.container{max-width:1200px;margin:auto;padding:40px 24px}h1{font-size:2.4rem;color:var(--accent)}h2{margin:48px 0 16px;border-bottom:2px solid var(--accent)}h3,h4{color:var(--accent)}p,small{color:var(--muted)}.nav{position:sticky;top:0;background:var(--bg);display:flex;gap:20px;flex-wrap:wrap;padding:12px 0}.nav a{color:var(--accent)}.mermaid,.card{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:20px;margin:16px 0;overflow:auto}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(340px,1fr));gap:16px}.call-table,table{width:100%;border-collapse:collapse}.call-table th,.call-table td,td,th{padding:8px;border:1px solid var(--border)}code{background:#ffffff10;padding:1px 6px}.tag{display:inline-block;padding:2px 8px;border-radius:4px}.tag-func{color:var(--accent)}.arrow-chain{font-family:monospace;color:var(--accent)}footer{text-align:center;padding:40px 0}"#; #[cfg(test)] mod tests { @@ -1284,30 +250,30 @@ mod tests { use super::*; #[test] - fn hostile_graph_text_is_escaped_everywhere() -> Result<(), Box> { - let graph: GraphDocument = serde_json::from_value(json!({ - "graph":{"hyperedges":[{"id":"h","label":"","nodes":["a","b"]}]}, - "nodes":[ - {"id":"a","label":"ApiClient","source_file":"src/api.py"}, - {"id":"b","label":"","source_file":"src/evil.py"} - ], - "links":[{"source":"a","target":"b","relation":"calls","confidence":"EXTRACTED"}] + fn html_embeds_only_the_architecture_contract_and_escapes_script_terminators() + -> Result<(), Box> { + let document: GraphDocument = serde_json::from_value(json!({ + "graph": {}, + "nodes": [{ + "id":"node", + "label":"", + "source_file":"src/lib.rs" + }], + "links": [] }))?; - let communities = BTreeMap::from([(0, vec!["a".into()]), (1, vec!["b".into()])]); + let communities = BTreeMap::from([(0, vec!["node".to_owned()])]); let html = callflow_html_document( - &graph, + &document, &communities, &CallflowOptions { - report: "## God Nodes\n1. `` - 1 edges", - project_name: "", - generated_at: Some("2026-07-19 12:00 UTC"), + project_name: "Hostile ", ..CallflowOptions::default() }, )?; - assert!(html.contains("<script>alert(1)</script>")); - assert!(html.contains("<img onerror=x>")); - assert!(html.contains("<svg onload=x>")); - assert!(!html.contains("")); + assert!(html.contains("compass.viewer.architecture/1")); + assert!(!html.contains("compass.viewer.callflow/1")); + assert!(!html.contains("")); + assert!(html.contains(r#""coverage":{"status":"complete","truncated":false"#)); Ok(()) } } diff --git a/crates/compass-output/src/callflow_model.rs b/crates/compass-output/src/callflow_model.rs deleted file mode 100644 index 23a6ce10..00000000 --- a/crates/compass-output/src/callflow_model.rs +++ /dev/null @@ -1,364 +0,0 @@ -use std::collections::{BTreeMap, BTreeSet, HashMap}; - -use compass_graph::Communities; -use compass_model::{GraphDocument, NodeRecord}; -use serde::Serialize; - -use crate::{CallflowOptions, CallflowSection, OutputError, derive_callflow_sections}; - -pub const CALLFLOW_VIEWER_SCHEMA: &str = "compass.viewer.callflow/1"; - -#[derive(Clone, Debug, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct CallflowViewModel { - pub schema: &'static str, - pub title: String, - pub sections: Vec, - pub overview_links: Vec, - pub cross_section_calls: Vec, - pub coverage: CallflowCoverage, - pub report_highlights: Vec, - pub statistics: CallflowStatistics, - pub provenance: CallflowProvenance, -} - -#[derive(Clone, Debug, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct CallflowViewSection { - pub id: String, - pub name: String, - pub communities: Vec, - pub node_count: usize, - pub internal_call_count: usize, - pub nodes: Vec, - pub edges: Vec, -} - -#[derive(Clone, Debug, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct CallflowViewNode { - pub id: String, - pub label: String, - pub kind: String, - pub source_file: Option, - pub scope: CallflowSourceScope, -} - -#[derive(Clone, Debug, Eq, PartialEq, Serialize)] -#[serde(rename_all = "lowercase")] -pub enum CallflowSourceScope { - Production, - Test, - Generated, - Vendor, - Unknown, -} - -#[derive(Clone, Debug, Serialize)] -pub struct CallflowViewEdge { - pub source: String, - pub target: String, - pub relation: String, - pub confidence: String, -} - -#[derive(Clone, Debug, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct CallflowCrossSectionCall { - pub source: String, - pub target: String, - pub source_section: String, - pub target_section: String, - pub relation: String, - pub confidence: String, -} - -#[derive(Clone, Debug, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct CallflowCoverage { - pub internal: usize, - pub cross_section: usize, - pub unassigned: usize, -} - -#[derive(Clone, Debug, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct CallflowViewLink { - pub source_section: String, - pub target_section: String, - pub calls: usize, -} - -#[derive(Clone, Debug, Serialize)] -pub struct CallflowStatistics { - pub nodes: usize, - pub edges: usize, - pub communities: usize, - pub hyperedges: usize, - pub extracted: usize, - pub inferred: usize, - pub ambiguous: usize, -} - -#[derive(Clone, Debug, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct CallflowProvenance { - pub project_name: String, - pub built_at_commit: Option, - pub generated_at: Option, -} - -pub fn callflow_view_model( - document: &GraphDocument, - communities: &Communities, - options: &CallflowOptions<'_>, -) -> Result { - if document.nodes.is_empty() { - return Err(OutputError::EmptyCallflowGraph); - } - let mut sections = options.sections.map_or_else( - || { - derive_callflow_sections( - document, - communities, - options.community_labels, - options.language, - options.max_sections, - ) - }, - <[CallflowSection]>::to_vec, - ); - if sections - .first() - .is_none_or(|section| section.id != "overview") - { - sections.insert( - 0, - CallflowSection { - id: "overview".to_owned(), - name: "Architecture Overview".to_owned(), - communities: Vec::new(), - }, - ); - } - if sections.len() <= 1 { - return Err(OutputError::NoCallflowSections); - } - let node_community = communities - .iter() - .flat_map(|(community, members)| { - members - .iter() - .map(move |member| (member.as_str(), community.to_string())) - }) - .collect::>(); - let mut node_section = HashMap::<&str, String>::new(); - let mut view_sections = Vec::new(); - for section in sections { - let selected = document - .nodes - .iter() - .filter(|node| { - let community = node_community - .get(node.id.as_str()) - .cloned() - .or_else(|| node.unsigned("community").map(|value| value.to_string())); - section.id != "overview" - && community.is_some_and(|community| section.communities.contains(&community)) - }) - .collect::>(); - for node in &selected { - node_section.insert(&node.id, section.id.clone()); - } - let ids = selected - .iter() - .map(|node| node.id.as_str()) - .collect::>(); - let nodes = selected.into_iter().map(view_node).collect::>(); - let edges = document - .links - .iter() - .filter(|edge| ids.contains(edge.source.as_str()) && ids.contains(edge.target.as_str())) - .map(|edge| CallflowViewEdge { - source: edge.source.clone(), - target: edge.target.clone(), - relation: edge.string("relation"), - confidence: confidence(edge.string("confidence")), - }) - .collect::>(); - let node_count = nodes.len(); - let internal_call_count = edges.len(); - view_sections.push(CallflowViewSection { - id: section.id, - name: section.name, - communities: section.communities, - node_count, - internal_call_count, - nodes, - edges, - }); - } - let mut link_counts = BTreeMap::<(String, String), usize>::new(); - let mut cross_section_calls = Vec::new(); - let mut coverage = CallflowCoverage { - internal: 0, - cross_section: 0, - unassigned: 0, - }; - for edge in &document.links { - let (Some(source), Some(target)) = ( - node_section.get(edge.source.as_str()), - node_section.get(edge.target.as_str()), - ) else { - coverage.unassigned += 1; - continue; - }; - if source == target { - coverage.internal += 1; - continue; - } - coverage.cross_section += 1; - *link_counts - .entry((source.clone(), target.clone())) - .or_default() += 1; - cross_section_calls.push(CallflowCrossSectionCall { - source: edge.source.clone(), - target: edge.target.clone(), - source_section: source.clone(), - target_section: target.clone(), - relation: edge.string("relation"), - confidence: confidence(edge.string("confidence")), - }); - } - let overview_links = link_counts - .into_iter() - .map( - |((source_section, target_section), calls)| CallflowViewLink { - source_section, - target_section, - calls, - }, - ) - .collect(); - let confidence_counts = |expected: &str| { - document - .links - .iter() - .filter(|edge| confidence(edge.string("confidence")) == expected) - .count() - }; - let report_highlights = options - .report - .lines() - .map(str::trim) - .filter(|line| line.starts_with('#') || line.starts_with("- ")) - .map(|line| line.trim_start_matches(['#', '-', ' ']).to_owned()) - .filter(|line| !line.is_empty()) - .take(12) - .collect(); - Ok(CallflowViewModel { - schema: CALLFLOW_VIEWER_SCHEMA, - title: format!("{} — Architecture Flow", options.project_name), - sections: view_sections, - overview_links, - cross_section_calls, - coverage, - report_highlights, - statistics: CallflowStatistics { - nodes: document.nodes.len(), - edges: document.links.len(), - communities: communities.len(), - hyperedges: document - .graph - .get("hyperedges") - .and_then(serde_json::Value::as_array) - .map_or(0, Vec::len), - extracted: confidence_counts("extracted"), - inferred: confidence_counts("inferred"), - ambiguous: confidence_counts("ambiguous"), - }, - provenance: CallflowProvenance { - project_name: options.project_name.to_owned(), - built_at_commit: options.built_at_commit.map(str::to_owned), - generated_at: options.generated_at.map(str::to_owned), - }, - }) -} - -fn view_node(node: &NodeRecord) -> CallflowViewNode { - let source_file = node.string("source_file"); - CallflowViewNode { - id: node.id.clone(), - label: { - let label = node.string("label"); - if label.is_empty() { - node.id.clone() - } else { - label - } - }, - kind: { - let kind = node.string("symbol_kind"); - if kind.is_empty() { - node.string("file_type") - } else { - kind - } - }, - scope: source_scope(&source_file), - source_file: (!source_file.is_empty()).then_some(source_file), - } -} - -fn source_scope(source_file: &str) -> CallflowSourceScope { - if source_file.trim().is_empty() { - return CallflowSourceScope::Unknown; - } - let normalized = source_file.replace('\\', "/").to_ascii_lowercase(); - let segments = normalized.split('/').collect::>(); - let filename = segments.last().copied().unwrap_or_default(); - if segments - .iter() - .any(|segment| matches!(*segment, "test" | "tests" | "testing" | "__tests__")) - || filename.starts_with("test_") - || filename.contains("_test.") - || filename.contains(".test.") - || filename.contains(".spec.") - { - return CallflowSourceScope::Test; - } - if segments.iter().any(|segment| { - matches!( - *segment, - "generated" | "gen" | "dist" | "build" | "target" | ".next" - ) - }) || filename.contains(".generated.") - || filename.contains("_generated.") - { - return CallflowSourceScope::Generated; - } - if segments.iter().any(|segment| { - matches!( - *segment, - "vendor" - | "third_party" - | "third-party" - | "node_modules" - | ".venv" - | "venv" - | "site-packages" - ) - }) { - return CallflowSourceScope::Vendor; - } - CallflowSourceScope::Production -} - -fn confidence(value: String) -> String { - match value.to_ascii_lowercase().as_str() { - "inferred" => "inferred", - "ambiguous" => "ambiguous", - _ => "extracted", - } - .to_owned() -} diff --git a/crates/compass-output/src/lib.rs b/crates/compass-output/src/lib.rs index 8271fbaf..77ca2a36 100644 --- a/crates/compass-output/src/lib.rs +++ b/crates/compass-output/src/lib.rs @@ -1,8 +1,8 @@ //! Safe, deterministic output formats for Compass graphs. +mod architecture_projection; mod backup; mod callflow; -mod callflow_model; mod canvas; mod cql; mod cypher; @@ -21,16 +21,24 @@ mod viewer_model; mod wiki; mod workbench; +pub use architecture_projection::{ + ARCHITECTURE_OVERLAY_SCHEMA, ARCHITECTURE_VIEWER_SCHEMA, ArchitectureClassCounts, + ArchitectureCoverage, ArchitectureDiagnosticSeverity, ArchitectureEvidenceCounts, + ArchitectureGroup, ArchitectureGroupKind, ArchitectureGroupName, ArchitectureLens, + ArchitectureMembership, ArchitectureNameProvenance, ArchitectureNode, ArchitectureOmissions, + ArchitectureOverlay, ArchitectureOverlayGroup, ArchitectureOverlaySourceRule, + ArchitectureProjectionError, ArchitectureProjectionInput, ArchitectureProjectionLimits, + ArchitectureProjectionOptions, ArchitectureProvenance, ArchitectureQuality, + ArchitectureQualityDiagnostic, ArchitectureQualityMetrics, ArchitectureQualityStatus, + ArchitectureRelationClass, ArchitectureRelationship, ArchitectureRoute, ArchitectureRouteLevel, + ArchitectureScope, ArchitectureScopeProjection, ArchitectureSourceCounts, + ArchitectureSourceScope, ArchitectureStatistics, ArchitectureViewModel, project_architecture, +}; pub use backup::{BackupResult, backup_if_protected, backup_if_protected_to}; pub use callflow::{ CallflowExport, CallflowOptions, CallflowSection, callflow_html_document, derive_callflow_sections, write_callflow_html, }; -pub use callflow_model::{ - CALLFLOW_VIEWER_SCHEMA, CallflowCoverage, CallflowCrossSectionCall, CallflowProvenance, - CallflowSourceScope, CallflowStatistics, CallflowViewEdge, CallflowViewLink, CallflowViewModel, - CallflowViewNode, CallflowViewSection, callflow_view_model, -}; pub use canvas::{CanvasOptions, canvas_document, write_canvas}; pub use cql::{render_cql_json, render_cql_jsonl, render_cql_table}; pub use cypher::{cypher_document, write_cypher}; @@ -132,6 +140,8 @@ pub enum OutputError { EmptyCallflowGraph, #[error("no sections defined")] NoCallflowSections, + #[error("invalid architecture projection: {0}")] + InvalidArchitectureProjection(String), #[error( "communities dict is empty — refusing to clear wiki/. Run `compass extract .` or `compass cluster-only .` first." )] diff --git a/crates/compass-output/src/workbench.rs b/crates/compass-output/src/workbench.rs index 0358c679..f3d70984 100644 --- a/crates/compass-output/src/workbench.rs +++ b/crates/compass-output/src/workbench.rs @@ -6,7 +6,7 @@ use compass_model::query_contract::CodeQueryResponse; use serde::Serialize; use url::Url; -use crate::{CallflowViewModel, GraphViewModel, OutputError}; +use crate::{ArchitectureViewModel, GraphViewModel, OutputError}; pub const WORKBENCH_SCHEMA: &str = "compass.viewer.workbench/1"; @@ -164,7 +164,7 @@ pub enum WorkbenchViewContent { result: CodeQueryResponse, }, Architecture { - model: CallflowViewModel, + model: ArchitectureViewModel, }, History { base_revision: String, diff --git a/crates/compass-output/tests/architecture_projection_fixtures.rs b/crates/compass-output/tests/architecture_projection_fixtures.rs new file mode 100644 index 00000000..79a6669a --- /dev/null +++ b/crates/compass-output/tests/architecture_projection_fixtures.rs @@ -0,0 +1,487 @@ +use std::collections::BTreeMap; +use std::error::Error; + +use compass_model::GraphDocument; +use compass_output::{ + ARCHITECTURE_VIEWER_SCHEMA, ArchitectureLens, ArchitectureProjectionInput, + ArchitectureProjectionOptions, ArchitectureQualityStatus, ArchitectureRelationClass, + ArchitectureScope, ArchitectureSourceScope, project_architecture, +}; +use serde_json::json; + +#[test] +fn generated_vendor_test_and_documentation_nodes_cannot_shape_production() +-> Result<(), Box> { + let document: GraphDocument = serde_json::from_value(json!({ + "graph": { + "files": [ + {"path":"crates/compass-output/assets/viewer/graph.js","generated":true} + ] + }, + "nodes": [ + {"id":"projection","label":"project_architecture","source_file":"crates/compass-output/src/architecture_projection/mod.rs"}, + {"id":"viewer","label":"VisualizationWorkbench","source_file":"packages/compass-viewer/src/workbench/VisualizationWorkbench.tsx"}, + {"id":"bundle","label":"a","source_file":"crates/compass-output/assets/viewer/graph.js"}, + {"id":"vendor","label":"dependency","source_file":"vendor/dependency/lib.rs"}, + {"id":"test","label":"projection_test","source_file":"tests/projection_test.rs"}, + {"id":"docs","label":"Architecture design","source_file":"docs/design/architecture.md"} + ], + "links": [ + {"source":"projection","target":"viewer","relation":"calls","confidence":"EXTRACTED"}, + {"source":"projection","target":"viewer","relation":"contains","confidence":"EXTRACTED"}, + {"source":"bundle","target":"projection","relation":"references","confidence":"EXTRACTED"}, + {"source":"vendor","target":"projection","relation":"imports","confidence":"EXTRACTED"}, + {"source":"test","target":"projection","relation":"tests","confidence":"EXTRACTED"}, + {"source":"docs","target":"projection","relation":"references","confidence":"EXTRACTED"} + ] + }))?; + let communities = BTreeMap::from([ + (0, vec!["projection".to_owned(), "bundle".to_owned()]), + (1, vec!["viewer".to_owned()]), + (2, vec!["vendor".to_owned()]), + (3, vec!["test".to_owned()]), + (4, vec!["docs".to_owned()]), + ]); + let labels = BTreeMap::from([ + (0, "Crates Compass Output".to_owned()), + (1, "Crates Compass Output".to_owned()), + (2, "Crates Compass Output".to_owned()), + (3, "Crates Compass Output".to_owned()), + (4, "Crates Compass Output".to_owned()), + ]); + let model = project_architecture( + ArchitectureProjectionInput { + document: &document, + communities: &communities, + community_labels: Some(&labels), + overlay: None, + project_name: "Compass", + built_at_commit: None, + generated_at: None, + }, + &ArchitectureProjectionOptions::default(), + )?; + + assert_eq!(model.schema, ARCHITECTURE_VIEWER_SCHEMA); + let scopes = model + .nodes + .iter() + .map(|node| (node.id.as_str(), node.source_scope)) + .collect::>(); + assert_eq!(scopes["bundle"], ArchitectureSourceScope::Generated); + assert_eq!(scopes["vendor"], ArchitectureSourceScope::Vendor); + assert_eq!(scopes["test"], ArchitectureSourceScope::Test); + assert_eq!(scopes["docs"], ArchitectureSourceScope::Documentation); + + let production = model + .projections + .iter() + .find(|projection| projection.scope == ArchitectureScope::Production) + .ok_or("missing Production")?; + assert_eq!(production.memberships.len(), 2); + assert_eq!(production.quality.metrics.generated_vendor_leakage, 0); + assert_eq!(production.coverage.admitted, 1); + assert_eq!(production.coverage.cross_group, 1); + assert_eq!(production.coverage.relation_classes.execution, 1); + assert_eq!(production.coverage.relation_classes.structure, 1); + assert_eq!(production.coverage.relation_classes.contextual, 0); + assert!( + production + .groups + .iter() + .all(|group| group.name.value != "Other") + ); + let unique_names = production + .groups + .iter() + .map(|group| group.name.value.to_ascii_lowercase()) + .collect::>(); + assert_eq!(unique_names.len(), production.groups.len()); + + let all_code = model + .projections + .iter() + .find(|projection| projection.scope == ArchitectureScope::AllCode) + .ok_or("missing All-code")?; + assert_eq!(all_code.memberships.len(), model.nodes.len()); + Ok(()) +} + +#[test] +fn overview_omission_is_metadata_not_a_connected_group() -> Result<(), Box> { + let nodes = (0..40) + .map(|index| { + json!({ + "id": format!("n{index}"), + "label": format!("Subsystem{index}"), + "source_file": format!("packages/package-{index}/src/lib.rs") + }) + }) + .collect::>(); + let links = (0..39) + .map(|index| { + json!({ + "source": format!("n{index}"), + "target": format!("n{}", index + 1), + "relation":"imports", + "confidence":"EXTRACTED" + }) + }) + .collect::>(); + let document: GraphDocument = serde_json::from_value(json!({ + "graph": {}, + "nodes": nodes, + "links": links + }))?; + let communities = (0..40) + .map(|index| (index, vec![format!("n{index}")])) + .collect::>(); + let defaults = ArchitectureProjectionOptions::default(); + let options = ArchitectureProjectionOptions { + limits: compass_output::ArchitectureProjectionLimits { + max_overview_groups: 8, + max_overview_routes: 8, + ..defaults.limits + }, + ..defaults + }; + let model = project_architecture( + ArchitectureProjectionInput { + document: &document, + communities: &communities, + community_labels: None, + overlay: None, + project_name: "Many packages", + built_at_commit: None, + generated_at: None, + }, + &options, + )?; + let production = model + .projections + .iter() + .find(|projection| projection.scope == ArchitectureScope::Production) + .ok_or("missing Production")?; + assert_eq!(production.omissions.total_groups, 40); + assert_eq!(production.omissions.shown_groups, 8); + assert_eq!(production.omissions.omitted_groups, 32); + assert!(production.omissions.omitted_nodes > 0); + assert!(production.groups.iter().all(|group| group.id != "other")); + assert!( + production + .routes + .iter() + .all(|route| { route.source_group != "other" && route.target_group != "other" }) + ); + assert_eq!( + production.quality.status, + ArchitectureQualityStatus::Degraded + ); + Ok(()) +} + +#[test] +fn relation_classes_preserve_original_relationships_but_control_lenses() +-> Result<(), Box> { + let document: GraphDocument = serde_json::from_value(json!({ + "graph": {}, + "nodes": [ + {"id":"a","source_file":"src/a.rs"}, + {"id":"b","source_file":"src/b.rs"} + ], + "links": [ + {"source":"a","target":"b","relation":"calls"}, + {"source":"a","target":"b","relation":"imports"}, + {"source":"a","target":"b","relation":"contains"}, + {"source":"a","target":"b","relation":"references"}, + {"source":"a","target":"b","relation":"future_relation"} + ] + }))?; + let communities = BTreeMap::from([(0, vec!["a".to_owned()]), (1, vec!["b".to_owned()])]); + let model = project_architecture( + ArchitectureProjectionInput { + document: &document, + communities: &communities, + community_labels: None, + overlay: None, + project_name: "Relations", + built_at_commit: None, + generated_at: None, + }, + &ArchitectureProjectionOptions::default(), + )?; + assert_eq!(model.relationships.len(), 5); + let classes = model + .relationships + .iter() + .map(|relationship| (relationship.relation.as_str(), relationship.relation_class)) + .collect::>(); + assert_eq!(classes["calls"], ArchitectureRelationClass::Execution); + assert_eq!(classes["imports"], ArchitectureRelationClass::Dependency); + assert_eq!(classes["contains"], ArchitectureRelationClass::Structure); + assert_eq!(classes["references"], ArchitectureRelationClass::Contextual); + assert_eq!( + classes["future_relation"], + ArchitectureRelationClass::Unknown + ); + assert!(ArchitectureLens::Architecture.admits(classes["calls"])); + assert!(ArchitectureLens::Architecture.admits(classes["imports"])); + assert!(!ArchitectureLens::Architecture.admits(classes["contains"])); + assert!(!ArchitectureLens::Architecture.admits(classes["references"])); + Ok(()) +} + +#[test] +fn names_do_not_control_identity_and_unaffected_groups_survive_edits() -> Result<(), Box> +{ + let base: GraphDocument = serde_json::from_value(json!({ + "graph": {}, + "nodes": [ + {"id":"a","label":"Alpha","source_file":"crates/runtime/src/a.rs"}, + {"id":"b","label":"Beta","source_file":"crates/storage/src/b.rs"} + ], + "links": [{"source":"a","target":"b","relation":"calls"}] + }))?; + let communities = BTreeMap::from([(7, vec!["a".to_owned()]), (42, vec!["b".to_owned()])]); + let first = project_architecture( + ArchitectureProjectionInput { + document: &base, + communities: &communities, + community_labels: Some(&BTreeMap::from([ + (7, "Runtime".to_owned()), + (42, "Storage".to_owned()), + ])), + overlay: None, + project_name: "Fixture", + built_at_commit: None, + generated_at: None, + }, + &ArchitectureProjectionOptions::default(), + )?; + let renamed = project_architecture( + ArchitectureProjectionInput { + document: &base, + communities: &communities, + community_labels: Some(&BTreeMap::from([ + (7, "Request Runtime".to_owned()), + (42, "Ledger Storage".to_owned()), + ])), + overlay: None, + project_name: "Fixture", + built_at_commit: None, + generated_at: None, + }, + &ArchitectureProjectionOptions::default(), + )?; + let ids = |model: &compass_output::ArchitectureViewModel| { + model.projections[0] + .groups + .iter() + .map(|group| group.id.clone()) + .collect::>() + }; + assert_eq!(ids(&first), ids(&renamed)); + assert_eq!(first.relationships[0].id, renamed.relationships[0].id); + + let edited: GraphDocument = serde_json::from_value(json!({ + "graph": {}, + "nodes": [ + {"id":"a","label":"Alpha","source_file":"crates/runtime/src/a.rs"}, + {"id":"a2","label":"AlphaHelper","source_file":"crates/runtime/src/a2.rs"}, + {"id":"b","label":"Beta","source_file":"crates/storage/src/b.rs"} + ], + "links": [{"source":"a","target":"b","relation":"calls"}] + }))?; + let edited_communities = BTreeMap::from([ + (7, vec!["a".to_owned(), "a2".to_owned()]), + (42, vec!["b".to_owned()]), + ]); + let after = project_architecture( + ArchitectureProjectionInput { + document: &edited, + communities: &edited_communities, + community_labels: None, + overlay: None, + project_name: "Fixture", + built_at_commit: None, + generated_at: None, + }, + &ArchitectureProjectionOptions::default(), + )?; + let before_node_index = first + .nodes + .iter() + .position(|node| node.id == "b") + .ok_or("missing b node")?; + let after_node_index = after + .nodes + .iter() + .position(|node| node.id == "b") + .ok_or("missing b node after")?; + let storage_before = first.projections[0] + .memberships + .iter() + .find(|item| item.node_index == before_node_index) + .ok_or("missing b")?; + let storage_after = after.projections[0] + .memberships + .iter() + .find(|item| item.node_index == after_node_index) + .ok_or("missing b after")?; + assert_eq!( + first.projections[0].groups[storage_before.group_index].id, + after.projections[0].groups[storage_after.group_index].id + ); + Ok(()) +} + +#[test] +fn zero_configuration_corpus_covers_workspace_monorepo_mixed_and_sparse_shapes() +-> Result<(), Box> { + let paths = [ + ("cargo", "crates/runtime/src/lib.rs"), + ("npm", "packages/web/src/app.ts"), + ("mixed", "services/search/src/main.py"), + ("single", "src/domain.rs"), + ("generated", "generated/client/api.ts"), + ("vendor", "vendor/sqlite/sqlite.c"), + ("test", "tests/runtime_test.rs"), + ("unknown", ""), + ]; + let nodes = paths + .iter() + .map(|(id, path)| { + if path.is_empty() { + json!({"id":id,"label":id,"community":0}) + } else { + json!({"id":id,"label":id,"source_file":path,"community":0}) + } + }) + .collect::>(); + let document: GraphDocument = serde_json::from_value(json!({ + "graph": {}, + "nodes": nodes, + "links": [ + {"source":"cargo","target":"npm","relation":"imports"}, + {"source":"npm","target":"mixed","relation":"calls"} + ] + }))?; + let communities = BTreeMap::from([( + 0, + paths + .iter() + .map(|(id, _)| (*id).to_owned()) + .collect::>(), + )]); + let model = project_architecture( + ArchitectureProjectionInput { + document: &document, + communities: &communities, + community_labels: None, + overlay: None, + project_name: "Corpus", + built_at_commit: None, + generated_at: None, + }, + &ArchitectureProjectionOptions::default(), + )?; + let production = model + .projections + .iter() + .find(|projection| projection.scope == ArchitectureScope::Production) + .ok_or("missing Production")?; + let all_code = model + .projections + .iter() + .find(|projection| projection.scope == ArchitectureScope::AllCode) + .ok_or("missing All-code")?; + assert_eq!(production.memberships.len(), 4); + assert_eq!(all_code.memberships.len(), 8); + assert_eq!(production.quality.metrics.generated_vendor_leakage, 0); + assert_eq!(production.quality.metrics.duplicate_names, 0); + assert!(production.groups.len() >= 4); + + let corpora = [ + ( + "cargo-workspace", + ["crates/api/src/lib.rs", "crates/store/src/lib.rs"], + 2, + ), + ( + "npm-monorepo", + ["packages/web/src/app.ts", "packages/data/src/store.ts"], + 2, + ), + ( + "mixed-language", + ["services/search/main.py", "packages/ui/src/view.tsx"], + 2, + ), + ( + "generated-heavy", + ["src/runtime.rs", "generated/client/api.ts"], + 1, + ), + ( + "vendor-heavy", + ["src/runtime.c", "third_party/sqlite/sqlite.c"], + 1, + ), + ("test-heavy", ["src/runtime.go", "tests/runtime_test.go"], 1), + ("single-package", ["src/domain.rs", "src/storage.rs"], 2), + ( + "sparse-relationships", + ["app/domain.rb", "app/storage.rb"], + 2, + ), + ]; + for (name, source_paths, expected_production) in corpora { + let corpus_document: GraphDocument = serde_json::from_value(json!({ + "graph": {}, + "nodes": source_paths.iter().enumerate().map(|(index, path)| json!({ + "id":format!("{name}-{index}"), + "label":format!("Entry{index}"), + "source_file":path + })).collect::>(), + "links": [] + }))?; + let corpus_communities = BTreeMap::from([( + 0, + (0..source_paths.len()) + .map(|index| format!("{name}-{index}")) + .collect(), + )]); + let corpus_model = project_architecture( + ArchitectureProjectionInput { + document: &corpus_document, + communities: &corpus_communities, + community_labels: None, + overlay: None, + project_name: name, + built_at_commit: None, + generated_at: None, + }, + &ArchitectureProjectionOptions::default(), + )?; + let corpus_production = corpus_model + .projections + .iter() + .find(|projection| projection.scope == ArchitectureScope::Production) + .ok_or("missing corpus Production")?; + assert_eq!( + corpus_production.memberships.len(), + expected_production, + "{name}" + ); + assert_ne!( + corpus_production.quality.status, + ArchitectureQualityStatus::Insufficient, + "{name}" + ); + assert_eq!( + corpus_production.quality.metrics.generated_vendor_leakage, 0, + "{name}" + ); + } + Ok(()) +} diff --git a/crates/compass-output/tests/callflow_model.rs b/crates/compass-output/tests/callflow_model.rs deleted file mode 100644 index 40efc02b..00000000 --- a/crates/compass-output/tests/callflow_model.rs +++ /dev/null @@ -1,132 +0,0 @@ -use std::collections::BTreeMap; -use std::error::Error; - -use compass_model::GraphDocument; -use compass_output::{ - CALLFLOW_VIEWER_SCHEMA, CallflowOptions, CallflowSection, CallflowSourceScope, - callflow_view_model, -}; -use serde_json::json; - -#[test] -fn complete_model_preserves_cross_section_calls_and_edge_coverage() -> Result<(), Box> { - let document: GraphDocument = serde_json::from_value(json!({ - "graph": {}, - "nodes": [ - {"id":"api","label":"api","community":0,"source_file":"src/api.rs"}, - {"id":"helper","label":"helper","community":0,"source_file":"src/helper.rs"}, - {"id":"store","label":"store","community":1,"source_file":"src/store.rs"}, - {"id":"orphan","label":"orphan","source_file":"src/orphan.rs"} - ], - "links": [ - {"source":"api","target":"helper","relation":"calls","confidence":"EXTRACTED"}, - {"source":"api","target":"store","relation":"calls","confidence":"INFERRED"}, - {"source":"orphan","target":"api","relation":"references","confidence":"AMBIGUOUS"} - ] - }))?; - let communities = BTreeMap::from([ - (0, vec!["api".to_owned(), "helper".to_owned()]), - (1, vec!["store".to_owned()]), - ]); - let sections = vec![ - CallflowSection { - id: "overview".to_owned(), - name: "Overview".to_owned(), - communities: vec![], - }, - CallflowSection { - id: "api".to_owned(), - name: "API".to_owned(), - communities: vec!["0".to_owned()], - }, - CallflowSection { - id: "storage".to_owned(), - name: "Storage".to_owned(), - communities: vec!["1".to_owned()], - }, - ]; - - let model = callflow_view_model( - &document, - &communities, - &CallflowOptions { - sections: Some(§ions), - project_name: "Fixture", - ..CallflowOptions::default() - }, - )?; - - assert_eq!(model.schema, CALLFLOW_VIEWER_SCHEMA); - assert_eq!(model.coverage.internal, 1); - assert_eq!(model.coverage.cross_section, 1); - assert_eq!(model.coverage.unassigned, 1); - assert_eq!( - model.coverage.internal + model.coverage.cross_section + model.coverage.unassigned, - document.links.len() - ); - assert_eq!(model.cross_section_calls.len(), 1); - let call = &model.cross_section_calls[0]; - assert_eq!(call.source, "api"); - assert_eq!(call.target, "store"); - assert_eq!(call.source_section, "api"); - assert_eq!(call.target_section, "storage"); - assert_eq!(call.relation, "calls"); - assert_eq!(call.confidence, "inferred"); - assert_eq!(model.sections[1].node_count, 2); - assert_eq!(model.sections[1].internal_call_count, 1); - Ok(()) -} - -#[test] -fn source_scopes_are_classified_without_discarding_nodes() -> Result<(), Box> { - let document: GraphDocument = serde_json::from_value(json!({ - "graph": {}, - "nodes": [ - {"id":"prod","community":0,"source_file":"src/lib.rs"}, - {"id":"test","community":0,"source_file":"tests/test_api.py"}, - {"id":"generated","community":0,"source_file":"generated/schema.rs"}, - {"id":"vendor","community":0,"source_file":"vendor/pkg/lib.rs"}, - {"id":"unknown","community":0} - ], - "links": [] - }))?; - let communities = BTreeMap::from([( - 0, - vec![ - "prod".to_owned(), - "test".to_owned(), - "generated".to_owned(), - "vendor".to_owned(), - "unknown".to_owned(), - ], - )]); - let sections = vec![CallflowSection { - id: "core".to_owned(), - name: "Core".to_owned(), - communities: vec!["0".to_owned()], - }]; - - let model = callflow_view_model( - &document, - &communities, - &CallflowOptions { - sections: Some(§ions), - ..CallflowOptions::default() - }, - )?; - let scopes = model.sections[1] - .nodes - .iter() - .map(|node| (node.id.as_str(), node.scope.clone())) - .collect::>(); - - assert_eq!(scopes.get("prod"), Some(&CallflowSourceScope::Production)); - assert_eq!(scopes.get("test"), Some(&CallflowSourceScope::Test)); - assert_eq!( - scopes.get("generated"), - Some(&CallflowSourceScope::Generated) - ); - assert_eq!(scopes.get("vendor"), Some(&CallflowSourceScope::Vendor)); - assert_eq!(scopes.get("unknown"), Some(&CallflowSourceScope::Unknown)); - Ok(()) -} diff --git a/docs/README.md b/docs/README.md index 068ba587..d9827d47 100644 --- a/docs/README.md +++ b/docs/README.md @@ -103,6 +103,8 @@ They are not evidence that an uncompleted design has shipped. | [Universal evidence implementation](implementation/universal-evidence.md) | Current universal evidence pipeline, resolution order, and failure classes | | [Evidence resolution framework technical design](implementation/evidence-resolution-framework-technical-design.md) | Target ownership, components, interfaces, and invariants for rearchitecting the resolver | | [Evidence resolution framework execution plan](implementation/evidence-resolution-framework-phased-execution-plan.md) | Phased, commit-oriented implementation and verification plan | +| [Architecture graph hardening technical design](implementation/architecture-graph-hardening-phased-technical-design.md) | Project-specific architecture projection, quality contract, and phased delivery plan | +| [Architecture graph hardening qualification](implementation/architecture-graph-hardening-qualification.md) | Real-repository metrics, screenshots, acceptance gates, and residual diagnostics | | [Query recall and accuracy design](implementation/query-recall-accuracy/query-performance-accuracy-recall-phased-technical-design.md) | Phased query-quality architecture, evidence, and rollout boundaries | | [Query implementation plans](plans/README.md) | Ordered, independently executable query-quality work plans | diff --git a/docs/assets/screenshots/architecture-graph-compass-narrow.png b/docs/assets/screenshots/architecture-graph-compass-narrow.png new file mode 100644 index 00000000..38f23315 Binary files /dev/null and b/docs/assets/screenshots/architecture-graph-compass-narrow.png differ diff --git a/docs/assets/screenshots/architecture-graph-compass-wide.png b/docs/assets/screenshots/architecture-graph-compass-wide.png new file mode 100644 index 00000000..326739a6 Binary files /dev/null and b/docs/assets/screenshots/architecture-graph-compass-wide.png differ diff --git a/docs/cookbook/architecture-discovery.md b/docs/cookbook/architecture-discovery.md index 2321d2eb..a35dd7a6 100644 --- a/docs/cookbook/architecture-discovery.md +++ b/docs/cookbook/architecture-discovery.md @@ -3,6 +3,25 @@ These recipes help map a subsystem, request flow, data flow, or boundary in an unfamiliar repository. +## Start with the architecture projection + +```bash +compass export callflow-html --output compass-out/architecture.html +``` + +Begin in Production with the Architecture lens. Treat owner cards as bounded +navigation, then drill into leaf subsystems. Switch to Execution for exact call +flow, Dependency for import/use coupling, Type for implementation structure, +or Structure for containment. The header reports architecture quality +separately from extraction completion. If the overview is bounded, use Browse +all groups or search; omitted groups are retained and are never represented by +a synthetic `Other` subsystem. + +Before relying on a boundary, inspect its name provenance, source-scope counts, +relationship evidence, and any quality diagnostic. All code is an audit scope: +it restores tests, generated sources, vendor code, documentation, and unknown-source records +without allowing them to reshape the Production projection. + ## Recipe 1: map one subsystem ### Problem diff --git a/docs/implementation/architecture-graph-hardening-phased-technical-design.md b/docs/implementation/architecture-graph-hardening-phased-technical-design.md new file mode 100644 index 00000000..596ef16f --- /dev/null +++ b/docs/implementation/architecture-graph-hardening-phased-technical-design.md @@ -0,0 +1,1113 @@ +# Architecture graph hardening phased technical design + +Status: implemented and qualified on 2026-08-23; see the +[qualification report](architecture-graph-hardening-qualification.md) + +Scope: project-specific architecture projection, architecture-view contracts, +and shared viewer presentation + +Supersedes: the section-derivation, edge-counting, and `Other` overflow parts of +[VS Code Architecture Flow Design](../superpowers/specs/2026-07-28-vscode-architecture-flow-design.md) + +Preserves: that design's bounded CLI export, extension-host indexing, paged +host/webview messages, local SVG rendering, accessibility, and cancellation +model + +## Overview + +Compass should present architecture derived from the project's source evidence, +ownership, and relationships. It should not translate arbitrary repositories +into a fixed catalog of product archetypes, accept repeated low-information +labels, or represent every omitted community as one connected `Other` +subsystem. + +The baseline architecture path had four independent correctness problems: + +1. sections are selected and named from the complete graph before the viewer's + Production filter is applied; +2. source scope relies primarily on path strings and misses tracked generated + bundles that do not live under conventional build directories; +3. every graph relationship is counted and rendered as a call, including + containment and broad references; and +4. a flat top-N community list turns every omitted community into one false + `Other` subsystem. + +Replacing predefined archetype names with community labels is a useful tactical +correction, but it cannot solve these deeper issues. Repeated labels such as +`Crates Compass Output` and a dominant `Other` node are expected while grouping, +source scope, relationship semantics, and naming quality remain shallow and +distributed across Rust and TypeScript callers. + +This design deepens one architecture projection module in `compass-output`: + +```text +validated compass.graph/1 + communities + labels + optional overlay + | + v + architecture_projection + source evidence | relation policy | hierarchy + ranking | naming | stable identity | quality + | + v + compass.viewer.architecture/1 + | + +------------+-------------+ + | | + v v + standalone workbench VS Code host index + | | + +------------+-------------+ + v + shared React architecture view +``` + +The module has a small interface and a large implementation, providing leverage +to every renderer and locality for future architecture-quality fixes. Deleting +it would force source classification, relationship interpretation, grouping, +naming, omissions, and quality logic back into every caller; it therefore +passes the deletion test. + +## Graphify findings and Compass position + +Graphify is research input, not a compatibility oracle. Its current call-flow +renderer uses predefined section archetypes and an `Other` overflow bucket, so +Compass must not copy that presentation behavior. Useful Graphify ideas live in +its clustering and edge-selection implementation: + +- seeded Leiden/Louvain-style community detection; +- optional hub exclusion and deterministic reattachment; +- oversized and low-cohesion community splitting; +- stable ordering and membership-signature-protected labels; and +- preference for calls, uses, methods, and imports over structural edges. + +Compass already implements deterministic Louvain clustering, hub exclusion, +oversized and low-cohesion splitting, stable community remapping, source-aware +hub labels, and community membership signatures in `compass-graph`. The plan +reuses and deepens those native implementations. It adds no Graphify runtime, +test, configuration, artifact, repository, or fallback dependency. + +Primary research references: + +- [Graphify architecture](https://github.com/Graphify-Labs/graphify/blob/v8/ARCHITECTURE.md) +- [Graphify call-flow implementation](https://raw.githubusercontent.com/Graphify-Labs/graphify/v8/graphify/callflow_html.py) +- [Graphify clustering implementation](https://raw.githubusercontent.com/Graphify-Labs/graphify/v8/graphify/cluster.py) +- [Graphify source detection](https://raw.githubusercontent.com/Graphify-Labs/graphify/v8/graphify/detect.py) + +## Goals + +- Derive Production architecture before grouping, naming, ranking, or routing. +- Keep tests, generated code, vendor code, documentation, and unknown-source records reachable + through explicit All-code scope without allowing them to shape Production. +- Give each represented relationship an explicit architecture relation class. +- Stop labeling containment, references, and other structural edges as calls. +- Replace flat top-N plus `Other` with a bounded hierarchical overview and + exact omission metadata. +- Produce deterministic, project-specific, unique subsystem names with evidence + provenance and a quality score. +- Preserve community identity independently from display names. +- Publish architecture quality separately from extraction completion. +- Keep all work local, deterministic, bounded, source-grounded, and portable. +- Use one Rust-owned semantic projection for HTML, workbench JSON, and VS Code. +- Preserve complete search, paging, evidence inspection, and source navigation. + +## Non-goals + +- Change graph extraction, graph node identity, edge identity, direction, + multiplicity, or provenance. +- Replace `compass-graph` clustering with a provider or external library. +- Require model credentials, embeddings, a vector database, or network access. +- Claim that one clustering realization is the only correct architecture. +- Hide tests, generated code, vendor code, documentation, or unknown-source records from the + underlying graph or All-code exploration. +- Render all communities or symbols simultaneously. +- Infer package ownership from the live filesystem when exporting an immutable + historical graph. +- Add an extension-host or React implementation of architecture semantics. +- Treat Graphify agreement as an accuracy measurement. + +## Required invariants + +### Evidence and scope + +- Production grouping sees only nodes classified as Production. +- All-code grouping is derived independently; it is not Production plus one + synthetic remainder group. +- Generated and vendor nodes in the Production projection are always zero. +- Classification retains a reason and never silently converts missing evidence + into Production. +- Historical projection uses evidence inside the selected graph and its + explicit overlay; it never inspects a different current checkout. +- A source-classification limit is an explicit error or degraded diagnostic, + never an empty classification. + +### Relationship meaning + +- Original relation names, direction, multiplicity, confidence, source anchors, + and provenance remain available in detail records. +- The architecture relation class is a presentation projection; it does not + rewrite the graph edge. +- Unknown relation names are retained as `unknown` and excluded from the + default topology until a versioned policy classifies them. +- Structural relationships never contribute to a count labeled `calls`. +- Every admitted relationship is internal, cross-group, or unassigned within + its scope and lens; the three counts sum to the admitted total. + +### Grouping and identity + +- A node belongs to at most one leaf group in one scope realization. +- Group ownership and community membership are deterministic for equivalent + inputs. +- Display labels are not identity. +- No renderer creates a connected `Other` group. +- Omitted groups and routes retain exact represented and omitted counts. +- Group and route ordering is explicit and stable. +- An explicit project overlay cannot overlap selectors silently. + +### Boundedness and failure + +- Overview groups, routes, candidates per name, representative members, and + diagnostics all have hard limits. +- Truncation retains required/shown/omitted counts and the active limit. +- Invalid configuration, unknown contract majors, duplicate explicit IDs, and + overlapping ownership fail before publication. +- Projection either publishes one coherent validated model or no model. + +## Ownership and module depth + +| Module | Interface ownership | Implementation hidden behind the seam | +| --- | --- | --- | +| `compass-files` | generated-source evidence used in `FileRecord.generated` | bounded marker reads, deterministic path rules, admitted VCS metadata | +| `compass-graph` | communities, cohesion, connectivity, stable remapping, member signatures | topology construction and clustering implementation | +| `compass-output::architecture_projection` | one validated architecture projection interface | source scope, relation classes, ownership hierarchy, ranking, naming, IDs, omissions, diagnostics | +| `compass-cli` | arguments, streams, exits, capability advertisement | thin adapter to `compass-output` | +| shared viewer | typed architecture rendering and interaction | map layout, filters, inspector, accessibility | +| VS Code host | bounded retained index and paging | process capture, validation, request identity, pages | + +`compass-output::architecture_projection` is the new deep module. The viewer +must not repeat relation classification, source classification, group naming, +or omission policy. The VS Code host may filter, aggregate, index, sort, and +page typed fields already supplied by Compass, but it must not infer new +architecture meaning. + +## Selected module interface + +The external Rust seam has one projection operation: + +```rust +pub struct ArchitectureProjectionInput<'a> { + pub document: &'a GraphDocument, + pub communities: &'a Communities, + pub community_labels: Option<&'a BTreeMap>, + pub overlay: Option<&'a ArchitectureOverlay>, + pub project_name: &'a str, +} + +pub struct ArchitectureProjectionOptions { + pub scopes: BTreeSet, + pub default_lens: ArchitectureLens, + pub limits: ArchitectureProjectionLimits, +} + +pub fn project_architecture( + input: ArchitectureProjectionInput<'_>, + options: &ArchitectureProjectionOptions, +) -> Result; +``` + +The interface invariants are: + +- inputs are already validated Compass graph and community records; +- `scopes` must contain Production and may contain All-code; +- limits are checked before large reservations and during candidate generation; +- output is canonically ordered and self-validating; +- errors distinguish invalid inputs, invalid overlay, exceeded limits, missing + production evidence, and internal invariant violations; and +- optional provider labels arrive only through `community_labels`; the module + never contacts a provider. + +Internal seams are private implementation details. Introduce an adapter only +when two implementations exist. Source rules, relation policy, naming, and +ranking begin as closed deterministic tables/functions rather than trait +families with one hypothetical adapter. + +## Projection pipeline + +```text +1. Index graph evidence + node ID -> node + normalized source path -> FileRecord + node ID -> community + edge endpoints -> validated nodes + +2. Classify node source scope + explicit overlay -> graph generated evidence -> conservative path evidence + -> production/unknown + +3. Build independent scope realizations + Production + All code + +4. Classify relationships + execution | dependency | type | structure | contextual | unknown + +5. Resolve hierarchy and leaf groups + explicit owner -> source-backed package/module owner -> path owner + -> graph community + +6. Rank groups and routes + represented production members + cross-group signal + connectivity + cohesion + +7. Generate and validate display names + overlay -> signature-valid persisted label -> owner -> path -> declarations + -> hub fallback + +8. Apply overview bounds + selected groups/routes + exact omission metadata; never `Other` + +9. Compute quality and validate invariants + +10. Canonically encode the architecture model +``` + +## Source-scope evidence + +### Classification inputs + +Classification uses only deterministic evidence available in the graph or +explicit overlay: + +1. an explicit project overlay scoped to a normalized path or package; +2. `GraphMetadata.files[*].generated` for the node's source path; +3. admitted generated-source evidence produced during discovery; +4. conventional vendor and third-party path segments; +5. conventional test directories and filename forms; +6. conventional generated/build path segments and generated filename forms; +7. a non-empty recognized source path; or +8. missing/unsupported source evidence. + +Each decision records a stable reason such as `overlay`, `graph_generated`, +`vendor_path`, `test_path`, `generated_path`, `source_path`, or +`missing_source`. + +The current 2,048-byte generated-marker scan in `compass-core` remains useful +but insufficient. `compass-files` should deepen generated evidence by admitting +bounded, deterministic project metadata such as recognized generated markers +and VCS-generated attributes. Content-shape guesses such as “long line means +generated” are not admitted because they can misclassify legitimate sources. +Minified suffixes may be admitted only through an explicit, documented filename +rule with negative fixtures. + +### Precedence + +Explicit overlay has highest precedence. Vendor evidence precedes test or +generated subpaths inside vendored trees because the code's project ownership +is vendor. Generated evidence precedes test evidence for generated test +fixtures. A missing path is Unknown, not Production. + +The Production realization includes only Production. All-code retains every +scope and exposes exact counts for Production, Test, Generated, Vendor, +Documentation, and Unknown. + +## Architecture relationship policy + +The projection retains every original relationship and assigns one closed +class: + +| Class | Intended meaning | Default overview | +| --- | --- | --- | +| `execution` | runtime invocation, routing, handling, mounting, data production/consumption | included | +| `dependency` | imports, exports, declared dependencies, configuration dependencies | included | +| `type` | extends, implements, overrides, type/return/instantiation relationships | optional lens | +| `structure` | contains, declares, ownership, documentation structure | excluded | +| `contextual` | tests, documents, aliases, broad references, derivation | excluded | +| `unknown` | relation not admitted by the current policy | excluded and diagnosed | + +Before implementation, Phase 0 freezes the complete relation vocabulary from +the public graph model and assigns every known relation in one reviewable table. +The default Architecture lens combines execution and dependency while retaining +their individual counts. Separate Execution, Dependency, Type, and Structure +lenses remain available. + +User-facing terminology changes from `calls` to `relationships` except inside +the Execution lens, where exact `calls` records may still be labeled calls. +Route thickness uses a capped deterministic scale over admitted relationship +count. The inspector shows the relation-class mix and the original relation +names behind a route. + +## Hierarchical architecture and omission + +### Depth model + +The overview has at most two visible group depths: + +```text +project/workspace + owner group: crate, package, module root, or top-level source owner + leaf group: one or more graph communities +``` + +Ownership evidence is selected in this order: + +1. explicit overlay ownership; +2. source-backed package/workspace/module nodes and their exact ownership or + containment relationships; +3. a dominant normalized source prefix after generic segments such as `src`, + `lib`, `crates`, and `packages` are removed from display candidates; and +4. graph community as the leaf fallback. + +Communities remain the topology implementation. The hierarchy is a +presentation projection and does not rewrite community assignments. + +### Ranking + +Raw member count is not sufficient. Group ranking uses an explicit tuple: + +1. descending represented Production nodes; +2. descending admitted cross-group relationship count; +3. descending distinct neighboring groups; +4. descending cohesion/connectivity score; +5. stable group ID. + +Generated, Test, Vendor, and Unknown counts do not increase Production rank. +All-code ranking uses the same tuple within its realization and discloses scope +composition. + +### Removing `Other` + +When overview limits are reached, omitted groups are not merged. The model +publishes: + +- total, shown, and omitted group counts; +- represented and omitted node counts by source scope; +- represented and omitted relationships by class; +- strongest omitted group names/IDs up to a separate bounded witness limit; +- routes omitted because one or both endpoint groups are not shown; and +- the exact limits that caused omission. + +Every omitted group remains reachable through the directory, search, or +focused drill-down. No route may target an omission summary. + +## Naming and stable identity + +### Identity + +Automatic group IDs use stable owner identity plus graph community identity, +not display text. Existing `remap_communities_to_previous` continuity is +preserved. Explicit overlay groups use validated project-owned IDs. A display +name change never changes selection, saved layout, route identity, or history +matching. + +### Candidate order + +The naming implementation generates bounded candidates in this order: + +1. explicit overlay name; +2. persisted label whose membership signature matches; +3. source-backed package, crate, or module owner; +4. dominant meaningful relative source prefix; +5. representative declarations selected by connectivity and semantic kind; +6. deterministic community hub label with source context; and +7. transparent fallback `Unnamed subsystem · `. + +Provider labels are optional persisted labels. They may rename a fixed member +set but never select members, source scope, relation class, hierarchy, or rank. +Their provenance is `provider` and their membership signature is mandatory. + +### Quality gate + +A candidate is rejected when it is empty, generic, dominated by repository +scaffolding words, minified/low-entropy, an opaque ID, misleadingly identical to +another group, or unsupported by the group's source evidence. Generic tokens +include language-neutral scaffolding such as `src`, `lib`, `crates`, `packages`, +`module`, `index`, `main`, and the project name when it adds no distinction. + +Duplicate candidates are disambiguated with owner/path evidence before a +community identifier is used. Every accepted name publishes: + +- display value; +- provenance: `overlay`, `persisted`, `owner`, `path`, `declaration`, `hub`, + `provider`, or `fallback`; +- membership signature; +- bounded supporting evidence; and +- deterministic quality score and rejection diagnostics. + +## Architecture quality contract + +Extraction completion and architecture quality are separate facts. The header +may show both, for example: + +```text +Extraction: complete Architecture projection: degraded +``` + +The architecture model publishes: + +```rust +pub enum ArchitectureQualityStatus { + Good, + Degraded, + Insufficient, +} + +pub struct ArchitectureQuality { + pub status: ArchitectureQualityStatus, + pub metrics: ArchitectureQualityMetrics, + pub diagnostics: Vec, +} +``` + +Required metrics include: + +- source-scoped node counts and Unknown fraction; +- generated/vendor leakage into Production, which must be zero; +- represented and omitted node/relationship fractions; +- duplicate and fallback label counts; +- largest leaf-group share; +- admitted relationship counts by class; +- unknown relation count; +- unassigned node and relationship counts; and +- group identity/name churn when a previous realization is available. + +`Insufficient` means no source-grounded Production projection can be formed. +`Degraded` means the projection exists but violates a calibrated quality gate +or has material omissions. `Good` means all hard invariants pass and calibrated +coverage gates pass. Phase 0 records real-repository distributions before +numeric thresholds are frozen; thresholds then become named versioned policy +constants with tests, not UI magic numbers. + +Diagnostics have stable codes, severity, observed value, threshold when +applicable, exact witnesses, and one recommended action. Examples include +`generated_scope_leak`, `unknown_source_share`, `duplicate_group_name`, +`dominant_group`, `overview_omission`, `unknown_relation`, and +`unassigned_relationship`. + +## Machine contract + +The semantic change is not additive to `compass.viewer.callflow/1`. Counts no +longer mean every graph edge is a call, scope realizations are independent, and +flat sections become hierarchical groups. The rollout introduces: + +```text +compass.viewer.architecture/1 +``` + +The top-level shape contains: + +```text +schema +title +nodes[] full bounded detail inventory, each with source scope +relationships[] original relation + architecture class + evidence +projections[] Production and optional All-code realizations + scope + groups[] stable ID, parent, name evidence, rank, counts + routes[] endpoint IDs and relation-class/evidence counts + omissions + quality +statistics +provenance +limits +``` + +Nodes and relationships are stored once. Scope realizations reference stable +IDs and publish summaries; this avoids duplicating complete detail arrays. +Consumer schemas reject unknown majors and dangling group, node, route, or +parent references. + +`compass export callflow-json` remains a compatibility-sensitive command. At +the coordinated cutover it emits the architecture contract and advertises it +through capabilities; the CLI help explains the new schema. A clearer +`architecture-json` alias may be considered separately, but command renaming is +not required for this design and must not delay correctness. + +The outer `compass.viewer.workbench/1` contract remains unchanged only if its +architecture content is explicitly schema-tagged and opaque at that seam. Phase +4 audits strict consumers; if they validate the nested call-flow shape as part +of the outer contract, the workbench major changes in the same coordinated +cutover. + +## Optional project architecture overlay + +Automatic projection remains the zero-configuration default. The existing +`--sections ` adapter is deepened after automatic quality is shipped into +a versioned architecture overlay that can: + +- assign stable owner/group IDs by exact package, normalized path, or community; +- supply project vocabulary for names; +- combine or split selected automatic groups within declared bounds; +- classify explicit generated/vendor/test paths; and +- pin overview visibility without inventing relationships. + +Precedence is explicit CLI overlay, project `.compass` overlay, then automatic +projection. Selectors must be deterministic, non-overlapping, and complete +within each explicit group. Invalid selectors, duplicate IDs, ambiguous +packages, and overlaps fail with source-located diagnostics. + +The first overlay version does not execute user code, glob outside the project, +or select nodes by free-form query. It cannot alter graph edges, confidence, +provenance, or source anchors. + +## Presentation behavior + +- Production remains the initial scope. +- Architecture and Extraction statuses are visually separate. +- The default lens is Architecture, combining execution and dependency. +- The toolbar offers Execution, Dependency, Type, Structure, and All relations. +- Overview labels show project-specific names and optional owner context. +- Omitted coverage appears as disclosure text and a directory action, never a + map node. +- Selecting an owner drills into its leaf groups; Back restores the already + loaded overview. +- Route labels and counts use `relationships` unless the active lens is exact + calls. +- The inspector shows relation mix, source-scope composition, name provenance, + quality diagnostics, and bounded supporting evidence. +- Generated, Vendor, Test, Documentation, and Unknown remain visible in All-code scope and + search. +- Accessible table alternatives expose the same hierarchy, routes, omissions, + and diagnostics as the map. + +## Failure behavior + +| Condition | Result | +| --- | --- | +| empty graph | existing explicit empty-graph error | +| no Production nodes | publish All-code only if requested; Production quality is Insufficient | +| missing file inventory | classify from conservative node evidence; quality is Degraded with exact count | +| generated evidence conflict | explicit overlay wins; otherwise exclude from Production and diagnose | +| unknown relation | retain detail, exclude from default topology, diagnose | +| invalid overlay | fail before model publication | +| hierarchy limit exceeded | publish bounded groups plus exact omissions | +| naming candidate limit exceeded | use deterministic fallback and diagnose; never loop unboundedly | +| dangling endpoint/group reference | fail validation and publish no model | +| unsupported contract major | consumer rejects with upgrade guidance | + +## Compatibility and migration + +This is a coordinated machine-contract cutover, not a silent reinterpretation +of `compass.viewer.callflow/1`. + +The cutover phase must include: + +1. native Rust contract tests; +2. TypeScript runtime schema and fixture updates; +3. CLI capability and compatibility updates; +4. VS Code minimum-version/capability handling; +5. reference documentation updates; +6. a `MIGRATION.md` entry for direct call-flow JSON consumers; and +7. a release-visible `CHANGELOG.md` entry. + +No graph artifact migration is required because architecture is derived from +the existing graph. Historical graphs remain immutable. Regenerating the +architecture projection with a newer binary may change grouping, names, and +quality diagnostics; the selected graph's node and edge identities remain +unchanged. + +## Phased delivery plan + +Each phase is independently reviewable and stops when its acceptance criteria +fail. Early phases build and characterize the deep module without changing the +public contract. Phase 4 is the coordinated contract cutover. Later phases are +additive to the new architecture contract. + +| Phase | Shippable result | Depends on | Public effect | +| --- | --- | --- | --- | +| 0 | reproducible quality baseline and regression corpus | none | none | +| 1 | private source-correct projection module | 0 | generated evidence may improve graph inventory | +| 2 | private typed relationship topology | 1 | none | +| 3 | complete private hierarchy, naming, omissions, and quality model | 2 | none | +| 4 | coordinated architecture contract cutover | 3 | machine contract and consumer migration | +| 5 | hierarchical map and quality UX | 4 | user-visible architecture experience | +| 6 | optional project overlay and qualification evidence | 5 | additive configuration and documentation | + +Every production commit includes its lowest-seam regression tests. Keep policy +changes separate from mechanical moves, and keep generated viewer assets in the +same commit as the source change that produced them. + +### Phase 0: Freeze current behavior and quality baselines + +Purpose: make the screenshot failure reproducible before moving ownership. + +Deliverables: + +- Add graph fixtures for repeated path-token labels, one tracked generated + bundle, vendor/test communities, containment-dominated topology, thousands of + thin communities, and duplicate community labels. +- Add a real-repository qualification snapshot for Compass itself, including + exact node/edge/community/source-scope distributions. +- Record the complete public relationship vocabulary and proposed relation + class in a reviewable test table. +- Add characterization tests for current `Other` size, duplicate names, + generated leakage, all-edge-as-call counts, and ordering. +- Define the quality metric formulas and capture baseline values without yet + enforcing numeric status thresholds. + +Primary files: + +- `crates/compass-output/tests/callflow_model.rs` +- new `crates/compass-output/tests/architecture_projection_fixtures.rs` +- `tests/viewer/` +- `scripts/qualify_code_graph_v1.sh` or a focused architecture-quality runner +- reviewable fixtures under `fixtures/` + +Acceptance: + +- The current Compass reproduction fails at least the generated-leakage, + duplicate-label, dominant-group, and relation-semantics checks. +- Fixture permutations produce identical recorded ordering and metrics. +- No production behavior or public schema changes. + +Suggested commit sequence: + +1. Add synthetic failure fixtures and current-behavior characterization. +2. Add metric formulas and deterministic permutation tests. +3. Add the pinned Compass qualification case and baseline record. + +Verification: + +```bash +CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-3058 \ + cargo test -p compass-output --locked +npm run test:js +CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-3058 \ + ./scripts/qualify_code_graph_v1.sh --fixtures-only +``` + +Rollback: test and fixture commits are independently revertible. Do not proceed +if the reproduction cannot distinguish tactical naming improvements from the +deeper failure. + +### Phase 1: Deepen source evidence and projection ownership + +Purpose: create the architecture projection seam and ensure Production is an +input to grouping rather than a UI filter. + +Deliverables: + +- Create `crates/compass-output/src/architecture_projection/` with the selected + input, options, limits, error, scope, and internal evidence index. +- Add deterministic node-to-file and node-to-community indexes with explicit + duplicate/missing diagnostics. +- Move source-scope classification out of `callflow_model.rs` into the new + module and retain classification reason. +- Deepen generated-source evidence in `compass-files`/`compass-core`, including + bounded admitted VCS metadata and negative fixtures. +- Build independent Production and All-code node realizations. +- Run the new projection side-by-side in tests without publishing it publicly. + +Primary files: + +- new `crates/compass-output/src/architecture_projection/{mod.rs,scope.rs,index.rs,error.rs}` +- `crates/compass-output/src/lib.rs` +- generated evidence owner in `crates/compass-files` +- `crates/compass-core/src/pipeline.rs` +- `crates/compass-output/tests/architecture_projection_fixtures.rs` + +Acceptance: + +- Generated and Vendor leakage into Production is zero for every fixture. +- All-code retains every node and exact counts for every source scope. +- Missing source remains Unknown. +- The tracked generated-bundle reproduction no longer affects Production + membership or candidate names. +- Classification is deterministic across path separator and input-order + permutations. + +Suggested commit sequence: + +1. Deepen generated-file evidence with positive and negative fixtures. +2. Add the private projection module, bounded indexes, and error model. +3. Move source classification behind the seam and build both scope realizations. + +Verification: + +```bash +CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-3058 \ + cargo test -p compass-files -p compass-core -p compass-output --locked +CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-3058 \ + cargo clippy -p compass-files -p compass-core -p compass-output \ + --all-targets --all-features --locked -- -D warnings +``` + +Rollback: the side-by-side module can be removed without changing the existing +export. Generated-evidence changes remain only if their independent graph +contract tests pass. + +### Phase 2: Classify relationships and make counts honest + +Purpose: give architecture routes one semantic owner and stop presenting every +edge as a call. + +Deliverables: + +- Add the closed architecture relation policy and complete relation table. +- Classify every graph relationship into execution, dependency, type, + structure, contextual, or unknown. +- Build per-scope internal, cross-group, and unassigned coverage by class. +- Preserve original relations and evidence on every detail relationship. +- Add deterministic route aggregation and relation-mix summaries. +- Add quality diagnostics for unknown and unassigned relationships. + +Primary files: + +- new `crates/compass-output/src/architecture_projection/relation.rs` +- new `crates/compass-output/src/architecture_projection/routes.rs` +- `crates/compass-output/tests/architecture_projection_fixtures.rs` +- public relation reference tests in the lowest owning crate + +Acceptance: + +- `contains` and `references` do not contribute to default Architecture route + counts. +- Execution lens exact-call counts equal exact admitted `calls` edges. +- For every scope/lens, internal + cross-group + unassigned equals admitted. +- Unknown relation names are retained, bounded, and disclosed. +- Edge direction, multiplicity, confidence, and provenance are unchanged. + +Suggested commit sequence: + +1. Freeze and implement the complete relation-class table. +2. Add per-scope/lens coverage and route aggregation. +3. Add unknown/unassigned diagnostics and invariant tests. + +Verification: + +```bash +CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-3058 \ + cargo test -p compass-output --locked +CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-3058 \ + cargo test -p compass-model --locked +``` + +Rollback: revert the relation-policy slice; source projection remains useful +and unexposed until the coordinated cutover. + +### Phase 3: Add hierarchy, ranking, naming, identity, and quality + +Purpose: complete the internal architecture model and eliminate the need for +flat top-N plus `Other`. + +Deliverables: + +- Resolve source-backed owners and leaf community groups. +- Reuse `compass-graph` cohesion, connectivity, stable remapping, and membership + signatures rather than duplicating clustering. +- Implement the ranked overview and exact omission records. +- Implement bounded multi-signal naming and duplicate/generic/minified rejection. +- Separate stable IDs from names and persist naming provenance/signatures. +- Implement quality metrics, diagnostics, and calibrated status thresholds. +- Prove no route references an omission summary. + +Primary files: + +- new `crates/compass-output/src/architecture_projection/{hierarchy.rs,rank.rs,names.rs,quality.rs,model.rs}` +- `crates/compass-graph/src/cluster.rs` only for reusable topology helpers that + are genuinely owned there +- `crates/compass-core/src/cluster_existing.rs` +- `crates/compass-semantic/src/community_labels.rs` +- architecture projection tests and qualification fixtures + +Acceptance: + +- No automatic group is named `Other`. +- Every omitted group is reachable by stable ID through directory/search data. +- Duplicate display names are zero after evidence-based disambiguation. +- The Compass fixture produces multiple project-specific owner/subsystem names + and no repeated `Crates Compass Output` labels. +- Provider-free runs are byte deterministic. +- Provider labels with stale membership signatures are rejected. +- Quality status matches the named calibrated gates and includes exact witnesses. + +Suggested commit sequence: + +1. Add owner hierarchy, stable IDs, ranking, and omission records. +2. Add deterministic candidate naming and evidence-based quality gates. +3. Integrate signature-valid persisted/provider labels. +4. Calibrate and freeze quality status thresholds on the Phase 0 corpora. + +Verification: + +```bash +CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-3058 \ + cargo test -p compass-graph -p compass-output -p compass-core \ + -p compass-semantic --locked +CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-3058 \ + ./scripts/qualify_code_graph_v1.sh --fixtures-only +``` + +Rollback: ranking, naming, and quality commits remain separate behind the +unpublished module. Revert a policy slice rather than adding caller-side +exceptions. + +### Phase 4: Publish the architecture contract and cut over consumers + +Purpose: ship the correct semantic model atomically across Rust, CLI, +workbench, VS Code, and the shared viewer. + +Deliverables: + +- Publish strict Rust serialization and validation for + `compass.viewer.architecture/1`. +- Update `callflow-json`, `callflow-html`, capability reporting, workbench view + embedding, and CLI contract tests. +- Add matching TypeScript runtime schemas and malicious/oversized fixture tests. +- Replace TypeScript `callflowOverview` semantic derivation with filtering and + aggregation over Rust-classified scopes, groups, and relations. +- Update the VS Code retained architecture index and paged message contracts. +- Coordinate minimum CLI compatibility and unknown-major rejection. +- Update reference docs, `COMPATIBILITY.md` if required, `MIGRATION.md`, and + `CHANGELOG.md`. +- Rebuild and verify generated viewer assets from `packages/compass-viewer`. + +Primary files: + +- `crates/compass-output/src/{lib.rs,callflow.rs,callflow_model.rs,workbench.rs}` +- `crates/compass-cli/src/{lib.rs,capability_commands.rs,help.rs}` +- `crates/compass-cli/tests/viewer_export_cli.rs` +- `packages/compass-viewer/src/contracts/` +- `packages/compass-viewer/src/workbench/VisualizationWorkbench.tsx` +- `editors/vscode/src/views/{architectureIndex.ts,architecturePanel.ts}` +- `editors/vscode/src/transport/architectureMessages.ts` +- compatibility and reference documents + +Acceptance: + +- All consumers accept only the new known architecture major. +- Production grouping/naming is identical in standalone HTML and VS Code. +- All-code restores all scoped nodes without regrouping Production in the UI. +- User-visible counts say relationships except for exact-call views. +- No full model crosses the VS Code host/webview seam. +- Existing 8 MiB/128 MiB process limits and bounded page sizes remain unchanged. +- Old direct JSON consumers receive documented upgrade guidance rather than a + silently reinterpreted v1 payload. + +Suggested commit sequence: + +1. Publish and validate the Rust architecture contract and CLI serialization. +2. Add TypeScript runtime schemas and update capability compatibility. +3. Cut over VS Code indexing/messages and shared workbench consumption. +4. Update docs, migration/release notes, and generated viewer assets. + +Verification: + +```bash +CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-3058 \ + cargo test -p compass-output -p compass-cli --locked +npm run typecheck:js +npm run test:js +node scripts/build_viewer_assets.mjs +node scripts/check_viewer_assets.mjs +sh scripts/check_product_boundary.sh +``` + +Rollback: the contract cutover is one coordinated release slice. Revert the +whole slice before release; do not emit v1 with v2 semantics. + +### Phase 5: Deliver hierarchical interaction and quality UX + +Purpose: make the new model legible and actionable rather than merely correct. + +Deliverables: + +- Render owner overview and leaf-group drill-down with deterministic layout. +- Remove all special layout treatment for an `other` ID. +- Add Architecture, Execution, Dependency, Type, and Structure lenses. +- Show separate Extraction and Architecture quality statuses. +- Add omission disclosure, directory navigation, name provenance, and quality + diagnostic actions. +- Update inspector terminology and accessible table alternatives. +- Capture approved wide, narrow, light, dark, and high-contrast screenshots. + +Primary files: + +- `packages/compass-viewer/src/architecture/` +- `packages/compass-viewer/src/workbench/VisualizationWorkbench.tsx` +- `packages/compass-viewer/src/theme.css` +- `editors/vscode/src/webviews/architecture.tsx` +- `tests/viewer/` +- `docs/assets/screenshots/` + +Acceptance: + +- No rendered node or route uses `Other` as an omission device. +- The initial Compass view is project-specific and not dominated by generated + viewer assets. +- Every shown metric has a clear denominator or scope. +- Keyboard, reduced-motion, high-contrast, and narrow layouts expose the same + information. +- Search and directory navigation reach a group omitted from the map. +- Screenshot review shows no repeated generic labels and no false mega-hub. + +Suggested commit sequence: + +1. Render owner/leaf navigation and remove `other` layout behavior. +2. Add relation lenses, omission disclosure, and architecture-quality status. +3. Complete inspector, accessible table, responsive, and screenshot evidence. + +Verification: + +```bash +npm run typecheck:js +npm run test:js +node scripts/check_viewer_assets.mjs +# Run the focused Chromium viewer suite under tests/viewer. +``` + +Rollback: React presentation commits are independently revertible while the +new contract remains inspectable through JSON and tables. + +### Phase 6: Add project overlay and real-repository qualification + +Purpose: let projects own domain language where automatic evidence is +insufficient and prove the default remains robust without configuration. + +Deliverables: + +- Define and validate the first architecture overlay schema. +- Adapt existing `--sections` input with explicit deprecation/migration rules. +- Add optional `.compass` configuration and documented precedence. +- Add Cargo workspace, npm monorepo, mixed-language, generated-heavy, vendor- + heavy, test-heavy, single-package, and sparse-relationship qualification + corpora. +- Measure quality status, stability, runtime, peak RSS, and output size. +- Publish before/after screenshots and exact qualification evidence. + +Primary files: + +- overlay model/loader in the lowest owning Compass crate +- `compass-output::architecture_projection` +- CLI parsing/help/tests +- `docs/reference/configuration.md` +- `docs/reference/commands.md` +- `docs/reference/outputs.md` +- qualification scripts and reviewable fixture expectations + +Acceptance: + +- Zero-configuration fixtures meet the calibrated quality gates. +- An overlay can improve vocabulary without changing graph edges or identities. +- Invalid/overlapping overlays fail with source-located diagnostics. +- Equivalent repeated runs are byte deterministic. +- Small edits preserve unaffected group IDs and report bounded identity/name + churn. +- Runtime, memory, and payload remain within thresholds recorded before this + phase; no performance claim is published without those measurements. + +Suggested commit sequence: + +1. Add the strict overlay schema, selectors, and validation. +2. Add CLI/project configuration adapters and migration documentation. +3. Add external corpora, performance replay, and published qualification evidence. + +Verification: + +```bash +CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-3058 \ + cargo fmt --all -- --check +CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-3058 \ + cargo clippy --workspace --lib --bins --locked -- -D warnings +CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-3058 \ + cargo test --workspace --lib --bins --locked +npm run typecheck:js +npm run test:js +node scripts/check_viewer_assets.mjs +CARGO_TARGET_DIR=/Volumes/Workspace/crabbuild-target/compass-3058 \ + ./scripts/qualify_code_graph_v1.sh --fixtures-only +sh scripts/check_product_boundary.sh +``` + +Rollback: overlay support is optional and can be reverted independently. Do not +relax automatic quality gates to make one overlay fixture pass. + +## Cross-phase test matrix + +| Risk | Lowest test seam | Contract/integration evidence | +| --- | --- | --- | +| generated leakage | source classifier and graph file inventory | Compass generated viewer bundle fixture | +| path portability | normalized source-scope tests | Windows separator export fixture | +| relation mislabeling | relation policy table | viewer count/terminology test | +| direction/multiplicity loss | route aggregation unit tests | CLI JSON round-trip | +| false `Other` subsystem | hierarchy/omission tests | browser screenshot and route inspection | +| repeated/generic names | name candidate/gate tests | Compass real-repository snapshot | +| stale provider label | membership-signature tests | cluster-existing round trip | +| unstable IDs/order | permutation and edit tests | repeated byte hashes | +| hidden data | omission sum invariants | search/drill-down browser test | +| misleading quality | quality formula tests | header/status accessibility test | +| oversized model | projection limit tests | 128 MiB host ceiling and bounded pages | +| unsafe overlay | parser/selector negative tests | CLI no-partial-output test | + +## Performance budgets + +Phase 0 records the baseline before numeric budgets are frozen. The initial +design targets are: + +- projection work linear in nodes plus relationships, excluding bounded sorting + of group/route summaries; +- no second complete clone of node or relationship records; +- no renderer-side full-graph semantic recomputation; +- bounded candidate naming per group; +- overview groups and routes capped independently; +- standalone export and VS Code retained model below the existing 128 MiB + architecture ceiling for the existing Django qualification corpus; and +- no unexplained regression greater than 10% in median projection time or peak + RSS on the pinned corpora. + +These are qualification gates, not published product claims. A failure pauses +the phase for diagnosis; it does not justify raising a limit silently. + +## Security and privacy + +- Treat labels, paths, overlays, and graph attributes as untrusted text at every + render seam. +- Keep overlay paths project-contained and normalize separators portably. +- Never execute overlay content or construct shell commands. +- Bound file reads, candidate strings, diagnostics, and serialized output. +- Do not log source-derived labels, paths, or symbols from the VS Code host + beyond existing user-visible diagnostics. +- Optional provider naming remains explicitly configured and receives only the + existing bounded community summary; architecture projection itself is local. +- Reuse atomic write and validation primitives for every output. + +## Documentation updates at completion + +- `docs/reference/outputs.md`: architecture schema, scopes, lenses, omissions, + quality, and naming provenance. +- `docs/reference/commands.md`: call-flow export behavior and overlay options. +- `docs/reference/configuration.md`: optional overlay and precedence. +- `docs/cookbook/architecture-discovery.md`: overview-to-drill-down workflow. +- `COMPATIBILITY.md`: coordinated schema/capability effect when applicable. +- `MIGRATION.md`: direct `compass.viewer.callflow/1` consumer migration. +- `CHANGELOG.md`: release-visible architecture correction. + +Implementation documents describe planned behavior, not shipped evidence. +Reference and cookbook claims must change only in the phase that ships the +corresponding contract. + +## Global definition of done + +The architecture hardening is complete when: + +- Production grouping and naming cannot observe Generated, Vendor, Test, + Documentation, or Unknown nodes; +- every architecture relationship has one deterministic class while preserving + original graph evidence; +- no count called `calls` includes non-call relationships; +- no automatic `Other` node exists; +- omitted groups and routes have exact bounded disclosure and remain reachable; +- names are unique, project-specific, source-grounded, signature-protected, and + independent from identity; +- architecture quality is distinct from extraction completion; +- HTML, workbench JSON, and VS Code use the same Rust-owned projection; +- the new machine contract, migration, and capability behavior are documented + and tested; +- the Compass screenshot regression and representative external corpora pass + the declared quality gates; and +- native Rust, JavaScript, viewer asset, product-boundary, and code-graph + qualification gates pass with no unrelated worktree changes. + +## Delivery record + +Phases 0 through 6 were delivered in order and accepted against Compass's own +150,127-node graph. Exact metrics, screenshots, gate results, and the one +unrelated residual test failure are recorded in the +[architecture graph hardening qualification](architecture-graph-hardening-qualification.md). diff --git a/docs/implementation/architecture-graph-hardening-qualification.md b/docs/implementation/architecture-graph-hardening-qualification.md new file mode 100644 index 00000000..8ad3a95f --- /dev/null +++ b/docs/implementation/architecture-graph-hardening-qualification.md @@ -0,0 +1,124 @@ +# Architecture graph hardening qualification + +This report records the 2026-08-23 acceptance run for the architecture graph +hardening design. It uses Compass's own repository as the large real-world +corpus and the native Compass implementation only. + +## Result + +The architecture projection passed its fail-closed quality gate with schema +`compass.viewer.architecture/1` and status `good`. + +| Measure | Before final hardening | Qualified result | +| --- | ---: | ---: | +| JSON payload | 154,410,683 bytes | 126,697,704 bytes | +| Production symbols | 110,285 | 34,039 | +| Largest Production group | Docs, 65,694 symbols | Viewer, 5,281 symbols | +| Largest-group fraction | 59.57% | 15.51% | +| Production groups retained | 6,547 | 2,651 | +| Fallback names | 0 | 0 | +| Unknown-source fraction | 0 | 0 | +| Quality | degraded | good | + +The payload reduction is lossless: memberships use validated indexes into the +deterministically ordered node and group arrays. No group, symbol, +relationship, drill-down record, or omission count is discarded. + +The key scope correction was making Documentation first-class. All-code keeps +the complete classified inventory: + +| Source scope | Symbols | +| --- | ---: | +| Production | 34,039 | +| Test | 5,843 | +| Generated | 24,384 | +| Vendor | 9,615 | +| Documentation | 76,246 | +| Unknown | 0 | + +Production grouping cannot observe the five non-production scopes. The +qualified Production overview has 15 of 42 owner groups shown, 27 exactly +disclosed as available in the directory, and 29 directed overview routes. The +default Architecture lens exposes 25,481 relationships. No automatic `Other` +group exists. + +## Real-repository run + +The cold native update analyzed 1,428 files and published 150,127 nodes, +244,152 relationships, and 8,086 communities. It completed in 293.25 seconds +with 3,132,129,280 bytes maximum resident set size. The JSON architecture +export completed in 75.23 seconds with 3,256,532,992 bytes maximum resident set +size. The bounded payload limit is 128 MiB; the qualified payload is +126,697,704 bytes. + +The update disclosed that the underlying code graph omitted two nodes and +twelve edges. Architecture quality remains a separate signal and does not +reinterpret that extraction diagnostic. + +## User-visible evidence + +Wide standalone export: + +![Compass architecture graph, wide](../assets/screenshots/architecture-graph-compass-wide.png) + +Narrow responsive export: + +![Compass architecture graph, narrow](../assets/screenshots/architecture-graph-compass-narrow.png) + +The live browser acceptance check verified all of the following on the real +150,127-node export: + +- `Extraction complete` is distinct from `Architecture quality: good`; +- project-specific names include Viewer, Vscode, Web, Languages, CLI, Query, + Output, Resolve, Model, Graph, and Core; +- the UI reports `15 of 42 groups shown · 27 available in directory`; +- the subsystem directory contains all 2,651 retained groups; and +- the standalone HTML parses and renders without a contract error. + +## Automated acceptance + +The following gates passed: + +- `cargo fmt --all -- --check`; +- `cargo clippy --workspace --lib --bins --locked -- -D warnings`; +- `cargo test --workspace --lib --bins --locked`; +- `cargo test -p compass-cli --test compass_product --locked`; +- `cargo test -p compass-cli --test viewer_export_cli --locked` (12 tests); +- architecture projection unit and qualification fixtures, including source + isolation, identity stability, deterministic permutations, closed relation + classes, hostile overlays, and explicit limits; +- `./scripts/qualify_code_graph_v1.sh --fixtures-only`, including all scale + ceilings and byte-equivalence checks; +- `sh scripts/check_product_boundary.sh`; +- `npm run typecheck:js`; +- `npm run test:js`: 209 viewer tests, 141 VS Code tests, and 88 Chromium + browser tests; and +- `node scripts/check_viewer_assets.mjs`. + +The independent `scripts/qualify_architecture_graph.py` gate validated payload +size, schema, endpoint integrity, source-scope isolation, closed relation +classes, unique names, absence of `Other`, exact coverage and omission sums, +and quality status. + +One unrelated pre-existing integration test remains red: +`compass-files --test contracts +build_guard_publishes_one_complete_snapshot_at_a_time` expects `graph-one` but +observes `graph-two`. The architecture change does not modify that build-guard +implementation or test. The required workspace lib/bin baseline is green. + +## Acceptance conclusion + +All six phases in the technical design are implemented. The architecture map +is derived from project evidence, source scope is fixed before grouping, +relationship meaning is explicit, omissions remain browsable rather than +invented topology, and quality is measured independently from extraction +completeness. + +## Related pages + +- [Architecture graph hardening technical design](architecture-graph-hardening-phased-technical-design.md) +- [Architecture discovery cookbook](../cookbook/architecture-discovery.md) +- [Output contracts](../reference/outputs.md) + +**Next step:** use this report and its screenshots as the baseline for future +architecture-projection changes. diff --git a/docs/reference/commands.md b/docs/reference/commands.md index 7fc0a288..cd153153 100644 --- a/docs/reference/commands.md +++ b/docs/reference/commands.md @@ -537,6 +537,26 @@ compass export callflow-html --help Common inputs include `--graph PATH`, labels/report/sections, output directory, node/diagram limits, and database connection arguments. +`callflow-json` and `callflow-html` retain their command names for script +compatibility but now publish one Rust-owned architecture projection. JSON is +`compass.viewer.architecture/1`; HTML embeds the same model in the shared +workbench. Production scope is classified before communities are grouped, and +Generated, Vendor, Test, Documentation, and Unknown sources cannot influence +Production names or boundaries. Relationships are classified as Execution, Dependency, Type, +Structure, Contextual, or Unknown. The default Architecture lens admits only +Execution and Dependency relationships. Aggregate metrics remain labeled +relationships because the Execution class also includes handlers, routing, +messaging, and other executable flow; an individual exact `calls` record keeps +its original relation name in the inspector. + +`--max-sections N` bounds overview groups. It does not discard groups or merge +them into `Other`: the model reports exact omissions and retains every group +for search and drill-down. Use `--architecture-overlay PATH` for a strict +`compass.architecture-overlay/1` JSON or TOML file. The canonical current +project discovers `.compass/architecture.toml`; arbitrary and historical graph +paths do not inspect live configuration. `--sections PATH` remains a deprecated +alias and adapts legacy section JSON. + `html`, `json`, and `workbench-json` accept repeatable graph views. Compass preserves their command-line order and puts them in one navigable workbench: diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md index a8a0665d..a16bed71 100644 --- a/docs/reference/configuration.md +++ b/docs/reference/configuration.md @@ -22,6 +22,47 @@ Not every option follows one universal resolver. The command's help and source remain authoritative. In automation, prefer explicit non-secret options and record them. +## Architecture overlay + +Architecture exports work without configuration. When repository-owned domain +vocabulary is more precise than automatic path and declaration evidence, pass +a bounded overlay explicitly: + +```bash +compass export callflow-html \ + --architecture-overlay .compass/architecture.toml +``` + +The first schema is `compass.architecture-overlay/1`. It supports source-scope +rules and named groups selected by normalized path prefixes or numeric +community IDs. IDs and selectors must be unique; empty or overlapping path +prefixes and communities claimed by multiple groups fail before output is +published. Overlay names affect presentation, while stable group identity and +graph relationships remain separate. Source-rule values are `production`, +`test`, `generated`, `vendor`, `documentation`, and `unknown`. + +```toml +schema = "compass.architecture-overlay/1" + +[[sourceRules]] +pathPrefix = "generated/client" +scope = "generated" + +[[groups]] +id = "billing-ledger" +name = "Billing Ledger" +pathPrefixes = ["crates/billing"] +pin = true +``` + +For the canonical current-project artifact +`/compass-out/graph.json`, Compass discovers +`/.compass/architecture.toml`. Arbitrary or historical graph paths do +not inspect a live checkout; pass their matching overlay explicitly with +`--architecture-overlay`. An explicit option always wins. `--sections` is a +deprecated compatibility spelling; legacy JSON sections are converted to +overlay community selectors. + ## Output root Default: diff --git a/docs/reference/outputs.md b/docs/reference/outputs.md index 781c8a87..b823fd89 100644 --- a/docs/reference/outputs.md +++ b/docs/reference/outputs.md @@ -275,6 +275,23 @@ the graph-local community ID. These labels are deterministic navigation aids, not community identity; consumers that need identity should use the community ID and member set instead. +The architecture view is a separate, versioned projection rather than a +presentation alias for raw communities. It classifies Production and All-code +source scopes before grouping, derives project-specific owner and subsystem +names from source paths, declarations, and optional overlays, and keeps names +separate from stable membership-derived IDs. Relation classes and lenses are +explicit in the model. Large graphs remain bounded by an overview whose exact +omission counts link to the searchable group directory; omitted groups are +never merged into a synthetic `Other` subsystem or connected to invented +routes. + +Production excludes Test, Generated, Vendor, Documentation, and Unknown +sources before grouping. All-code retains them with exact counts. Memberships +use validated `nodeIndex` and `groupIndex` references into deterministic arrays +to keep large payloads bounded without discarding drill-down data. Extraction +completeness, overview omissions, and architecture quality are separate +signals. + The Architecture Map and Community Directory omit communities made entirely of Markdown pipe-table parser blocks. Those communities count toward the report's omitted-community coverage and their source-backed nodes remain in @@ -684,7 +701,8 @@ First-party editor and offline-viewer contracts are versioned independently: - `compass.graph-overview/1` — rebuildable prepared graph projection used by editor integrations; - `compass.program.call_graph/1` — bounded symbol-centered caller/callee graph; -- `compass.viewer.callflow/1` — broader subsystem architecture flow; +- `compass.viewer.architecture/1` — source-scoped subsystem architecture with + typed relationships, hierarchy, omissions, and quality diagnostics; - `compass.history.timeline/1` — commit and materialization states; - `compass.history.change_counts/1` — lazy structural counts between existing realizations; diff --git a/editors/vscode/CHANGELOG.md b/editors/vscode/CHANGELOG.md index bc9b0bb9..d78e66de 100644 --- a/editors/vscode/CHANGELOG.md +++ b/editors/vscode/CHANGELOG.md @@ -56,7 +56,7 @@ directional subsystem map and complete paged cross-subsystem call evidence. - Arrange subsystem maps into low-noise call-flow lanes with bundled routes, persistent drag positioning, focus highlighting, and collapsible details. -- Use the complete `compass.viewer.callflow/1` contract exclusively for +- Use the complete `compass.viewer.architecture/1` contract exclusively for negotiation, export validation, production scoping, and complete call evidence. - Load architecture exports up to 128 MiB while keeping ordinary Compass commands at the 8 MiB safety ceiling. diff --git a/editors/vscode/src/cli/compatibility.test.ts b/editors/vscode/src/cli/compatibility.test.ts index 403ae84a..5c818252 100644 --- a/editors/vscode/src/cli/compatibility.test.ts +++ b/editors/vscode/src/cli/compatibility.test.ts @@ -98,7 +98,7 @@ describe("compatibilityIssue", () => { ...compatible, contracts: { ...compatible.contracts, - callflow_viewer: "compass.viewer.callflow/1" + architecture_viewer: "compass.viewer.architecture/1" } }; @@ -108,9 +108,9 @@ describe("compatibilityIssue", () => { ...report, contracts: { ...report.contracts, - callflow_viewer: "compass.viewer.callflow/2" + architecture_viewer: "compass.viewer.architecture/2" } }, undefined, COMPASS_REQUIREMENTS.architecture)) - .toContain("requires 'compass.viewer.callflow/1'"); + .toContain("requires 'compass.viewer.architecture/1'"); }); }); diff --git a/editors/vscode/src/cli/compatibility.ts b/editors/vscode/src/cli/compatibility.ts index 99145854..19969e87 100644 --- a/editors/vscode/src/cli/compatibility.ts +++ b/editors/vscode/src/cli/compatibility.ts @@ -37,7 +37,7 @@ export const COMPASS_REQUIREMENTS = { architecture: { workflow: "open the architecture flow", features: ["graph"], - contracts: { callflow_viewer: "compass.viewer.callflow/1" } + contracts: { architecture_viewer: "compass.viewer.architecture/1" } }, query: { workflow: "query the codebase", diff --git a/editors/vscode/src/cli/runtime.test.ts b/editors/vscode/src/cli/runtime.test.ts index 6b7785da..386b239d 100644 --- a/editors/vscode/src/cli/runtime.test.ts +++ b/editors/vscode/src/cli/runtime.test.ts @@ -12,7 +12,7 @@ const capabilities: CapabilityReport = { progress: "compass.ide.progress/1", graph_viewer: "compass.viewer.graph/1", call_graph: "compass.call_graph/1", - callflow_viewer: "compass.viewer.callflow/1", + architecture_viewer: "compass.viewer.architecture/1", history_timeline: "compass.history.timeline/1", history_change_counts: "compass.history.change_counts/1", history_viewer_graph: "compass.history.viewer_graph/1", diff --git a/editors/vscode/src/test/fake-bin/compass b/editors/vscode/src/test/fake-bin/compass index ebc1943f..57fd01d6 100755 --- a/editors/vscode/src/test/fake-bin/compass +++ b/editors/vscode/src/test/fake-bin/compass @@ -6,7 +6,7 @@ if (command === "capabilities") { compass_version: "0.3.0", contracts: { graph_viewer: "compass.viewer.graph/1", - callflow_viewer: "compass.viewer.callflow/1", + architecture_viewer: "compass.viewer.architecture/1", program_call_graph: "compass.program.call_graph/1", progress: "compass.ide.progress/1", history_timeline: "compass.history.timeline/1", diff --git a/editors/vscode/src/transport/architectureMessages.test.ts b/editors/vscode/src/transport/architectureMessages.test.ts index 0d1134cb..6c5f4263 100644 --- a/editors/vscode/src/transport/architectureMessages.test.ts +++ b/editors/vscode/src/transport/architectureMessages.test.ts @@ -7,17 +7,18 @@ import { describe("architecture messages", () => { it("accepts an identity-bound section request", () => { expect(ArchitectureToHostMessageSchema.parse({ - type: "requestSection", + type: "requestGroup", requestId: "request-1", repositoryId: "/repo", generation: 2, scope: "production", evidence: "all", + lens: "architecture", page: 1, pageSize: 100, - sectionId: "api", - kind: "calls" - })).toMatchObject({ sectionId: "api", generation: 2 }); + groupId: "api", + kind: "relationships" + })).toMatchObject({ groupId: "api", generation: 2 }); }); it("rejects unbounded page sizes", () => { @@ -28,6 +29,7 @@ describe("architecture messages", () => { generation: 2, scope: "all", evidence: "all", + lens: "architecture", page: 1, pageSize: 101, routeId: "api→storage" @@ -44,26 +46,43 @@ describe("architecture messages", () => { title: "Fixture", scope: "production", evidence: "all", - sections: [], + lens: "architecture", + groups: [], routes: [], statistics: { visibleNodes: 2, totalNodes: 4, - visibleCalls: 1, - totalCalls: 3, + visibleRelationships: 1, + totalRelationships: 3, communities: 2, extracted: 2, inferred: 1, ambiguous: 0 }, - coverage: { internal: 1, crossSection: 2, unassigned: 0 }, + coverage: { internal: 1, crossGroup: 2, unassigned: 0 }, + omissions: { + totalGroups: 2, shownGroups: 2, omittedGroups: 0, + representedNodes: 4, omittedNodes: 0, + representedRelationships: 3, omittedRelationships: 0, + witnessGroupIds: [], maxOverviewGroups: 24, maxOverviewRoutes: 64 + }, + quality: { + status: "good", + metrics: { + sourceScopes: { production: 4, test: 0, generated: 0, vendor: 0, documentation: 0, unknown: 0 }, + unknownSourceFraction: 0, generatedVendorLeakage: 0, + representedNodeFraction: 1, representedRelationshipFraction: 1, + duplicateNames: 0, fallbackNames: 0, largestGroupFraction: 0.5, + unknownRelations: 0, unassignedNodes: 0, unassignedRelationships: 0 + }, diagnostics: [] + }, provenance: { projectName: "Fixture", builtAtCommit: null, generatedAt: null } } }); expect(parsed.type).toBe("architectureOverview"); if (parsed.type !== "architectureOverview") throw new Error("Expected overview"); - expect("sections" in parsed.model).toBe(true); + expect("groups" in parsed.model).toBe(true); expect("crossSectionCalls" in parsed.model).toBe(false); }); }); diff --git a/editors/vscode/src/transport/architectureMessages.ts b/editors/vscode/src/transport/architectureMessages.ts index 2adf5c8b..8eaa024e 100644 --- a/editors/vscode/src/transport/architectureMessages.ts +++ b/editors/vscode/src/transport/architectureMessages.ts @@ -1,10 +1,11 @@ import { ArchitectureEvidenceSchema, + ArchitectureLensSchema, ArchitectureOverviewSchema, ArchitectureRoutePageSchema, ArchitectureScopeSchema, ArchitectureSearchPageSchema, - ArchitectureSectionPageSchema + ArchitectureGroupPageSchema } from "@compass/viewer/contracts/architecture"; import { z } from "zod"; @@ -16,7 +17,8 @@ const RequestIdentitySchema = z.object({ const DataRequestSchema = RequestIdentitySchema.extend({ generation: z.number().int().nonnegative(), scope: ArchitectureScopeSchema, - evidence: ArchitectureEvidenceSchema + evidence: ArchitectureEvidenceSchema, + lens: ArchitectureLensSchema }); const PageRequestSchema = DataRequestSchema.extend({ @@ -32,12 +34,13 @@ export const ArchitectureToHostMessageSchema = z.discriminatedUnion("type", [ RequestIdentitySchema.extend({ type: z.literal("setArchitectureFilters"), scope: ArchitectureScopeSchema, - evidence: ArchitectureEvidenceSchema + evidence: ArchitectureEvidenceSchema, + lens: ArchitectureLensSchema }), PageRequestSchema.extend({ - type: z.literal("requestSection"), - sectionId: z.string().min(1), - kind: z.enum(["symbols", "calls"]) + type: z.literal("requestGroup"), + groupId: z.string().min(1), + kind: z.enum(["symbols", "relationships"]) }), PageRequestSchema.extend({ type: z.literal("requestRoute"), @@ -68,8 +71,8 @@ export const HostToArchitectureMessageSchema = z.discriminatedUnion("type", [ model: ArchitectureOverviewSchema }), ResponseIdentitySchema.extend({ - type: z.literal("architectureSectionPage"), - model: ArchitectureSectionPageSchema + type: z.literal("architectureGroupPage"), + model: ArchitectureGroupPageSchema }), ResponseIdentitySchema.extend({ type: z.literal("architectureRoutePage"), diff --git a/editors/vscode/src/views/architectureIndex.test.ts b/editors/vscode/src/views/architectureIndex.test.ts index 49b2a28d..02edc909 100644 --- a/editors/vscode/src/views/architectureIndex.test.ts +++ b/editors/vscode/src/views/architectureIndex.test.ts @@ -1,178 +1,164 @@ import { describe, expect, it } from "vitest"; -import type { CallflowViewModel } from "@compass/viewer/contracts/callflow"; +import type { ArchitectureViewModel } from "@compass/viewer/contracts/architecture"; import { ArchitectureIndex, routeId } from "./architectureIndex"; -const model: CallflowViewModel = { - schema: "compass.viewer.callflow/1", - title: "Fixture — Architecture Flow", - sections: [ - { - id: "overview", - name: "Architecture Overview", - communities: [], - nodeCount: 0, - internalCallCount: 0, - nodes: [], - edges: [] - }, +const counts = { production: 2, test: 0, generated: 0, vendor: 0, documentation: 0, unknown: 0 }; +const quality = { + status: "good" as const, + metrics: { + sourceScopes: counts, + unknownSourceFraction: 0, + generatedVendorLeakage: 0, + representedNodeFraction: 1, + representedRelationshipFraction: 1, + duplicateNames: 0, + fallbackNames: 0, + largestGroupFraction: 0.5, + unknownRelations: 0, + unassignedNodes: 0, + unassignedRelationships: 0 + }, + diagnostics: [] +}; +const group = (id: string, name: string, rank: number) => ({ + id, + parentId: null, + kind: "subsystem" as const, + rank, + name: { + value: name, + provenance: "path" as const, + membershipSignature: `signature-${id}`, + quality: 90, + evidence: [`path:${name}`] + }, + ownerKey: `crates/${id}`, + communityIds: [rank - 1], + nodeCount: 1, + relationshipCount: 1, + neighborCount: 1, + cohesion: 0.8, + sourceScopes: { ...counts, production: 1 }, + pinned: false +}); + +const model: ArchitectureViewModel = { + schema: "compass.viewer.architecture/1", + title: "Fixture architecture", + nodes: [ + { id: "api", label: "ApiHandler", kind: "function", sourceFile: "src/api.ts", sourceScope: "production", scopeReason: "source_path", community: 0 }, + { id: "store", label: "LedgerStore", kind: "struct", sourceFile: "src/store.ts", sourceScope: "production", scopeReason: "source_path", community: 1 }, + { id: "fixture", label: "ApiFixture", kind: "function", sourceFile: "tests/api.test.ts", sourceScope: "test", scopeReason: "test_path", community: 0 } + ], + relationships: [ + { id: "r-call", source: "api", target: "store", relation: "calls", relationClass: "execution", confidence: "extracted" }, + { id: "r-type", source: "api", target: "store", relation: "type_of", relationClass: "type", confidence: "inferred" }, + { id: "r-test", source: "fixture", target: "api", relation: "calls", relationClass: "execution", confidence: "extracted" } + ], + projections: [ { - id: "api", - name: "API", - communities: ["0"], - nodeCount: 3, - internalCallCount: 1, - nodes: [ - { - id: "handler", label: "request_handler", kind: "function", - sourceFile: "src/api.ts", scope: "production" - }, - { - id: "helper", label: "helper", kind: "function", - sourceFile: "src/helper.ts", scope: "production" - }, - { - id: "api_test", label: "request_handler_test", kind: "function", - sourceFile: "tests/api.test.ts", scope: "test" - } + scope: "production", + defaultLens: "architecture", + groups: [group("api-group", "API", 1), group("storage-group", "Storage", 2)], + memberships: [ + { nodeIndex: 0, groupIndex: 0 }, + { nodeIndex: 1, groupIndex: 1 } ], - edges: [ - { - source: "handler", target: "helper", - relation: "calls", confidence: "extracted" - } - ] + routes: [], + overviewGroupIds: ["api-group", "storage-group"], + overviewRouteIds: [], + coverage: { + admitted: 1, + internal: 0, + crossGroup: 1, + unassigned: 0, + relationClasses: { execution: 1, dependency: 0, type: 1, structure: 0, contextual: 0, unknown: 0 } + }, + omissions: { + totalGroups: 2, shownGroups: 2, omittedGroups: 0, + representedNodes: 2, omittedNodes: 0, + representedRelationships: 1, omittedRelationships: 0, + witnessGroupIds: [], maxOverviewGroups: 24, maxOverviewRoutes: 64 + }, + quality }, { - id: "storage", - name: "Storage", - communities: ["1"], - nodeCount: 2, - internalCallCount: 0, - nodes: [ - { - id: "store", label: "save_record", kind: "function", - sourceFile: "src/store.ts", scope: "production" - }, - { - id: "generated", label: "GeneratedModel", kind: "class", - sourceFile: "generated/model.ts", scope: "generated" - } + scope: "all_code", + defaultLens: "architecture", + groups: [ + { ...group("api-group", "API", 1), nodeCount: 2, sourceScopes: { ...counts, production: 1, test: 1 } }, + group("storage-group", "Storage", 2) ], - edges: [] - } - ], - overviewLinks: [{ sourceSection: "api", targetSection: "storage", calls: 3 }], - crossSectionCalls: [ - { - source: "handler", target: "store", sourceSection: "api", - targetSection: "storage", relation: "calls", confidence: "extracted" - }, - { - source: "api_test", target: "store", sourceSection: "api", - targetSection: "storage", relation: "calls", confidence: "inferred" - }, - { - source: "handler", target: "generated", sourceSection: "api", - targetSection: "storage", relation: "references", confidence: "ambiguous" + memberships: [ + { nodeIndex: 0, groupIndex: 0 }, + { nodeIndex: 2, groupIndex: 0 }, + { nodeIndex: 1, groupIndex: 1 } + ], + routes: [], + overviewGroupIds: ["api-group", "storage-group"], + overviewRouteIds: [], + coverage: { + admitted: 2, + internal: 1, + crossGroup: 1, + unassigned: 0, + relationClasses: { execution: 2, dependency: 0, type: 1, structure: 0, contextual: 0, unknown: 0 } + }, + omissions: { + totalGroups: 2, shownGroups: 2, omittedGroups: 0, + representedNodes: 3, omittedNodes: 0, + representedRelationships: 2, omittedRelationships: 0, + witnessGroupIds: [], maxOverviewGroups: 24, maxOverviewRoutes: 64 + }, + quality: { ...quality, metrics: { ...quality.metrics, sourceScopes: { ...counts, test: 1 } } } } ], - coverage: { internal: 1, crossSection: 3, unassigned: 0 }, - reportHighlights: [], - statistics: { - nodes: 5, - edges: 4, - communities: 2, - hyperedges: 0, - extracted: 2, - inferred: 1, - ambiguous: 1 - }, - provenance: { projectName: "Fixture", builtAtCommit: "abc123", generatedAt: null } + statistics: { nodes: 3, relationships: 3, communities: 2, extracted: 2, inferred: 1, ambiguous: 0 }, + provenance: { projectName: "Fixture", builtAtCommit: null, generatedAt: null }, + limits: { + maxNodes: 250000, maxRelationships: 1000000, maxGroups: 100000, maxRoutes: 250000, + maxOverviewGroups: 24, maxOverviewRoutes: 64, maxNameCandidates: 12, + maxNameEvidence: 4, maxDiagnostics: 128, maxOmissionWitnesses: 8 + } }; describe("ArchitectureIndex", () => { - it("defaults projections to production while disclosing complete totals", () => { - const overview = new ArchitectureIndex(model).overview("production", "all"); + it("uses Rust-owned production memberships and typed lenses", () => { + const index = new ArchitectureIndex(model); + const production = index.overview("production", "all", "architecture"); + expect(production.statistics.totalNodes).toBe(2); + expect(production.statistics.visibleRelationships).toBe(1); + expect(production.routes[0]?.id).toBe(routeId("api-group", "storage-group")); - expect(overview.statistics).toMatchObject({ - visibleNodes: 3, - totalNodes: 5, - visibleCalls: 2, - totalCalls: 4 - }); - expect(overview.routes).toEqual([ - expect.objectContaining({ - sourceSection: "api", - targetSection: "storage", - calls: 1, - extracted: 1 - }) - ]); - expect(overview.sections.find((section) => section.id === "api")?.scopes.test).toBe(1); - }); + const allCode = index.overview("all", "all", "architecture"); + expect(allCode.statistics.totalNodes).toBe(3); + expect(allCode.groups.find((item) => item.id === "api-group")?.scopes.test).toBe(1); - it("restores test and generated calls in all-code scope", () => { - const overview = new ArchitectureIndex(model).overview("all", "all"); - expect(overview.statistics.visibleNodes).toBe(5); - expect(overview.statistics.visibleCalls).toBe(4); - expect(overview.routes[0]).toMatchObject({ - calls: 3, - extracted: 1, - inferred: 1, - ambiguous: 1 - }); + const typeLens = index.overview("production", "all", "type"); + expect(typeLens.statistics.visibleRelationships).toBe(1); + expect(typeLens.lens).toBe("type"); }); - it("filters evidence and pages every call behind a route", () => { + it("pages group evidence and keeps hidden-scope nodes out of production", () => { const index = new ArchitectureIndex(model); - const page = index.routePage({ - routeId: routeId("api", "storage"), - scope: "all", - evidence: "all", - page: 2, - pageSize: 2 + const production = index.groupPage({ + groupId: "api-group", kind: "symbols", page: 1, pageSize: 100, + scope: "production", evidence: "all", lens: "architecture" }); - expect(page).toMatchObject({ total: 3, start: 3, end: 3 }); - expect(page.items).toHaveLength(1); - - const inferred = index.overview("all", "inferred"); - expect(inferred.routes[0]).toMatchObject({ calls: 1, inferred: 1 }); - }); - - it("searches the complete retained model rather than one visible page", () => { - const results = new ArchitectureIndex(model).search({ - query: "GeneratedModel", - scope: "all", - evidence: "all", - page: 1, - pageSize: 10 + expect(production.items.map((item) => item.id)).toEqual(["api"]); + const all = index.groupPage({ + groupId: "api-group", kind: "symbols", page: 1, pageSize: 100, + scope: "all", evidence: "all", lens: "architecture" }); - expect(results.items).toEqual(expect.arrayContaining([ - expect.objectContaining({ - kind: "symbol", - label: "GeneratedModel", - sectionId: "storage" - }) - ])); + expect(all.items.map((item) => item.id)).toEqual(["fixture", "api"]); }); - it("returns bounded section pages with complete range metadata", () => { - const page = new ArchitectureIndex(model).sectionPage({ - sectionId: "api", - kind: "symbols", - scope: "all", - evidence: "all", - page: 1, - pageSize: 2 - }); - expect(page).toMatchObject({ - kind: "symbols", - total: 3, - start: 1, - end: 2, - pageCount: 2 + it("searches complete scoped groups and source evidence", () => { + const index = new ArchitectureIndex(model); + const result = index.search({ + query: "ledger", page: 1, pageSize: 100, + scope: "production", evidence: "all", lens: "architecture" }); - expect(page.items).toHaveLength(2); + expect(result.items.some((item) => item.label === "LedgerStore")).toBe(true); }); - }); diff --git a/editors/vscode/src/views/architectureIndex.ts b/editors/vscode/src/views/architectureIndex.ts index 59cfc2f2..b663d424 100644 --- a/editors/vscode/src/views/architectureIndex.ts +++ b/editors/vscode/src/views/architectureIndex.ts @@ -1,18 +1,23 @@ +import { + architectureOverview, + evidenceAdmits, + lensAdmits +} from "@compass/viewer/architecture/projection"; import type { - ArchitectureCall, + ArchitectureRelationshipRecord, ArchitectureEvidence, + ArchitectureLens, ArchitectureOverview, + ArchitectureRawGroup, + ArchitectureRawProjection, ArchitectureRoutePage, + ArchitectureScope, ArchitectureSearchPage, ArchitectureSearchResult, - ArchitectureScope, - ArchitectureSectionPage, - ArchitectureSourceScope, - ArchitectureSymbol + ArchitectureGroupPage, + ArchitectureSymbol, + ArchitectureViewModel } from "@compass/viewer/contracts/architecture"; -import type { CallflowViewModel } from "@compass/viewer/contracts/callflow"; - -type SourceScope = ArchitectureSourceScope; export type PageRequest = { page: number; @@ -20,298 +25,241 @@ export type PageRequest = { query?: string | undefined; scope: ArchitectureScope; evidence: ArchitectureEvidence; + lens?: ArchitectureLens | undefined; }; -export type SectionPageRequest = PageRequest & { - sectionId: string; - kind: "symbols" | "calls"; -}; - -export type RoutePageRequest = PageRequest & { - routeId: string; +export type GroupPageRequest = PageRequest & { + groupId: string; + kind: "symbols" | "relationships"; }; -export type SearchRequest = PageRequest & { - query: string; -}; - -type IndexedNode = ArchitectureSymbol & { normalized: string }; -type IndexedCall = ArchitectureCall & { normalized: string }; +export type RoutePageRequest = PageRequest & { routeId: string }; +export type SearchRequest = PageRequest & { query: string }; -const EMPTY_SCOPES: Record = { - production: 0, - test: 0, - generated: 0, - vendor: 0, - unknown: 0 -}; +type IndexedSymbol = ArchitectureSymbol & { normalized: string }; +type IndexedRelationship = ArchitectureRelationshipRecord & { normalized: string }; export class ArchitectureIndex { - private readonly sections; - private readonly nodes = new Map(); - private readonly internalCalls = new Map(); - private readonly crossCalls: IndexedCall[]; - private readonly routes = new Map(); + private readonly nodeById; - constructor(private readonly model: CallflowViewModel) { - this.sections = model.sections.filter((section) => section.id !== "overview"); - for (const section of this.sections) { - for (const node of section.nodes) { - this.nodes.set(node.id, { - ...node, - sectionId: section.id, - normalized: normalize([node.label, node.kind, node.sourceFile ?? "", section.name]) - }); - } - } - for (const section of this.sections) { - this.internalCalls.set( - section.id, - section.edges.map((edge, index) => - this.indexedCall(edge, section.id, section.id, `internal:${section.id}:${index}`) - ) - ); - } - this.crossCalls = model.crossSectionCalls.map((call, index) => - this.indexedCall( - call, - call.sourceSection, - call.targetSection, - `cross:${call.sourceSection}:${call.targetSection}:${index}` - ) - ); - for (const call of this.crossCalls) { - const id = routeId(call.sourceSection, call.targetSection); - const calls = this.routes.get(id) ?? []; - calls.push(call); - this.routes.set(id, calls); - } + constructor(private readonly model: ArchitectureViewModel) { + this.nodeById = new Map(model.nodes.map((node) => [node.id, node])); } overview( scope: ArchitectureScope, - evidence: ArchitectureEvidence + evidence: ArchitectureEvidence, + lens: ArchitectureLens = "architecture" ): ArchitectureOverview { - const sectionCounts = new Map(); - const countRoute = (sourceSection: string, targetSection: string, calls: number) => { - sectionCounts.set(sourceSection, { - incoming: sectionCounts.get(sourceSection)?.incoming ?? 0, - outgoing: (sectionCounts.get(sourceSection)?.outgoing ?? 0) + calls - }); - sectionCounts.set(targetSection, { - incoming: (sectionCounts.get(targetSection)?.incoming ?? 0) + calls, - outgoing: sectionCounts.get(targetSection)?.outgoing ?? 0 - }); - }; - const routes: ArchitectureOverview["routes"] = [...this.routes.entries()] - .map(([id, calls]) => { - const visible = calls.filter((call) => this.includeCall(call, scope, evidence)); - if (visible.length === 0) return undefined; - countRoute(visible[0]!.sourceSection, visible[0]!.targetSection, visible.length); - return { - id, - sourceSection: visible[0]!.sourceSection, - targetSection: visible[0]!.targetSection, - calls: visible.length, - extracted: visible.filter((call) => call.confidence === "extracted").length, - inferred: visible.filter((call) => call.confidence === "inferred").length, - ambiguous: visible.filter((call) => call.confidence === "ambiguous").length - }; - }) - .filter((route) => route !== undefined); - routes.sort((left, right) => right.calls - left.calls || left.id.localeCompare(right.id)); - - const sections = this.sections.map((section) => { - const allNodes = section.nodes.map((node) => this.nodes.get(node.id)!); - const visibleNodes = allNodes.filter((node) => this.includeNode(node, scope)); - const calls = (this.internalCalls.get(section.id) ?? []) - .filter((call) => this.includeCall(call, scope, evidence)); - const scopes = { ...EMPTY_SCOPES }; - for (const node of allNodes) scopes[node.scope] += 1; - return { - id: section.id, - name: section.name, - nodeCount: visibleNodes.length, - totalNodeCount: allNodes.length, - internalCallCount: calls.length, - incomingCalls: sectionCounts.get(section.id)?.incoming ?? 0, - outgoingCalls: sectionCounts.get(section.id)?.outgoing ?? 0, - scopes - }; - }); - const visibleNodes = [...this.nodes.values()] - .filter((node) => this.includeNode(node, scope)).length; - const visibleInternal = [...this.internalCalls.values()].flat() - .filter((call) => this.includeCall(call, scope, evidence)).length; - const visibleCross = routes.reduce((total, route) => total + route.calls, 0); - return { - title: this.model.title, - scope, - evidence, - sections, - routes, - statistics: { - visibleNodes, - totalNodes: this.model.statistics.nodes, - visibleCalls: visibleInternal + visibleCross, - totalCalls: this.model.statistics.edges, - communities: this.model.statistics.communities, - extracted: this.model.statistics.extracted, - inferred: this.model.statistics.inferred, - ambiguous: this.model.statistics.ambiguous - }, - coverage: this.model.coverage, - provenance: this.model.provenance - }; + return architectureOverview(this.model, { scope, evidence, lens }); } - sectionPage(request: SectionPageRequest): ArchitectureSectionPage { - const section = this.sections.find((candidate) => candidate.id === request.sectionId); - if (!section) throw new Error(`Unknown architecture section '${request.sectionId}'`); + groupPage(request: GroupPageRequest): ArchitectureGroupPage { + const context = this.context(request.scope); + const group = context.groupById.get(request.groupId); + if (!group) throw new Error(`Unknown architecture group '${request.groupId}'`); const query = normalized(request.query); if (request.kind === "symbols") { - const items = section.nodes - .map((node) => this.nodes.get(node.id)!) - .filter((node) => this.includeNode(node, request.scope)) - .filter((node) => !query || node.normalized.includes(query)) - .sort((left, right) => left.label.localeCompare(right.label)) + const items = this.groupNodeIds(group, context) + .flatMap((id) => { + const node = this.nodeById.get(id); + if (!node) return []; + const symbol: IndexedSymbol = { + id: node.id, + label: node.label, + kind: node.kind, + sourceFile: node.sourceFile, + scope: node.sourceScope, + groupId: group.id, + normalized: normalize([node.label, node.kind, node.sourceFile ?? "", group.name.value]) + }; + return [symbol]; + }) + .filter((item) => !query || item.normalized.includes(query)) + .sort((left, right) => left.label.localeCompare(right.label) || left.id.localeCompare(right.id)) .map(stripNormalized); - return { kind: "symbols", sectionId: section.id, ...page(items, request) }; + return { kind: "symbols", groupId: group.id, ...page(items, request) }; } - const items = (this.internalCalls.get(section.id) ?? []) - .filter((call) => this.includeCall(call, request.scope, request.evidence)) - .filter((call) => !query || call.normalized.includes(query)) - .sort(compareCalls) + const memberIds = new Set(this.groupNodeIds(group, context)); + const items = this.model.relationships + .filter((item) => memberIds.has(item.source) && memberIds.has(item.target)) + .filter((item) => this.includeRelationship(item, request)) + .map((item) => this.indexedRelationship(item, group.id, group.id)) + .filter((item) => !query || item.normalized.includes(query)) + .sort(compareRelationships) .map(stripNormalized); - return { kind: "calls", sectionId: section.id, ...page(items, request) }; + return { kind: "relationships", groupId: group.id, ...page(items, request) }; } routePage(request: RoutePageRequest): ArchitectureRoutePage { - const calls = this.routes.get(request.routeId); - if (!calls) throw new Error(`Unknown architecture route '${request.routeId}'`); + const context = this.context(request.scope); + const [sourceGroup, targetGroup] = splitRouteId(request.routeId); + if (!context.groupById.has(sourceGroup) || !context.groupById.has(targetGroup)) { + throw new Error(`Unknown architecture route '${request.routeId}'`); + } const query = normalized(request.query); - const items = calls - .filter((call) => this.includeCall(call, request.scope, request.evidence)) - .filter((call) => !query || call.normalized.includes(query)) - .sort(compareCalls) + const items = this.model.relationships + .filter((item) => + context.overviewByNode.get(item.source) === sourceGroup + && context.overviewByNode.get(item.target) === targetGroup) + .filter((item) => this.includeRelationship(item, request)) + .map((item) => this.indexedRelationship(item, sourceGroup, targetGroup)) + .filter((item) => !query || item.normalized.includes(query)) + .sort(compareRelationships) .map(stripNormalized); return { routeId: request.routeId, - sourceSection: calls[0]!.sourceSection, - targetSection: calls[0]!.targetSection, + sourceGroup: sourceGroup, + targetGroup: targetGroup, ...page(items, request) }; } search(request: SearchRequest): ArchitectureSearchPage { const query = normalized(request.query); - if (!query) return { query: request.query, ...page([], request) }; - const results: ArchitectureSearchResult[] = this.sections - .filter((section) => normalized(section.name).includes(query)) - .map((section) => ({ - id: `section:${section.id}`, - kind: "section" as const, - label: section.name, - detail: "Subsystem", - sectionId: section.id, + const context = this.context(request.scope); + const results: ArchitectureSearchResult[] = []; + for (const group of context.projection.groups) { + if (query && !normalize([group.name.value, group.ownerKey]).includes(query)) continue; + results.push({ + id: `group:${group.id}`, + kind: "group", + label: group.name.value, + detail: group.parentId ? "Subsystem" : group.kind === "owner" ? "Owner" : "Subsystem", + groupId: group.id, routeId: null, sourceFile: null - })); - for (const node of this.nodes.values()) { - if (!this.includeNode(node, request.scope) || !node.normalized.includes(query)) continue; + }); + } + for (const node of query ? this.model.nodes : []) { + const groupId = context.leafByNode.get(node.id); + if (!groupId || !normalize([node.label, node.kind, node.sourceFile ?? ""]).includes(query)) continue; results.push({ id: `symbol:${node.id}`, kind: "symbol", label: node.label, detail: [node.kind || "symbol", node.sourceFile].filter(Boolean).join(" · "), - sectionId: node.sectionId, + groupId: groupId, routeId: null, sourceFile: node.sourceFile }); } - for (const call of [ - ...this.crossCalls, - ...[...this.internalCalls.values()].flat() - ]) { - if ( - !this.includeCall(call, request.scope, request.evidence) - || !call.normalized.includes(query) - ) continue; + for (const relationship of query ? this.model.relationships : []) { + if (!this.includeRelationship(relationship, request)) continue; + const source = this.nodeById.get(relationship.source); + const target = this.nodeById.get(relationship.target); + if (!normalize([ + source?.label ?? relationship.source, + target?.label ?? relationship.target, + relationship.relation, + relationship.relationClass + ]).includes(query)) continue; + const sourceGroup = context.overviewByNode.get(relationship.source); + const targetGroup = context.overviewByNode.get(relationship.target); results.push({ - id: `call:${call.id}`, - kind: "call", - label: `${call.sourceLabel} → ${call.targetLabel}`, - detail: `${call.relation} · ${call.confidence}`, - sectionId: call.sourceSection, - routeId: call.sourceSection === call.targetSection - ? null - : routeId(call.sourceSection, call.targetSection), - sourceFile: call.sourceFile + id: `relationship:${relationship.id}`, + kind: "relationship", + label: `${source?.label ?? relationship.source} → ${target?.label ?? relationship.target}`, + detail: `${relationship.relation} · ${relationship.relationClass} · ${relationship.confidence}`, + groupId: context.leafByNode.get(relationship.source) ?? null, + routeId: sourceGroup && targetGroup && sourceGroup !== targetGroup + ? routeId(sourceGroup, targetGroup) + : null, + sourceFile: source?.sourceFile ?? null }); } - results.sort((left, right) => { - const rank = { section: 0, symbol: 1, call: 2 }; - return rank[left.kind] - rank[right.kind] || left.label.localeCompare(right.label); - }); - return { query: request.query, ...page(results.slice(0, 100), request) }; + const rank = { group: 0, symbol: 1, relationship: 2 }; + results.sort((left, right) => rank[left.kind] - rank[right.kind] || left.label.localeCompare(right.label)); + return { query: request.query, ...page(results, request) }; + } + + private context(scope: ArchitectureScope) { + const rawScope = scope === "all" ? "all_code" : "production"; + const projection = this.model.projections.find((candidate) => candidate.scope === rawScope); + if (!projection) throw new Error(`Architecture projection is missing scope '${scope}'`); + const groupById = new Map(projection.groups.map((group) => [group.id, group])); + const leafByNode = new Map(projection.memberships.map((item) => [ + this.model.nodes[item.nodeIndex]!.id, + projection.groups[item.groupIndex]!.id + ])); + const overviewByNode = new Map(); + for (const [nodeId, leafId] of leafByNode) { + const group = groupById.get(leafId); + overviewByNode.set(nodeId, group?.parentId ?? leafId); + } + return { projection, groupById, leafByNode, overviewByNode }; + } + + private groupNodeIds( + group: ArchitectureRawGroup, + context: { + projection: ArchitectureRawProjection; + leafByNode: Map; + groupById: Map; + } + ): string[] { + const children = new Set(context.projection.groups + .filter((candidate) => candidate.parentId === group.id) + .map((candidate) => candidate.id)); + return [...context.leafByNode.entries()] + .filter(([, groupId]) => groupId === group.id || children.has(groupId)) + .map(([nodeId]) => nodeId); + } + + private includeRelationship( + relationship: ArchitectureViewModel["relationships"][number], + request: Pick + ): boolean { + return evidenceAdmits(request.evidence, relationship.confidence) + && lensAdmits(request.lens ?? "architecture", relationship.relationClass); } - private indexedCall( - edge: { - source: string; - target: string; - relation: string; - confidence: "extracted" | "inferred" | "ambiguous"; - }, - sourceSection: string, - targetSection: string, - id: string - ): IndexedCall { - const source = this.nodes.get(edge.source); - const target = this.nodes.get(edge.target); - const call: ArchitectureCall = { - id, - source: edge.source, - target: edge.target, - sourceLabel: source?.label ?? edge.source, - targetLabel: target?.label ?? edge.target, + private indexedRelationship( + relationship: ArchitectureViewModel["relationships"][number], + sourceGroup: string, + targetGroup: string + ): IndexedRelationship { + const source = this.nodeById.get(relationship.source); + const target = this.nodeById.get(relationship.target); + const record: ArchitectureRelationshipRecord = { + id: relationship.id, + source: relationship.source, + target: relationship.target, + sourceLabel: source?.label ?? relationship.source, + targetLabel: target?.label ?? relationship.target, sourceFile: source?.sourceFile ?? null, targetFile: target?.sourceFile ?? null, - sourceSection, - targetSection, - relation: edge.relation, - confidence: edge.confidence + sourceGroup, + targetGroup, + relation: relationship.relation, + relationClass: relationship.relationClass, + confidence: relationship.confidence }; return { - ...call, + ...record, normalized: normalize([ - call.sourceLabel, - call.targetLabel, - call.sourceFile ?? "", - call.targetFile ?? "", - call.relation, - call.confidence + record.sourceLabel, + record.targetLabel, + record.sourceFile ?? "", + record.targetFile ?? "", + record.relation, + record.relationClass, + record.confidence ]) }; } +} - private includeNode(node: IndexedNode | undefined, scope: ArchitectureScope): boolean { - return Boolean(node && (scope === "all" || node.scope === "production")); - } - - private includeCall( - call: IndexedCall, - scope: ArchitectureScope, - evidence: ArchitectureEvidence - ): boolean { - return this.includeNode(this.nodes.get(call.source), scope) - && this.includeNode(this.nodes.get(call.target), scope) - && (evidence === "all" || call.confidence === evidence); - } +export function routeId(sourceGroup: string, targetGroup: string): string { + return `${sourceGroup}->${targetGroup}`; } -export function routeId(sourceSection: string, targetSection: string): string { - return `${encodeURIComponent(sourceSection)}→${encodeURIComponent(targetSection)}`; +function splitRouteId(id: string): [string, string] { + const parts = id.split("->"); + if (parts.length !== 2 || !parts[0] || !parts[1]) { + throw new Error(`Invalid architecture route '${id}'`); + } + return [parts[0], parts[1]]; } function normalize(values: readonly string[]): string { @@ -329,16 +277,14 @@ function stripNormalized({ return value; } -function compareCalls(left: IndexedCall, right: IndexedCall): number { +function compareRelationships(left: IndexedRelationship, right: IndexedRelationship): number { return left.sourceLabel.localeCompare(right.sourceLabel) || left.targetLabel.localeCompare(right.targetLabel) - || left.relation.localeCompare(right.relation); + || left.relation.localeCompare(right.relation) + || left.id.localeCompare(right.id); } -function page( - items: readonly T[], - request: Pick -) { +function page(items: readonly T[], request: Pick) { const pageSize = Math.min(100, Math.max(1, Math.trunc(request.pageSize))); const pageCount = Math.max(1, Math.ceil(items.length / pageSize)); const current = Math.min(pageCount, Math.max(1, Math.trunc(request.page))); diff --git a/editors/vscode/src/views/architecturePanel.test.ts b/editors/vscode/src/views/architecturePanel.test.ts index 361e9826..4b41bc87 100644 --- a/editors/vscode/src/views/architecturePanel.test.ts +++ b/editors/vscode/src/views/architecturePanel.test.ts @@ -10,45 +10,72 @@ vi.mock("./sourceNavigation", () => ({ openGraphSource: vi.fn() })); import { ArchitecturePanelController, ARCHITECTURE_STDOUT_LIMIT } from "./architecturePanel"; function callflowPayload(): string { + const sourceScopes = { production: 2, test: 0, generated: 0, vendor: 0, documentation: 0, unknown: 0 }; + const group = (id: string, name: string, community: number) => ({ + id, parentId: null, kind: "subsystem", rank: community + 1, + name: { + value: name, provenance: "path", membershipSignature: `signature-${id}`, + quality: 90, evidence: [`path:${name}`] + }, + ownerKey: `crates/${id}`, communityIds: [community], nodeCount: 1, + relationshipCount: 1, neighborCount: 1, cohesion: 0.8, + sourceScopes: { ...sourceScopes, production: 1 }, pinned: false + }); + const quality = { + status: "good", + metrics: { + sourceScopes, unknownSourceFraction: 0, generatedVendorLeakage: 0, + representedNodeFraction: 1, representedRelationshipFraction: 1, + duplicateNames: 0, fallbackNames: 0, largestGroupFraction: 0.5, + unknownRelations: 0, unassignedNodes: 0, unassignedRelationships: 0 + }, + diagnostics: [] + }; + const projection = (scope: "production" | "all_code") => ({ + scope, defaultLens: "architecture", + groups: [group("api", "API", 0), group("storage", "Storage", 1)], + memberships: [ + { nodeIndex: 0, groupIndex: 0 }, + { nodeIndex: 1, groupIndex: 1 } + ], + routes: [], overviewGroupIds: ["api", "storage"], overviewRouteIds: [], + coverage: { + admitted: 1, internal: 0, crossGroup: 1, unassigned: 0, + relationClasses: { execution: 1, dependency: 0, type: 0, structure: 0, contextual: 0, unknown: 0 } + }, + omissions: { + totalGroups: 2, shownGroups: 2, omittedGroups: 0, + representedNodes: 2, omittedNodes: 0, + representedRelationships: 1, omittedRelationships: 0, + witnessGroupIds: [], maxOverviewGroups: 24, maxOverviewRoutes: 64 + }, + quality + }); return JSON.stringify({ - schema: "compass.viewer.callflow/1", + schema: "compass.viewer.architecture/1", title: "Fixture — Architecture Flow", - sections: [ - { - id: "overview", name: "Architecture Overview", communities: [], - nodeCount: 0, internalCallCount: 0, nodes: [], edges: [] - }, + nodes: [ { - id: "api", name: "API", communities: ["0"], - nodeCount: 1, internalCallCount: 0, - nodes: [{ - id: "handler", label: "handler", kind: "function", - sourceFile: "src/api.ts", scope: "production" - }], - edges: [] + id: "handler", label: `handler-${"x".repeat(9 * 1024 * 1024)}`, kind: "function", + sourceFile: "src/api.ts", sourceScope: "production", scopeReason: "source_path", community: 0 }, { - id: "storage", name: "Storage", communities: ["1"], - nodeCount: 1, internalCallCount: 0, - nodes: [{ - id: "store", label: "store", kind: "function", - sourceFile: "src/store.ts", scope: "production" - }], - edges: [] + id: "store", label: "store", kind: "function", sourceFile: "src/store.ts", + sourceScope: "production", scopeReason: "source_path", community: 1 } ], - overviewLinks: [{ sourceSection: "api", targetSection: "storage", calls: 1 }], - crossSectionCalls: [{ - source: "handler", target: "store", sourceSection: "api", - targetSection: "storage", relation: "calls", confidence: "extracted" + relationships: [{ + id: "relationship-1", source: "handler", target: "store", relation: "calls", + relationClass: "execution", confidence: "extracted" }], - coverage: { internal: 0, crossSection: 1, unassigned: 0 }, - reportHighlights: ["x".repeat(9 * 1024 * 1024)], - statistics: { - nodes: 2, edges: 1, communities: 2, hyperedges: 0, - extracted: 1, inferred: 0, ambiguous: 0 + projections: [projection("production"), projection("all_code")], + statistics: { nodes: 2, relationships: 1, communities: 2, extracted: 1, inferred: 0, ambiguous: 0 }, + provenance: { projectName: "Fixture", builtAtCommit: null, generatedAt: null }, + limits: { + maxNodes: 250000, maxRelationships: 1000000, maxGroups: 100000, maxRoutes: 250000, + maxOverviewGroups: 24, maxOverviewRoutes: 64, maxNameCandidates: 12, + maxNameEvidence: 4, maxDiagnostics: 128, maxOmissionWitnesses: 8 }, - provenance: { projectName: "Fixture", builtAtCommit: null, generatedAt: null } }); } @@ -87,7 +114,7 @@ describe("ArchitecturePanelController", () => { .find((message) => message.type === "architectureOverview"); expect(overview).toBeDefined(); if (!overview?.model) throw new Error("Expected architecture overview"); - expect(overview.model.statistics).toMatchObject({ totalNodes: 2, totalCalls: 1 }); + expect(overview.model.statistics).toMatchObject({ totalNodes: 2, totalRelationships: 1 }); expect(overview.model).not.toHaveProperty("crossSectionCalls"); expect(JSON.stringify(overview).length).toBeLessThan(100_000); }); diff --git a/editors/vscode/src/views/architecturePanel.ts b/editors/vscode/src/views/architecturePanel.ts index f82a772f..eb44534d 100644 --- a/editors/vscode/src/views/architecturePanel.ts +++ b/editors/vscode/src/views/architecturePanel.ts @@ -1,8 +1,12 @@ import { randomUUID } from "node:crypto"; import { Buffer } from "node:buffer"; import * as vscode from "vscode"; -import { CallflowViewModelSchema } from "@compass/viewer/contracts/callflow"; -import type { ArchitectureEvidence, ArchitectureScope } from "@compass/viewer/contracts/architecture"; +import { ArchitectureViewModelSchema } from "@compass/viewer/contracts/architecture"; +import type { + ArchitectureEvidence, + ArchitectureLens, + ArchitectureScope +} from "@compass/viewer/contracts/architecture"; import type { RepositorySession } from "../workspace/repositorySession"; import { ArchitectureToHostMessageSchema } from "../transport/architectureMessages"; import { ArchitectureIndex } from "./architectureIndex"; @@ -36,6 +40,7 @@ export class ArchitecturePanelController { private index: ArchitectureIndex | undefined; private scope: ArchitectureScope = "production"; private evidence: ArchitectureEvidence = "all"; + private lens: ArchitectureLens = "architecture"; constructor( private readonly context: vscode.ExtensionContext, @@ -72,23 +77,25 @@ export class ArchitecturePanelController { if (message.type === "setArchitectureFilters") { this.scope = message.scope; this.evidence = message.evidence; + this.lens = message.lens; await this.postOverview(message.requestId); return; } if (!this.index || message.generation !== this.generation) return; try { - if (message.type === "requestSection") { - const model = this.index.sectionPage({ - sectionId: message.sectionId, + if (message.type === "requestGroup") { + const model = this.index.groupPage({ + groupId: message.groupId, kind: message.kind, page: message.page, pageSize: message.pageSize, query: message.query, scope: message.scope, - evidence: message.evidence + evidence: message.evidence, + lens: message.lens }); await this.panel.webview.postMessage({ - type: "architectureSectionPage", + type: "architectureGroupPage", requestId: message.requestId, repositoryId: this.session.id, generation: this.generation, @@ -101,7 +108,8 @@ export class ArchitecturePanelController { pageSize: message.pageSize, query: message.query, scope: message.scope, - evidence: message.evidence + evidence: message.evidence, + lens: message.lens }); await this.panel.webview.postMessage({ type: "architectureRoutePage", @@ -116,7 +124,8 @@ export class ArchitecturePanelController { page: message.page, pageSize: message.pageSize, scope: message.scope, - evidence: message.evidence + evidence: message.evidence, + lens: message.lens }); await this.panel.webview.postMessage({ type: "architectureSearchResults", @@ -147,6 +156,7 @@ export class ArchitecturePanelController { this.index = undefined; this.scope = "production"; this.evidence = "all"; + this.lens = "architecture"; const started = Date.now(); try { await this.postLoading("exporting", "Deriving complete architecture evidence"); @@ -162,18 +172,18 @@ export class ArchitecturePanelController { } const payloadBytes = Buffer.byteLength(result.stdout, "utf8"); await this.postLoading("validating", `Validating ${formatBytes(payloadBytes)} export`); - const model = CallflowViewModelSchema.parse(JSON.parse(result.stdout)); + const model = ArchitectureViewModelSchema.parse(JSON.parse(result.stdout)); if (!this.isCurrent(generation, controller)) return; await this.postLoading( "indexing", - `Indexing ${model.statistics.edges.toLocaleString()} calls locally` + `Indexing ${model.statistics.relationships.toLocaleString()} typed relationships locally` ); this.index = new ArchitectureIndex(model); await this.postLoading("mapping", "Laying out subsystem routes"); await this.postOverview(randomUUID()); this.output.appendLine( `[architecture] Loaded ${sessionLabel(this.session.root)}: ` - + `${model.statistics.nodes} symbols, ${model.statistics.edges} calls, ` + + `${model.statistics.nodes} symbols, ${model.statistics.relationships} relationships, ` + `${formatBytes(payloadBytes)} in ${Date.now() - started} ms` ); } catch (error) { @@ -192,7 +202,7 @@ export class ArchitecturePanelController { requestId, repositoryId: this.session.id, generation: this.generation, - model: this.index.overview(this.scope, this.evidence) + model: this.index.overview(this.scope, this.evidence, this.lens) }); } diff --git a/editors/vscode/src/webviews/architecture.tsx b/editors/vscode/src/webviews/architecture.tsx index 07a4c627..48205978 100644 --- a/editors/vscode/src/webviews/architecture.tsx +++ b/editors/vscode/src/webviews/architecture.tsx @@ -4,11 +4,12 @@ import { ArchitectureFlow, type ArchitectureEvidence, type ArchitectureHost, + type ArchitectureLens, type ArchitectureOverview, type ArchitectureRoutePage, type ArchitectureScope, type ArchitectureSearchPage, - type ArchitectureSectionPage + type ArchitectureGroupPage } from "@compass/viewer"; import { HostToArchitectureMessageSchema } from "../transport/architectureMessages"; import { GraphLoadingState, type GraphLoadingCopy } from "./GraphLoadingState"; @@ -22,12 +23,12 @@ const root = createRoot(element); const ARCHITECTURE_LOADING_COPY: GraphLoadingCopy = { eyebrow: "Compass architecture", title: "Deriving architecture flow", - steps: ["Exporting evidence", "Indexing complete call flow", "Laying out subsystem routes"] + steps: ["Exporting evidence", "Indexing typed relationships", "Laying out subsystem routes"] }; type ArchitectureState = { overview?: ArchitectureOverview | undefined; - sectionPage?: ArchitectureSectionPage | undefined; + groupPage?: ArchitectureGroupPage | undefined; routePage?: ArchitectureRoutePage | undefined; searchPage?: ArchitectureSearchPage | undefined; repositoryId: string; @@ -72,12 +73,12 @@ function ArchitectureApp() { ...current, ...identity, overview: message.model, - sectionPage: undefined, + groupPage: undefined, routePage: undefined }; } - if (message.type === "architectureSectionPage") { - return { ...current, ...identity, sectionPage: message.model }; + if (message.type === "architectureGroupPage") { + return { ...current, ...identity, groupPage: message.model }; } if (message.type === "architectureRoutePage") { return { ...current, ...identity, routePage: message.model }; @@ -92,7 +93,7 @@ function ArchitectureApp() { const host = useMemo(() => { const dataRequest = ( - type: "requestSection" | "requestRoute" | "searchArchitecture", + type: "requestGroup" | "requestRoute" | "searchArchitecture", payload: Record ) => { vscode.postMessage({ @@ -102,22 +103,24 @@ function ArchitectureApp() { generation: state.generation, scope: state.overview?.scope ?? "production", evidence: state.overview?.evidence ?? "all", + lens: state.overview?.lens ?? "architecture", pageSize: 100, ...payload }); }; return { - setFilters(scope: ArchitectureScope, evidence: ArchitectureEvidence) { + setFilters(scope: ArchitectureScope, evidence: ArchitectureEvidence, lens: ArchitectureLens) { vscode.postMessage({ type: "setArchitectureFilters", requestId: crypto.randomUUID(), repositoryId: state.repositoryId, scope, - evidence + evidence, + lens }); }, - requestSection(sectionId, kind, page, query) { - dataRequest("requestSection", { sectionId, kind, page, query }); + requestGroup(groupId, kind, page, query) { + dataRequest("requestGroup", { groupId, kind, page, query }); }, requestRoute(routeId, page, query) { dataRequest("requestRoute", { routeId, page, query }); @@ -134,7 +137,13 @@ function ArchitectureApp() { }); } }; - }, [state.generation, state.overview?.evidence, state.overview?.scope, state.repositoryId]); + }, [ + state.generation, + state.overview?.evidence, + state.overview?.lens, + state.overview?.scope, + state.repositoryId + ]); if (state.error) { return ( @@ -164,7 +173,7 @@ function ArchitectureApp() { return ( { render( { ); expect(screen.getByText(/Production · 2 of 3 symbols/i)).toBeInTheDocument(); - expect(screen.getByText(/1 unassigned calls disclosed/i)).toBeInTheDocument(); + expect(screen.getByText(/1 unassigned relationships disclosed/i)).toBeInTheDocument(); expect(screen.getByRole("button", { name: "All code" })).toBeInTheDocument(); expect(screen.getByText("handler")).toBeInTheDocument(); await waitFor(() => { - expect(adapter.requestSection).toHaveBeenCalledWith("api", "symbols", 1, ""); + expect(adapter.requestGroup).toHaveBeenCalledWith("api", "symbols", 1, ""); }); }); @@ -80,7 +98,7 @@ describe("ArchitectureFlow", () => { render( { render( { expect(screen.getByText("No symbols match this filter.")).toBeInTheDocument(); }); + it("opens a paged directory for groups omitted from the map", () => { + const adapter = host(); + render( + + ); + + fireEvent.click(screen.getByRole("button", { name: "Browse all groups" })); + expect(adapter.search).toHaveBeenCalledWith("", 1); + fireEvent.click(screen.getByRole("button", { name: "Next" })); + expect(adapter.search).toHaveBeenCalledWith("", 2); + }); + }); diff --git a/packages/compass-viewer/src/architecture/ArchitectureFlow.tsx b/packages/compass-viewer/src/architecture/ArchitectureFlow.tsx index cefda687..c7e47ff2 100644 --- a/packages/compass-viewer/src/architecture/ArchitectureFlow.tsx +++ b/packages/compass-viewer/src/architecture/ArchitectureFlow.tsx @@ -12,20 +12,21 @@ import { } from "lucide-react"; import type { ArchitectureEvidence, + ArchitectureLens, ArchitectureOverview, ArchitectureRoutePage, ArchitectureScope, ArchitectureSearchPage, - ArchitectureSectionPage + ArchitectureGroupPage } from "../contracts/architecture"; import { Pagination } from "../components/workbench/Pagination"; import { ArchitectureMap, type ArchitectureSelection } from "./ArchitectureMap"; export type ArchitectureHost = { - setFilters(scope: ArchitectureScope, evidence: ArchitectureEvidence): void; - requestSection( - sectionId: string, - kind: "symbols" | "calls", + setFilters(scope: ArchitectureScope, evidence: ArchitectureEvidence, lens: ArchitectureLens): void; + requestGroup( + groupId: string, + kind: "symbols" | "relationships", page: number, query: string ): void; @@ -36,68 +37,84 @@ export type ArchitectureHost = { export function ArchitectureFlow({ overview, - sectionPage, + groupPage, routePage, searchPage, loadingMessage, host }: { overview: ArchitectureOverview; - sectionPage: ArchitectureSectionPage | undefined; + groupPage: ArchitectureGroupPage | undefined; routePage: ArchitectureRoutePage | undefined; searchPage: ArchitectureSearchPage | undefined; loadingMessage: string | undefined; host: ArchitectureHost; }) { - const firstSection = overview.sections.find((section) => section.nodeCount > 0); + const firstGroup = overview.groups.find((section) => section.nodeCount > 0); const [selection, setSelection] = useState( - firstSection ? { kind: "section", id: firstSection.id } : undefined + firstGroup ? { kind: "group", id: firstGroup.id } : undefined ); - const [sectionTab, setSectionTab] = useState<"symbols" | "calls">("symbols"); + const [groupTab, setSectionTab] = useState<"symbols" | "relationships">("symbols"); const [detailQuery, setDetailQuery] = useState(""); const [searchQuery, setSearchQuery] = useState(""); + const [directoryOpen, setDirectoryOpen] = useState(false); + const [hiddenSelection, setHiddenSelection] = useState<{ id: string; name: string }>(); const [inspectorOpen, setInspectorOpen] = useState(true); + const relationshipNoun = "relationships"; useEffect(() => { - const selectionExists = selection?.kind === "section" - ? overview.sections.some((section) => section.id === selection.id) + const selectionExists = selection?.kind === "group" + ? overview.groups.some((section) => section.id === selection.id) + || hiddenSelection?.id === selection.id : selection?.kind === "route" ? overview.routes.some((route) => route.id === selection.id) : false; if (selection && !selectionExists) { - setSelection(firstSection ? { kind: "section", id: firstSection.id } : undefined); + setSelection(firstGroup ? { kind: "group", id: firstGroup.id } : undefined); return; } - if (!selection && firstSection) { - setSelection({ kind: "section", id: firstSection.id }); + if (!selection && firstGroup) { + setSelection({ kind: "group", id: firstGroup.id }); return; } - if (selection?.kind === "section") { - host.requestSection(selection.id, sectionTab, 1, detailQuery); + if (selection?.kind === "group") { + host.requestGroup(selection.id, groupTab, 1, detailQuery); } else if (selection?.kind === "route") { host.requestRoute(selection.id, 1, detailQuery); } - }, [detailQuery, firstSection, host, overview.routes, overview.sections, sectionTab, selection]); + }, [detailQuery, firstGroup, hiddenSelection, host, overview.routes, overview.groups, groupTab, selection]); - const selectedSection = selection?.kind === "section" - ? overview.sections.find((section) => section.id === selection.id) + const selectedGroup = selection?.kind === "group" + ? overview.groups.find((section) => section.id === selection.id) + ?? (hiddenSelection?.id === selection.id ? { + id: hiddenSelection.id, + name: hiddenSelection.name, + nodeCount: 0, + totalNodeCount: 0, + internalRelationshipCount: 0, + incomingRelationships: 0, + outgoingRelationships: 0, + scopes: { production: 0, test: 0, generated: 0, vendor: 0, documentation: 0, unknown: 0 } + } : undefined) : undefined; const selectedRoute = selection?.kind === "route" ? overview.routes.find((route) => route.id === selection.id) : undefined; - const displayedSectionPage = sectionPage && sectionPage.sectionId === selectedSection?.id - && sectionPage.kind === sectionTab ? sectionPage : undefined; + const displayedGroupPage = groupPage && groupPage.groupId === selectedGroup?.id + && groupPage.kind === groupTab ? groupPage : undefined; const displayedRoutePage = routePage?.routeId === selectedRoute?.id ? routePage : undefined; const select = (next: Exclude) => { + setHiddenSelection(undefined); setSelection(next); setDetailQuery(""); - if (next.kind === "section") { + if (next.kind === "group") { setSectionTab("symbols"); } }; const updateSearch = (value: string) => { + setDirectoryOpen(false); setSearchQuery(value); host.search(value, 1); }; @@ -114,17 +131,17 @@ export function ArchitectureFlow({

    @@ -134,13 +151,13 @@ export function ArchitectureFlow({ {section.totalNodeCount.toLocaleString()} total - {section.incomingCalls + section.outgoingCalls} + {section.incomingRelationships + section.outgoingRelationships} ))}
    {overview.statistics.totalNodes.toLocaleString()}symbols - {overview.statistics.totalCalls.toLocaleString()}calls + {overview.statistics.totalRelationships.toLocaleString()}{relationshipNoun} {overview.statistics.communities.toLocaleString()}groups
    @@ -156,10 +173,10 @@ export function ArchitectureFlow({ aria-label="Search the complete architecture" onChange={(event) => updateSearch(event.target.value)} /> - {searchQuery && ( + {(searchQuery || directoryOpen) && ( {searchPage?.total.toLocaleString() ?? "…"} matches )} - {searchQuery && searchPage && ( + {(searchQuery || directoryOpen) && searchPage && (
    {searchPage.items.length > 0 ? searchPage.items.map((result) => ( )) :

    No matches for “{searchQuery}”

    } + {searchPage.pageCount > 1 && ( +
    + + Page {searchPage.page} of {searchPage.pageCount} + +
    + )}
    )} @@ -187,14 +227,14 @@ export function ArchitectureFlow({ @@ -206,7 +246,11 @@ export function ArchitectureFlow({ value={overview.evidence} aria-label="Filter architecture evidence" onChange={(event) => - host.setFilters(overview.scope, event.target.value as ArchitectureEvidence) + host.setFilters( + overview.scope, + event.target.value as ArchitectureEvidence, + overview.lens + ) } > @@ -215,6 +259,25 @@ export function ArchitectureFlow({ + )} @@ -257,32 +333,41 @@ export function ArchitectureFlow({ {inspectorOpen && (